Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-16
23:24 • Ticket [218557ffff] can't catch ::eof error in ::http::CopyDone status s... artifact: f1903699c5 user: dgp
2000-10-26
08:24 • Deleted ticket [218557ffff]. artifact: 204ffd40cd user: welch
01:02 • New ticket [218557ffff]. artifact: 69e0b71afb user: nobody

can't catch ::eof error in ::http::CopyDone

Deleted218557ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:02:08
OriginalBugID: 1108 Bug
Version: 8.0.4
SubmitDate: '1999-01-26'
LastModified: '1999-02-02'
Severity: SER
Status: Released
Submitter: welch
ChangedBy: stanton
OS: Linux
OSVersion: slackware 3.5, kernel 2.0.36
Machine: Other
FixedDate: '1999-02-02'
FixedInVersion: 8.0.5
ClosedDate: '2000-10-25'


Name:

Luc Deschenaux



Extensions:

tk, http2.0



CustomShell:

I just modified that line.. 



ReproducibleScript:

The error occurs after a ::http::reset during

a catch {::http:geturl -progress}



I can't catch it !.. the progress proc is calling update

and ::http::reset is called from a button -command







ObservedBehavior:

STACK TRACE_______________________________________________

can not find channel named "sock5"

    while executing

"::eof $s"

    (procedure "http::CopyDone" line 11)

    invoked from within

"http::CopyDone ::http::4 8192"







DesiredBehavior:

I wish tcl catch it for me as I think he is expected to do..







Patch:

*** http.tcl.orig       Sat Jan  9 05:58:08 1999

--- http.tcl    Sat Jan  9 05:59:24 1999

***************

*** 362,368 ****

      }

      if {([string length $error] != 0)} {

        Finish $token $error

!     } elseif {[::eof $s]} {

        Eof $token

      } else {

        CopyStart $s $token

--- 362,368 ----

      }

      if {([string length $error] != 0)} {

        Finish $token $error

!     } elseif {[catch {::eof $s} iseof] || $iseof} {

        Eof $token

      } else {

        CopyStart $s $token









PatchFiles:

Tcl8.0/http2.0/http.tcl









The patch is only a workaround. The relevant fact is that wish display an error message when eof fails in a child procedure while the parent procedure is called from within a catch statement.

I think...  but I'm new to Tcl/Tk I can be wrong... I have just read the first lines of catch man page..

may I include the patched file http.tcl within my application instead of patching http.tcl and using "package require http", in order to avoid forcing users to patch their httpd.tcl ? or have you a better solution ?
welch Deleted ticket [218557ffff]. [History diff]2000-10-26 08:24:14
dgp Ticket [218557ffff]: 3 changes [History diff]2001-04-16 23:24:31
Log in (anonymous is fine) to add a comment.