aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-11-19 14:36:42 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-11-19 14:36:42 +0000
commitedce44455161932d01513954e2e9fdb35f9e5709 (patch)
treeae9ca21c8712b4ad037d340b2a55cf5312bcbbf9
parent7bee4140e886773a370b76eec80a264c0e7f142d (diff)
If a partial file has been read or written, force a closure the existing
connection to avoid re-use of it, since we cannot know in what state it is.
-rw-r--r--lib/ftp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 5db4c5fc3..c464f746c 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -637,6 +637,8 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
!data->set.crlf) {
failf(data, "Uploaded unaligned file size (%d out of %d bytes)",
*ftp->bytecountp, data->set.infilesize);
+ conn->bits.close = TRUE; /* close this connection since we don't
+ know what state this error leaves us in */
return CURLE_PARTIAL_FILE;
}
}
@@ -644,6 +646,8 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
if((-1 != conn->size) && (conn->size != *ftp->bytecountp) &&
(conn->maxdownload != *ftp->bytecountp)) {
failf(data, "Received only partial file: %d bytes", *ftp->bytecountp);
+ conn->bits.close = TRUE; /* close this connection since we don't
+ know what state this error leaves us in */
return CURLE_PARTIAL_FILE;
}
else if(!ftp->dont_check &&