Subject: Error Receiving a File SCP

Error Receiving a File SCP

From: Barry Fawthrop <barryf_at_ttienterprises.org>
Date: Wed, 23 May 2012 08:09:47 -0400

I am able to connect But Unable to receive a File
Using the same code as example/scp.c (tried even the scp_nonblock.c)

Trace taken from the working example/scp.c

Read B lines come from my trace additions to transport.c _libssh2_transport_read Function

Read B 2 just before if (session->state & LIBSSH2_STATE_NEWKEYS) {
Read B 3 just after remainbuf = p->writeidx - p->readied; prints writeidx and readidx values
Read B 3 just before if (remainbuf < blocksize) { prints remainbuf and blocksize values
Read B 3 A inside if (remainbuf < blocksize) { prints remainbuf value
Read B 3 B just before nread = LIBSSH2_RECV(session, &p->buf[remainbuf], PACKETBUFSIZE - remainbuf, ...
Read B 3 C right after the nread = LIBSSH2_RECV(session,

===== …. ==== sections appear during scp.c execution which works
but NOT during my execution

Code STOPS in the LIBSSH2_RECV function

Any Help Please ! !

Thanks in advance

:: [libssh2] 0.919596 Transport: Packet type 91 received, length=17
:: [libssh2] 0.919603 Transport: Looking for packet of type: 91
:: [libssh2] 0.919608 Conn: Connection Established - ID: 0/0 win: 0/262144 pack: 140381006102528/4295000064
:: [libssh2] 0.919622 Conn: starting request(exec) on channel 0/0, message=scp -pf 'code.xml'
:: [libssh2] 0.919658 Socket: Sent 84/84 bytes at 0x7fadb9005658
:: [libssh2] 0.919711 Transport: Looking for packet of type: 99
:: [libssh2] 0.919719 Transport: Looking for packet of type: 100
Read B
Read B 1
Read B 2
Read B 3 52 52
Read B 3 (0) (16)
Read B 3 A (0)
Read B 3 B

====================================================================
THIS INDENTED BLOCK DOES NOT APPEAR DURING MY CODE EXECUTION
              Read B 3 C (-35)
              :: [libssh2] 0.919747 Failure Event: -37 - Would block requesting SCP startup
              :: [libssh2] 0.925962 Transport: Looking for packet of type: 99
              :: [libssh2] 0.925990 Transport: Looking for packet of type: 100
              Read B
              Read B 1
              Read B 2
              Read B 3 0 0
              Read B 3 (0) (16)
              Read B 3 A (0)
              Read B 3 B
====================================================================

Read B 3 C (88)
:: [libssh2] 0.926056 Socket: Recved 88/16384 bytes to 0x7fadb9001618+0
Read B 4 (88)
Read B 5 (36) (72)
Read B 6
Read B 6 A
Read B 6 B
Read B 7 (16)
Read B 8 (20)
Read B 9 (0) (47) (47)
:: [libssh2] 0.926135 Transport: Packet type 93 received, length=9
:: [libssh2] 0.926148 Conn: Window adjust for channel 0/0, adding 2097152 bytes, new window_size=2097152
Read B
Read B 1
Read B 2
Read B 3 88 52
Read B 3 (36) (16)
Read B 4 (36)
Read B 5 (20) (20)
Read B 6
Read B 6 A
Read B 6 B
Read B 7 (0)
Read B 8 (20)
Read B 9 (0) (31) (31)
:: [libssh2] 0.926243 Transport: Packet type 99 received, length=5
:: [libssh2] 0.926256 Transport: Looking for packet of type: 99
:: [libssh2] 0.926267 SCP: Sending initial wakeup
write 1
:: [libssh2] 0.926298 Conn: Writing 1 bytes on channel 0/0, stream #0
write 2
write 3
write 4 Read B
Read B 1
Read B 2
Read B 3 88 88
Read B 3 (0) (16)

====================================================================
THIS INDENTED BLOCK DOES NOT APPEAR DURING MY CODE EXECUTION
              Read B 3 A (0)
              Read B 3 B
              Read B 3 C (-35)
              :: [libssh2] 0.926377 Conn: Sending 1 bytes on channel 0/0, stream_id=0
              :: [libssh2] 0.926444 Socket: Sent 52/52 bytes at 0x7fadb9005658
              :: [libssh2] 0.926460 Conn: channel_read() wants 1 bytes from channel 0/0 stream #0
              Read B
              Read B 1
              Read B 2
              Read B 3 0 0
              Read B 3 (0) (16)
              Read B 3 A (0)
              Read B 3 B
              Read B 3 C (-35)
              :: [libssh2] 0.926519 Failure Event: -37 - would block
              :: [libssh2] 0.926528 Failure Event: -37 - Would block waiting for SCP response
              :: [libssh2] 0.927204 Conn: channel_read() wants 1 bytes from channel 0/0 stream #0
              Read B
              Read B 1
              Read B 2
              Read B 3 0 0
              Read B 3 (0) (16)
              Read B 3 A (0)
              Read B 3 B
              Read B 3 C (452)
              :: [libssh2] 0.927288 Socket: Recved 452/16384 bytes to 0x7fadb9001618+0
====================================================================

Read B 4 (452)
Read B 5 (436) (436)
Read B 6
Read B 6 A
Read B 6 B
Read B 7 (416)
Read B 8 (20)
Read B 9 (0) (447) (447)
:: [libssh2] 0.927389 Transport: Packet type 95 received, length=415
PACKET Extended Data
PACKET Data Channel
:: [libssh2] 0.927410 Conn: 402 bytes packet_add() for 0/0/1
Read B
Read B 1
Read B 2
Read B 3 452 452
Read B 3 (0) (16)
Read B 3 A (0)
Read B 3 B
 
<===== STOPS Here Just waits Thus is Hung Up in the LIBSSH2_RECV function ?

              Read B 3 C (-35)
              :: [libssh2] 0.927694 Failure Event: -37 - would block
              :: [libssh2] 0.927705 Failure Event: -37 - Would block waiting for SCP response
              :: [libssh2] 0.931757 Conn: channel_read() wants 1 bytes from channel 0/0 stream #0
              Read B
              Read B 1
              Read B 2
              Read B 3 0 0
              Read B 3 (0) (16)
              Read B 3 A (0)
              Read B 3 B
              Read B 3 C (68)
              :: [libssh2] 0.931842 Socket: Recved 68/16384 bytes to 0x7fadb9001618+0
              Read B 4 (68)
              ……
              …….

Thanks in advance

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-05-23