aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index f316000a1..63ab5c4e9 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -359,7 +359,7 @@ static void read_rewind(struct connectdata *conn,
* Check to see if CURLOPT_TIMECONDITION was met by comparing the time of the
* remote document with the time provided by CURLOPT_TIMEVAL
*/
-bool Curl_meets_timecondition(struct SessionHandle *data, long timeofdoc)
+bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc)
{
if((timeofdoc == 0) || (data->set.timevalue == 0))
return TRUE;
@@ -946,6 +946,14 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
Curl_debug(data, CURLINFO_DATA_OUT, data->req.upload_fromhere,
(size_t)bytes_written, conn);
+ k->writebytecount += bytes_written;
+
+ if(k->writebytecount == data->set.infilesize) {
+ /* we have sent all data we were supposed to */
+ k->upload_done = TRUE;
+ infof(data, "We are completely uploaded and fine\n");
+ }
+
if(data->req.upload_present != bytes_written) {
/* we only wrote a part of the buffer (if anything), deal with it! */
@@ -967,7 +975,6 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
}
}
- k->writebytecount += bytes_written;
Curl_pgrsSetUploadCounter(data, k->writebytecount);
} while(0); /* just to break out from! */