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)) {
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;
}
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() */
void Curl_pgrsSetDownloadSize(struct SessionHandle *data, double size)
{
- if(size > 0) {
- data->progress.size_dl = size;
+ data->progress.size_dl = size;
+ if(size > 0)
data->progress.flags |= PGRS_DL_SIZE_KNOWN;
- }
+ else
+ data->progress.flags &= ~PGRS_DL_SIZE_KNOWN;
}
void Curl_pgrsSetUploadSize(struct SessionHandle *data, double size)
{
- if(size > 0) {
- data->progress.size_ul = size;
+ data->progress.size_ul = size;
+ if(size > 0)
data->progress.flags |= PGRS_UL_SIZE_KNOWN;
- }
+ else
+ data->progress.flags &= ~PGRS_UL_SIZE_KNOWN;
}
/* EXAMPLE OUTPUT to follow: