1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

- SCP and SFTP with the multi interface had the same flaw: the 'DONE'

operation didn't complete properly if the EAGAIN equivalent was returned but
  libcurl would simply continue with a half-completed close operation
  performed. This ruined persistent connection re-use and cause some
  SSH-protocol errors in general. The correction is unfortunately adding a
  blocking function - doing it entirely non-blocking should be considered for
  a better fix.
This commit is contained in:
Daniel Stenberg 2008-12-17 12:32:41 +00:00
parent abb74a1203
commit 03ca98b0df
3 changed files with 23 additions and 19 deletions

View File

@ -6,6 +6,15 @@
Changelog
Daniel Stenberg (17 Dec 2008)
- SCP and SFTP with the multi interface had the same flaw: the 'DONE'
operation didn't complete properly if the EAGAIN equivalent was returned but
libcurl would simply continue with a half-completed close operation
performed. This ruined persistent connection re-use and cause some
SSH-protocol errors in general. The correction is unfortunately adding a
blocking function - doing it entirely non-blocking should be considered for
a better fix.
Gisle Vanem (16 Dec 2008)
- Added the possibility to use the Watt-32 tcp/ip stack under Windows.
The change simply involved adding a USE_WATT32 section in the

View File

@ -31,6 +31,7 @@ This release includes the following bugfixes:
o curl_easy_duphandle() doesn't try to duplicate the connection cache pointer
o build failure on OS/400 when enabling IPv6
o better detection of SFTP failures
o improved connection re-use for subsequent SCP and SFTP trnasfers
This release includes the following known bugs:

View File

@ -2309,30 +2309,24 @@ static CURLcode scp_disconnect(struct connectdata *conn)
static CURLcode ssh_done(struct connectdata *conn, CURLcode status)
{
CURLcode result = CURLE_OK;
bool done = FALSE;
struct SSHPROTO *sftp_scp = conn->data->state.proto.ssh;
if(status == CURLE_OK) {
/* run the state-machine */
if(conn->data->state.used_interface == Curl_if_multi) {
result = ssh_multi_statemach(conn, &done);
}
else {
result = ssh_easy_statemach(conn);
done = TRUE;
}
}
else {
result = status;
done = TRUE;
}
/* run the state-machine
if(done) {
struct SSHPROTO *sftp_scp = conn->data->state.proto.ssh;
TODO: when the multi interface this _really_ should be using the
ssh_multi_statemach function but we have no general support for
non-blocking DONE operations, not in the multi state machine and with
Curl_done() invokes on several places in the code!
*/
result = ssh_easy_statemach(conn);
}
else
result = status;
Curl_safefree(sftp_scp->path);
sftp_scp->path = NULL;
Curl_pgrsDone(conn);
}
return result;
}