aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-09-08 09:29:03 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-09-08 09:29:03 +0200
commit27620171ffe1a47735de706aa0b0a66d45f867ed (patch)
treece06640c0897b6009b0fee2909d3961bbfaa7c55 /lib/ftp.c
parent664398e43bde95c7a3bd657006a5661b41884229 (diff)
FTP: do_more: add check for wait_data_conn in upload case
In some timing-dependnt cases when a 4xx response immediately followed after a 150 when a STOR was issued, this function would wrongly return 'complete == true' while 'wait_data_conn' was still set. Closes #405 Reported-by: Patricia Muscalu
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 7b7e11389..2351638df 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3723,7 +3723,13 @@ static CURLcode ftp_do_more(struct connectdata *conn, int *completep)
return result;
result = ftp_multi_statemach(conn, &complete);
- *completep = (int)complete;
+ if(ftpc->wait_data_conn)
+ /* if we reach the end of the FTP state machine here, *complete will be
+ TRUE but so is ftpc->wait_data_conn, which says we need to wait for
+ the data connection and therefore we're not actually complete */
+ *completep = 0;
+ else
+ *completep = (int)complete;
}
else {
/* download */