]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sftp: don't send post-qoute sequence when retrying a connection
authorPrzemysław Tomaszewski <p.tomaszewski.mail@gmail.com>
Tue, 4 Sep 2018 06:44:34 +0000 (08:44 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 4 Sep 2018 09:00:17 +0000 (11:00 +0200)
Fixes #2939
Closes #2940

lib/ssh-libssh.c
lib/ssh.c

index 002e1d96f076b3eb050cb2dcbb5391f0c8497752..88f3aa63e2d772899c249244a9edbbddf43e9ab0 100644 (file)
@@ -2390,8 +2390,9 @@ static CURLcode sftp_done(struct connectdata *conn, CURLcode status,
     /* Post quote commands are executed after the SFTP_CLOSE state to avoid
        errors that could happen due to open file handles during POSTQUOTE
        operation */
-    if(!status && !premature && conn->data->set.postquote) {
-      sshc->nextstate = SSH_SFTP_POSTQUOTE_INIT;
+    if(!status && !premature && conn->data->set.postquote &&
+       !conn->bits.retry) {
+        sshc->nextstate = SSH_SFTP_POSTQUOTE_INIT;
       state(conn, SSH_SFTP_CLOSE);
     }
     else
index 0aaba9a6a89cef9a3637a78fcf0021b2b153af01..a4b2ca43ab6adac466815b3eb4e1cc0f4959fdf1 100644 (file)
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -3219,7 +3219,8 @@ static CURLcode sftp_done(struct connectdata *conn, CURLcode status,
     /* Post quote commands are executed after the SFTP_CLOSE state to avoid
        errors that could happen due to open file handles during POSTQUOTE
        operation */
-    if(!status && !premature && conn->data->set.postquote) {
+    if(!status && !premature && conn->data->set.postquote &&
+       !conn->bits.retry) {
       sshc->nextstate = SSH_SFTP_POSTQUOTE_INIT;
       state(conn, SSH_SFTP_CLOSE);
     }