cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-2006544 ] postquote commands not being sent to remote sftp s

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Wed, 09 Jul 2008 22:21:20 +0000

Bugs item #2006544, was opened at 2008-06-30 10:54
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2006544&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: wrong behaviour
>Status: Pending
Resolution: None
Priority: 5
Private: No
Submitted By: billmon (billmon)
Assigned to: Daniel Stenberg (bagder)
Summary: postquote commands not being sent to remote sftp s

Initial Comment:
I've observed that on multi-interface sftp operations (and it might also occur on easy interface, nbut I did not check this), postquote commands (as in curl_easy_setop(CURLOPT_POSTQUOTE, <some cmd slist>) are not being sent to the sftp server [after the transfer] as they should be.

In a debug session, I observed that the ssh.c::ssh_done function was prematurely exiting when the state flag 'done' is still 0 and when there are queued-up post quote commands still not processed (I believe conn->proto.sshc.state == SSH_SFTP_QUOTE at the return).

I'm attaching a patch that I tested and it appears to work however, given that it introduces a "while" loop over the call to ssh_multi_statemach, I would greatly appreciate it if a more seasoned libcurl developer would double-check the change.

----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2008-07-10 00:21

Message:
Logged In: YES
user_id=1110
Originator: NO

Assuming that you won't do anything further on this issue, I'll add a
mention of this flaw in the KNOWN_BUGS document.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2008-06-30 16:34

Message:
Logged In: YES
user_id=1110
Originator: NO

Yes I can see how this patch cures the problems you experience, but this
fix will also effectively make the multi interface block (and busy-loop
internally) during the entire time it sends the post quote commands.

I would instead suggest that the bug here is that we don't have a proper
system internally that allows the multi interface to remain in the
CURM_STATE_DONE state until the protocol is completed with its business. If
you check lib/multi.c:1352 it is a call to Curl_done() that then
unconditionally continue to the next state (CURLM_STATE_COMPLETED) without
any means to do differently.

A sensible fix would probably be to insert a new state after DONE but
before COMPLETED, and have protocols able to switch to that state when they
have multiple things to do when done. Noticably, the FTP code has the same
post-quote problem already and it does the "blocking" part but without
busy-loop.

I could agree to a incomplete fix to this problem to add while we're
planning or working on the "real fix", if it would remove the
busy-looping.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2006544&group_id=976
Received on 2008-07-10

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET