diff options
Diffstat (limited to 'lib/ftp.c')
-rw-r--r-- | lib/ftp.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -238,7 +238,7 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */ if(!ftp->cache) { readfd = rkeepfd; /* set every lap */ - interval.tv_sec = timeout; + interval.tv_sec = 1; /* use 1 second timeout intervals */ interval.tv_usec = 0; switch (select (sockfd+1, &readfd, NULL, NULL, &interval)) { @@ -247,9 +247,10 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */ failf(data, "Transfer aborted due to select() error: %d", errno); break; case 0: /* timeout */ - result = CURLE_OPERATION_TIMEDOUT; - failf(data, "Transfer aborted due to timeout"); - break; + if(Curl_pgrsUpdate(conn)) + return CURLE_ABORTED_BY_CALLBACK; + continue; /* just continue in our loop for the timeout duration */ + default: break; } @@ -2117,6 +2118,11 @@ CURLcode Curl_ftp(struct connectdata *conn) ftp = conn->proto.ftp; conn->size = -1; /* make sure this is unknown at this point */ + Curl_pgrsSetUploadCounter(data, 0); + Curl_pgrsSetDownloadCounter(data, 0); + Curl_pgrsSetUploadSize(data, 0); + Curl_pgrsSetDownloadSize(data, 0); + /* fixed : initialize ftp->dirs[xxx] to NULL ! is done in Curl_ftp_connect() */ |