Subject: [libssh2] #205: "Error waiting for FXP_READ ACK" during large download on Windows

[libssh2] #205: "Error waiting for FXP_READ ACK" during large download on Windows

From: libssh2 Trac <trac_at_libssh2.stuge.se>
Date: Thu, 30 Dec 2010 17:52:01 -0000

#205: "Error waiting for FXP_READ ACK" during large download on Windows
------------------------+---------------------------------------------------
  Reporter: riordanmr | Owner:
      Type: defect | Status: new
  Priority: normal | Milestone: 1.2.8
 Component: API | Version: 1.2.7
  Keywords: | Blocks:
Blocked By: |
------------------------+---------------------------------------------------
 Occasionally during large downloads, libssh2_sftp_read returns -25, with
 error text "Error waiting for FXP_READ ACK".
 This problem seems to occur only on Windows, and not too often (only about
 1 of 5 attempts to download a 64 MB file). I'm using a 100 Mbit/second
 low-latency LAN.

 This occurs on the version in git as of 2010-12-28.

 The problem doesn't seem to occur when tracing is set to a high level. I
 have been able to reproduce the problem with tracing set to
 LIBSSH2_TRACE_CONN | LIBSSH2_TRACE_SFTP | LIBSSH2_TRACE_ERROR.
 The attached file contains the source to my test program, the trace
 output, and the program's output.

 When libssh2_sftp_read fails, the subsequent call to libssh2_sftp_close
 hangs indefinitely.
 ----------------------------------------------
 Interestingly, the problem originally manifested itself as the call to
 libssh2_sftp_close failing after a successful download. However, I can no
 longer reproduce that symptom, for reasons I don't understand. Here's my
 description, as posted to the mailing list on 2010-12-28 (USA time):

 The latest libssh2 often returns the error
 "Unable to send FXP_CLOSE command"
 from libssh2_sftp_close(sftp_handle) when it's called after a download.
 This is because in sftp_close_handle, after this line:

         rc = _libssh2_channel_write(channel, 0, handle->close_packet,
                                     packet_len);

 the code sees that rc is greater than packet_len. (At the time, I was
 able to step through this in the debugger and it was greater, not just not
 equal. It was about 20 bytes larger than packet_len.)

 In all cases that I've seen, the file been downloaded correctly.

 This seems to be a timing problem because, unfortunately,
 I haven't been able to reproduce the problem with full tracing.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/205>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-12-30