]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Spotted by Tim Kosse: reput on an already complete file was hanging.
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Wed, 3 Dec 2003 23:25:48 +0000 (23:25 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Wed, 3 Dec 2003 23:25:48 +0000 (23:25 +0000)
Should be fixed now (we only wait for packets if we know there are some
that haven't been replied to yet).

[originally from svn r3618]

psftp.c

diff --git a/psftp.c b/psftp.c
index c7cd8701a869a3fa8af54bd7690147a221122bd8..d395b6f16eaacf5e65fda1bea32377cb631a948d 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -616,12 +616,13 @@ int sftp_general_put(struct sftp_command *cmd, int restart)
            }
        }
 
-       pktin = sftp_recv();
-       ret = xfer_upload_gotpkt(xfer, pktin);
-
-       if (!ret) {
-           printf("error while writing: %s\n", fxp_error());
-           err = 1;
+       if (!xfer_done(xfer)) {
+           pktin = sftp_recv();
+           ret = xfer_upload_gotpkt(xfer, pktin);
+           if (!ret) {
+               printf("error while writing: %s\n", fxp_error());
+               err = 1;
+           }
        }
     }