Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c803b86bc1cfba8288be48ef2f8891f4e78b9a53
Ticket: 2914500fffffffffffffffffffffffffffffffff
bad handling of errors in http::geturl callback
User & Date: dvrsn on 2009-12-15 00:55:36
Changes

  1. assignee changed to: "patthoyts"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    If an error occurs in a http::geturl callback proc after the token has already been cleaned up, you get a very confusing stack trace.  There is no issue with cleaning up the token in a callback or with raising an error in a callback (although perhaps this case should be reported as a background error), only when the token is cleaned up and then the callback does not complete successfully.
    
    Example:
    package require http
    
    proc bgerror {e} {
        puts "bgerror:\n$::errorInfo"
        exit
    }
    
    proc handle {tok} {
        http::cleanup $tok
        stupid error  
    }   
    
    http::geturl http://www.yahoo.com/ -command handle
    
    set done 0
    after 10000 {set done 1}
    vwait done
    
    bgerror:
    can't read "state(sock)": no such element in array
        while executing
    "CloseSocket $state(sock) $token"
        (procedure "Finish" line 12)
        invoked from within
    "Finish $token $err"
        (procedure "http::Event" line 154)
        invoked from within
    "http::Event sock6 ::http::1"
    
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "dvrsn"
  10. subsystem changed to: "29. http Package"
  11. title changed to: "bad handling of errors in http::geturl callback"
  12. type changed to: "Bug"