Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5e14e461a50ff41cd7344e96424137b23cb7c166
Ticket: 2812527fffffffffffffffffffffffffffffffff
ftp library - connection close
User & Date: russellbell on 2009-06-26 03:17:44
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I've found a bug in the ftp client library 2.4.8 that bites
    when a connection is closed.  When you call ::ftp::Close $handle
    you sometimes get a TCL exception (thrown in an event handler
    so a catch around ::ftp::Close doesn't help) and sometimes
    you get an endless loop.  Depends on the ftp server you're
    talk to and doesn't happen consistently, but enough to be
    annoying.
    
    The faulty code is about line 35 of ::ftp::StateHandler which
    does "set number [gets $sock bufline]".  This code reads
    a continuation line, so normally isn't called after the
    socket is closed, but sometimes it is and an exception is
    the result.  Fix is to wrap in a catch, easy enough.
    
    But then the second bug bites - this code is in a loop and
    if the gets returns <= 0, the loop is infinite.  Fix is to
    break from the loop, and change the code structure a little
    to ensure "if { [eof $ftp(CtrlSock)] } ..." gets called
    in this case.
    
    I believe this is a separate issue to 1076923 found by Keith
    Vetter - that was the gets on line 16 of ::ftp::StateHandler.
    
    If it's helpful I can provide source for my fix to ftp 2.4.8,
    [email protected]
    
    
    
  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: "russellbell"
  10. subsystem changed to: "55. Other Tools"
  11. title changed to: "ftp library - connection close"
  12. type changed to: "Bug"