Subject: Re: libssh2_sftp_init() hangs and does not return while consuming 100% CPU

Re: libssh2_sftp_init() hangs and does not return while consuming 100% CPU

From: Ismail Aseen <ismaildeh_at_yahoo.com>
Date: Mon, 4 Apr 2016 04:42:29 +0000 (UTC)

Thanks Alex/Peter to replying to my message. My original problem was one of my thread consuming 100% CPU while initiating a file transfer using libssh2. The stack trace showed it is in recv system call (I thought it is unlikely to consume 100 CPU while in a recv call). So I thought some loop should be calling the same function stack repeatedly to consume the CPU and leading to the stack output which I sent on the earlier email. Is there any possibility that a "channel_read" call returning zero and it is repeatedly called by sftp_packet_read function in a loop in sftp.c:377. Please excuse me if I missed a very basic thing which I did not understand.
Thanks & Regards,Ismail Aseen
 

    On Sunday, 3 April 2016, 21:07, Peter Stuge <peter_at_stuge.se> wrote:
 

 Ismail Aseen wrote:
> Adding one more point to the above mail, in the function
> sftp_packet_read in sftp.c file, is it a defect to not to address
> the zero return from _libssh2_channel_read function  in the while
> loop found in sftp.c:377 ?

Not neccessarily - it should just mean that the channel has received
no data during this call to channel_read.

//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 2016-04-04