I don't know for sure if this is related to Jeremy's issue so I didn't want to hijack his thread.
I am uploading a 32MB file over SFTP using libssh2_sftp_write, I am not specifically setting any blocking mode on the session. I right now have a 32K buffer and I see the trace below (trace set with "LIBSSH2_TRACE_ERROR|LIBSSH2_TRACE_CONN|LIBSSH2_TRACE_SFTP"). I was running a 64K buffer with similar errors but don't have a trace for that session. What bothers me is the window adjust and then channel exit. Can you tell me where to look for the different Exit statuses? Without seeing any source code that duplicates this I know I am asking for a lot but from the trace is there something that stands out? I will try to see if I can get one of the SFTP samples to produce the same results. On the ssh server the only thing I see is "sftp-server: error: bad message from ###.###.###.### local user ******", no other errors. FYI, this is in Windows if that makes a difference. Last detail - this same code works with 0.18 although I know quite a bit has changed since 0.18. [libssh2] 0.722649 SFTP: Initializing SFTP subsystem [libssh2] 0.722649 Conn: Allocated new channel ID#0 [libssh2] 0.722649 Conn: Opening Channel - win 65536 pack 32768 [libssh2] 0.723649 Failure Event: -37 - Would block [libssh2] 0.723649 Failure Event: -37 - Would block starting up channel [libssh2] 0.726650 Conn: Connection Established - ID: 0/0 win: 0/65536 pack: 32768/32768 [libssh2] 0.726650 Conn: starting request(subsystem) on channel 0/0, message=sftp [libssh2] 0.727650 Failure Event: -37 - Would block to request SFTP subsystem [libssh2] 0.746652 Conn: Window adjust received for channel 0/0, adding 131072 bytes, new window_size=131072 [libssh2] 0.746652 Conn: Setting channel 0/0 handle_extended_data mode to 1 [libssh2] 0.746652 SFTP: Sending FXP_INIT packet advertising version 3 support [libssh2] 0.747652 Conn: Writing 9 bytes on channel 0/0, stream #0 [libssh2] 0.747652 Conn: Sending 9 bytes on channel 0/0, stream_id=0 [libssh2] 0.747652 SFTP: Requiring packet 2 id 0 [libssh2] 0.748652 SFTP: Asking for 2 packet [libssh2] 0.748652 SFTP: recv packet [libssh2] 0.748652 Conn: channel_read() wants 4 bytes from channel 0/0 stream #0 [libssh2] 0.748652 Failure Event: -37 - Would block waiting for response from SFTP subsystem [libssh2] 0.762653 SFTP: Requiring packet 2 id 0 [libssh2] 0.762653 SFTP: Asking for 2 packet [libssh2] 0.762653 SFTP: recv packet [libssh2] 0.762653 Conn: channel_read() wants 4 bytes from channel 0/0 stream #0 [libssh2] 0.763653 Conn: 9 bytes packet_add() for 0/0/0 [libssh2] 0.763653 Conn: channel_read() got 4 of data from 0/0/0 [libssh2] 0.763653 Conn: Adjusting window 39321600 bytes for data on channel 0/0 [libssh2] 0.763653 Conn: channel_read() filled 4 adjusted 4 [libssh2] 0.765654 SFTP: Data begin - Packet Length: 5 [libssh2] 0.767654 Conn: channel_read() got 5 of data from 0/0/0 [ul] [libssh2] 0.768654 SFTP: Received packet 2 (len 5) [libssh2] 0.770654 SFTP: Asking for 2 packet [libssh2] 0.772654 SFTP: Got 2 [libssh2] 0.774654 SFTP: Enabling SFTP version 3 compatability [libssh2] 0.781655 SFTP: Sending directory open request [libssh2] 0.783655 Conn: Writing 34 bytes on channel 0/0, stream #0 [libssh2] 0.784655 Conn: Sending 34 bytes on channel 0/0, stream_id=0 [libssh2] 0.786656 SFTP: Asking for 102 packet [libssh2] 0.788656 SFTP: Asking for 101 packet [libssh2] 0.789656 SFTP: recv packet [libssh2] 0.791656 Failure Event: -37 - Would block waiting for status message [libssh2] 0.807658 SFTP: Asking for 102 packet [libssh2] 0.808658 SFTP: Asking for 101 packet [libssh2] 0.810658 SFTP: recv packet [libssh2] 0.812658 Conn: channel_read() wants 4 bytes from channel 0/0 stream #0 [libssh2] 0.815659 Conn: 17 bytes packet_add() for 0/0/0 [libssh2] 0.816659 Conn: channel_read() got 4 of data from 0/0/0 [libssh2] 0.818659 SFTP: Data begin - Packet Length: 13 [libssh2] 0.820659 Conn: channel_read() got 13 of data from 0/0/0 [ul] [libssh2] 0.821659 SFTP: Received packet 102 (len 13) [libssh2] 0.823659 SFTP: Asking for 102 packet [libssh2] 0.825660 SFTP: Open command successful [libssh2] 0.827660 SFTP: Sending file open request [libssh2] 0.828660 Conn: Writing 56 bytes on channel 0/0, stream #0 [libssh2] 0.830660 Conn: Sending 56 bytes on channel 0/0, stream_id=0 [libssh2] 0.832660 SFTP: Asking for 102 packet [libssh2] 0.833660 SFTP: Asking for 101 packet [libssh2] 0.835661 SFTP: recv packet [libssh2] 0.837661 Conn: 17 bytes packet_add() for 0/0/0 [libssh2] 0.838661 Conn: channel_read() got 4 of data from 0/0/0 [libssh2] 0.841661 SFTP: Data begin - Packet Length: 13 [libssh2] 0.842661 Conn: channel_read() got 13 of data from 0/0/0 [ul] [libssh2] 0.844661 SFTP: Received packet 102 (len 13) [libssh2] 0.846662 SFTP: Asking for 102 packet [libssh2] 0.848662 SFTP: Open command successful [libssh2] 5.866164 SFTP: Writing 32768 bytes [libssh2] 5.869164 Conn: Writing 32768 bytes on channel 0/0, stream #0 [libssh2] 5.870164 Conn: Sending 32768 bytes on channel 0/0, stream_id=0 [libssh2] 5.880165 Conn: Writing 32768 bytes on channel 0/0, stream #0 [libssh2] 5.882165 Conn: Sending 32768 bytes on channel 0/0, stream_id=0 [libssh2] 5.892166 Failure Event: -37 - Unable to send channel data [libssh2] 5.928170 Conn: Writing 32768 bytes on channel 0/0, stream #0 [libssh2] 5.930170 Conn: Sending 32768 bytes on channel 0/0, stream_id=0 [libssh2] 5.940171 Conn: Writing 32768 bytes on channel 0/0, stream #0 [libssh2] 5.942171 Conn: Splitting write block due to 32669 byte window_size on 0/0/0 [libssh2] 5.945171 Conn: Sending 32669 bytes on channel 0/0, stream_id=0 [libssh2] 5.954172 Conn: Window adjust received for channel 0/0, adding 48995 bytes, new window_size=48995 [libssh2] 5.957173 Conn: Exit status 11 received for channel 0/0 [libssh2] 5.959173 Conn: 28 bytes packet_add() for 0/0/0 [libssh2] 5.961173 Conn: Sending 99 bytes on channel 0/0, stream_id=0 [libssh2] 5.962173 Failure Event: -37 - Unable to send channel data [libssh2] 5.964173 Conn: Writing 32768 bytes on channel 0/0, stream #0 [libssh2] 5.966174 Conn: EOF received for channel 0/0 [libssh2] 5.968174 Conn: Close received for channel 0/0 [libssh2] 5.970174 Conn: Sending 32768 bytes on channel 0/0, stream_id=0 [libssh2] 5.979175 Conn: Writing 32768 bytes on channel 0/0, stream #0 [libssh2] 5.981175 Conn: Splitting write block due to 16128 byte window_size on 0/0/0 [libssh2] 5.985175 Conn: Sending 16128 bytes on channel 0/0, stream_id=0 [libssh2] 5.994176 Conn: Writing 32768 bytes on channel 0/0, stream #0 [libssh2] 5.996177 Conn: Writing 32768 bytes on channel 0/0, stream #0 .....The rest of the trace is filled with these "Writing 32768 bytes" on a channel that now looks closed _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
