after successfull file transfer, read the "Transfer Completed" from the
authorewt <devnull@localhost>
Sat, 13 Jul 1996 14:53:33 +0000 (14:53 +0000)
committerewt <devnull@localhost>
Sat, 13 Jul 1996 14:53:33 +0000 (14:53 +0000)
server -- if we don't, we can't do another transfer w/o reconnecting

CVS patchset: 804
CVS date: 1996/07/13 14:53:33

ftp.c

diff --git a/ftp.c b/ftp.c
index a9e2ec6..6e4f9c5 100644 (file)
--- a/ftp.c
+++ b/ftp.c
@@ -328,7 +328,16 @@ int ftpGetFile(int sock, char * remotename, int dest) {
        return FTPERR_BAD_SERVER_RESPONSE;
     }
 
-    return ftpReadData(dataSocket, dest);
+    rc = ftpReadData(dataSocket, dest);
+    close(dataSocket);
+    
+    if (rc) return rc;
+
+    if (ftpCheckResponse(sock, NULL)) {
+       return FTPERR_BAD_SERVER_RESPONSE;
+    }
+
+    return 0;
 }
 
 void ftpClose(int sock) {