curl-library
Re: FW: scp upload failure memory leak
Date: Thu, 29 May 2008 07:42:35 +0200 (CEST)
On Wed, 28 May 2008, Jeff Weber wrote:
> I found 2 different scenarios where the the ssh state machine was
> spinning:
>
> If the state was SSH_SCP_WAIT_EOF, libssh2_channel_wait_eof() keeps
> returning LIBSSH2_ERROR_EAGAIN. The state machine could never leave
> the SSH_SCP_WAIT_EOF state.
>
> If the state was SSH_SCP_UPLOAD_INIT, libssh2_scp_send_ex() keeps
> returning LIBSSH2_ERROR_EAGAIN. The state machine could never leave
> the SSH_SCP_UPLOAD_INIT state.
Argh. These two issues seem like mostly problems in libssh2 that we suffer
from.
I think the libcurl part of this problem is similar to the known bug #53 (see
http://curl.haxx.se/docs/knownbugs.html) in that while libcurl does uploading
it just waits for the socket to become writable and then calls the underlying
library, but libssh2 has multiple internal states and at times it rather wants
to _read_ from the socket and then libcurl still wronly waits for a writable
socket and thus goes busy-looping like crazy...
While I believe libssh2 is the best SSH library around, it still has a few
bugs and quirks that need to be worked out. Unfortunately that project (like
many others) lacks manpower... :-/
-- / daniel.haxx.seReceived on 2008-05-29