1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

- Brian Ulm reported a crash when doing a second SFTP transfer on a re-used

easy handle if curl_easy_reset() was used between them. I fixed it and Brian
  verified that it cured his problem.

- Brian Ulm reported that if you first tried to download a non-existing SFTP
  file and then fetched an existing one and re-used the handle, libcurl would
  still report the second one as non-existing as well! I fixed it abd Brian
  verified that it cured his problem.
This commit is contained in:
Daniel Stenberg 2008-03-09 11:37:48 +00:00
parent 0e40261a11
commit 82e095a275
3 changed files with 29 additions and 2 deletions

10
CHANGES
View File

@ -6,6 +6,16 @@
Changelog Changelog
Daniel Stenberg (9 Mar 2008)
- Brian Ulm reported a crash when doing a second SFTP transfer on a re-used
easy handle if curl_easy_reset() was used between them. I fixed it and Brian
verified that it cured his problem.
- Brian Ulm reported that if you first tried to download a non-existing SFTP
file and then fetched an existing one and re-used the handle, libcurl would
still report the second one as non-existing as well! I fixed it abd Brian
verified that it cured his problem.
Michal Marek (6 Mar 2008) Michal Marek (6 Mar 2008)
- Fix the gssapi configure check to detect newer MIT Kerberos (patch by - Fix the gssapi configure check to detect newer MIT Kerberos (patch by
Michael Calmer) Michael Calmer)

View File

@ -36,6 +36,8 @@ This release includes the following bugfixes:
o crash when doing Negotiate again on a re-used connection o crash when doing Negotiate again on a re-used connection
o select/poll regression o select/poll regression
o better MIT kerberos configure check o better MIT kerberos configure check
o curl_easy_reset() + SFTP re-used connection download crash
o SFTP non-existing file + SFTP existing file error
This release includes the following known bugs: This release includes the following known bugs:
@ -55,6 +57,6 @@ advice from friends like these:
Michal Marek, Dmitry Kurochkin, Niklas Angebrand, Günter Knauf, Yang Tse, Michal Marek, Dmitry Kurochkin, Niklas Angebrand, Günter Knauf, Yang Tse,
Dan Fandrich, Mike Hommey, Pooyan McSporran, Jerome Muffat-Meridol, Dan Fandrich, Mike Hommey, Pooyan McSporran, Jerome Muffat-Meridol,
Kaspar Brand, Gautam Kachroo, Zmey Petroff, Georg Lippitsch, Sam Listopad, Kaspar Brand, Gautam Kachroo, Zmey Petroff, Georg Lippitsch, Sam Listopad,
Anatoli Tubman, Mike Protts, Michael Calmer Anatoli Tubman, Mike Protts, Michael Calmer, Brian Ulm
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)

View File

@ -1663,7 +1663,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn)
} }
else { else {
result = Curl_setup_transfer(conn, FIRSTSOCKET, data->req.size, result = Curl_setup_transfer(conn, FIRSTSOCKET, data->req.size,
FALSE, NULL, -1, NULL); FALSE, NULL, -1, NULL);
} }
if(result) { if(result) {
state(conn, SSH_SFTP_CLOSE); state(conn, SSH_SFTP_CLOSE);
@ -1966,6 +1966,9 @@ static CURLcode ssh_init(struct connectdata *conn)
{ {
struct SessionHandle *data = conn->data; struct SessionHandle *data = conn->data;
struct SSHPROTO *ssh; struct SSHPROTO *ssh;
conn->proto.sshc.actualcode = CURLE_OK; /* reset error code */
if(data->state.proto.ssh) if(data->state.proto.ssh)
return CURLE_OK; return CURLE_OK;
@ -2109,6 +2112,18 @@ static CURLcode ssh_do(struct connectdata *conn, bool *done)
*done = FALSE; /* default to false */ *done = FALSE; /* default to false */
/*
Since connections can be re-used between SessionHandles, this might be a
connection already existing but on a fresh SessionHandle struct so we must
make sure we have a good 'struct SSHPROTO' to play with. For new
connections, the struct SSHPROTO is allocated and setup in the
ssh_connect() function.
*/
Curl_reset_reqproto(conn);
res = ssh_init(conn);
if(res)
return res;
data->req.size = -1; /* make sure this is unknown at this point */ data->req.size = -1; /* make sure this is unknown at this point */
Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetUploadCounter(data, 0);