www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: libssh2_scp_recv is not populating struct stat

Re: libssh2_scp_recv is not populating struct stat

From: ţ <unix_at_vip.qq.com>
Date: Thu, 11 Oct 2012 18:09:55 +0800

hi,Peter,
     Please check the attachments.
  
 Thanks.
 ------------------ Original ------------------
  From: "Peter Stuge"<peter_at_stuge.se>;
 Date: Thu, Oct 11, 2012 04:27 PM
 To: "libssh2-devel"<libssh2-devel_at_cool.haxx.se>;
 
 Subject: Re: libssh2_scp_recv is not populating struct stat

 

ţ wrote:
> I using openssl-0.9.8p,I got the following text:
>
> ~/libssh2-1.4.2/example# ./scp 10.129.139.140 mqq mqq2005 /usr/local/app/everpan/hello
> [libssh2] 0.735658 Socket: Sent 23/23 bytes at 0x2aaf4b32637d+0
> [libssh2] 0.735760 Socket: Error recving 1 bytes: 11
> [libssh2] 0.735792 Failure Event: -37 - Failed getting banner
> [libssh2] 0.736589 Socket: Recved 1 bytes banner
> [libssh2] 0.736630 Socket: Recved 1 bytes banner
> [libssh2] 0.736659 Socket: Recved 1 bytes banner
> [libssh2] 0.736686 Socket: Recved 1 bytes banner
> [libssh2] 0.736711 Socket: Recved 1 bytes banner
> [libssh2] 0.736736 Socket: Recved 1 bytes banner
> [libssh2] 0.736760 Socket: Recved 1 bytes banner
> [libssh2] 0.736784 Socket: Recved 1 bytes banner
> [libssh2] 0.736967 Socket: Recved 1 bytes banner
> [libssh2] 0.737001 Socket: Recved 1 bytes banner
> [libssh2] 0.737026 Socket: Recved 1 bytes banner
> [libssh2] 0.737085 Socket: Recved 1 bytes banner
> [libssh2] 0.737116 Socket: Recved 1 bytes banner
> [libssh2] 0.737141 Socket: Recved 1 bytes banner
> [libssh2] 0.737314 Socket: Recved 1 bytes banner
> [libssh2] 0.738757 Socket: Recved 1 bytes banner
> [libssh2] 0.738783 Socket: Recved 1 bytes banner
> [libssh2] 0.738807 Socket: Recved 1 bytes banner
> [libssh2] 0.738832 Socket: Recved 1 bytes banner
> [libssh2] 0.738856 Socket: Recved 1 bytes banner
> [libssh2] 0.738880 Socket: Recved 1 bytes banner
> [libssh2] 0.738904 Socket: Recved 1 bytes banner
> [libssh2] 0.738927 Socket: Recved 1 bytes banner
> [libssh2] 0.738951 Socket: Recved 1 bytes banner
> [libssh2] 0.738975 Socket: Recved 1 bytes banner
> [libssh2] 0.739006 Socket: Recved 1 bytes banner
> [libssh2] 0.739031 Socket: Recved 1 bytes banner
> [libssh2] 0.739055 Socket: Recved 1 bytes banner
> [libssh2] 0.739079 Socket: Recved 1 bytes banner
> [libssh2] 0.739115 Socket: Recved 1 bytes banner
> [libssh2] 0.739139 Socket: Recved 1 bytes banner
> [libssh2] 0.739164 Socket: Recved 1 bytes banner
> [libssh2] 0.739188 Socket: Recved 1 bytes banner
> [libssh2] 0.739212 Socket: Recved 1 bytes banner
> [libssh2] 0.739236 Socket: Recved 1 bytes banner
> [libssh2] 0.739260 Socket: Recved 1 bytes banner
> [libssh2] 0.739298 Socket: Recved 1 bytes banner
> [libssh2] 0.739325 Socket: Recved 1 bytes banner
> [libssh2] 0.739350 Socket: Recved 1 bytes banner
> [libssh2] 0.739374 Socket: Recved 1 bytes banner
> [libssh2] 0.739401 Socket: Recved 1 bytes banner
> [libssh2] 0.739425 Socket: Recved 1 bytes banner
> [libssh2] 0.739451 Socket: Recved 1 bytes banner
> [libssh2] 0.739475 Socket: Recved 1 bytes banner
> [libssh2] 0.739499 Socket: Recved 1 bytes banner
> [libssh2] 0.739523 Socket: Recved 1 bytes banner
> [libssh2] 0.739547 Socket: Recved 1 bytes banner
> [libssh2] 0.739571 Socket: Recved 1 bytes banner
> [libssh2] 0.739596 Socket: Recved 1 bytes banner
> [libssh2] 0.739620 Socket: Recved 1 bytes banner
> [libssh2] 0.739644 Socket: Recved 1 bytes banner
> [libssh2] 0.739833 Socket: Sent 648/648 bytes at 0x509958
> [libssh2] 0.739874 Socket: Recved 488/16384 bytes to 0x505918+0
> [libssh2] 0.740190 Socket: Sent 144/144 bytes at 0x509958
> [libssh2] 0.740225 Failure Event: -37 - Unable to exchange encryption keys
> [libssh2] 0.806597 Socket: Recved 1040/16384 bytes to 0x505918+0
> [libssh2] 0.808541 Socket: Sent 16/16 bytes at 0x509958
> [libssh2] 0.808580 Failure Event: -37 - Unable to exchange encryption keys
> [libssh2] 0.808745 Socket: Recved 32/16384 bytes to 0x505918+0
> [libssh2] 0.808854 Socket: Sent 52/52 bytes at 0x509958
> [libssh2] 0.809098 Socket: Recved 88/16384 bytes to 0x505918+0
> Fingerprint: 8E FF 9F AD 59 BB 28 0D CE BD 96 1C 80 56 7B 3A DF 65 FD D2
> [libssh2] 0.809636 Socket: Sent 84/84 bytes at 0x509958
> [libssh2] 0.809668 Failure Event: -37 - Would block waiting
> [libssh2] 0.810919 Socket: Recved 1096/16384 bytes to 0x505918+0
> [libssh2] 0.811015 SCP: Opening channel for SCP receive
> [libssh2] 0.811044 Conn: Allocated new channel ID#0
> [libssh2] 0.811068 Conn: Opening Channel - win 262144 pack 32768
> [libssh2] 0.811116 Socket: Sent 68/68 bytes at 0x509958
> [libssh2] 0.811147 Failure Event: -37 - Would block
> [libssh2] 0.811177 Failure Event: -37 - Would block starting up channel
> [libssh2] 0.811352 Socket: Recved 88/16384 bytes to 0x505918+0
> [libssh2] 0.811408 Conn: Connection Established - ID: 0/0 win: 100000/262144 pack: 32768/32768
> [libssh2] 0.811440 Conn: starting request(exec) on channel 0/0, message=scp -pf '/usr/local/app/everpan/hello'
> [libssh2] 0.811489 Socket: Sent 148/148 bytes at 0x509958
> [libssh2] 0.811521 Failure Event: -37 - Would block requesting SCP startup
> [libssh2] 0.812461 Socket: Recved 72/16384 bytes to 0x505918+0
> [libssh2] 0.812515 SCP: Sending initial wakeup
> [libssh2] 0.812549 Conn: Writing 1 bytes on channel 0/0, stream #0
> [libssh2] 0.812576 Conn: Sending 1 bytes on channel 0/0, stream_id=0
> [libssh2] 0.812616 Socket: Sent 52/52 bytes at 0x509958
> [libssh2] 0.812644 Conn: channel_read() wants 1 bytes from channel 0/0 stream #0
> [libssh2] 0.812671 Failure Event: -37 - would block
> [libssh2] 0.812695 Failure Event: -37 - Would block waiting for SCP response
> [libssh2] 0.830842 Conn: channel_read() wants 1 bytes from channel 0/0 stream #0
> [libssh2] 0.830891 Socket: Recved 120/16384 bytes to 0x505918+0
> [libssh2] 0.830938 Conn: 31 bytes packet_add() for 0/0/46931107643393
> [libssh2] 0.830968 Failure Event: -37 - would block
> [libssh2] 0.830993 Failure Event: -37 - Would block waiting for SCP response
> [libssh2] 0.867357 Conn: channel_read() wants 1 bytes from channel 0/0 stream #0
> [libssh2] 0.867412 Socket: Recved 360/16384 bytes to 0x505918+0
> [libssh2] 0.867458 Conn: 92 bytes packet_add() for 0/0/46931107643393
> [libssh2] 0.867499 Conn: Channel 0 received request type exit-status (wr 0)
> [libssh2] 0.867528 Conn: Exit status 255 received for channel 0/0
> [libssh2] 0.867562 Conn: Close received for channel 0/0
> [libssh2] 0.867593 Conn: Freeing channel 0/0 resources
> [libssh2] 0.867619 Conn: Sending EOF on channel 0/0
> [libssh2] 0.867657 Socket: Sent 36/36 bytes at 0x509958
> [libssh2] 0.867686 Conn: Closing channel 0/0
> [libssh2] 0.867719 Socket: Sent 36/36 bytes at 0x509958
> [libssh2] 0.867761 Socket: Sent 84/84 bytes at 0x509958
> all done

The above output looks all right.


> I just add one code in example/scp.c
> libssh2_trace(session,LIBSSH2_TRACE_CONN | LIBSSH2_TRACE_SOCKET | LIBSSH2_TRACE_SCP | LIBSSH2_TRACE_ERROR );

Please change to:

libssh2_trace(session, ~0);

and then send complete output for when the example uses libgcrypt.

Thanks!


//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Received on 2012-10-11

the libssh2 team