1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

transfer: avoid insane conversion of time_t

This commit is contained in:
Stefan Krause 2011-02-23 19:58:43 +01:00 committed by Kamil Dudka
parent 17de1cc382
commit 8511b6436c
3 changed files with 3 additions and 3 deletions

View File

@ -464,7 +464,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
} }
if(fstated && !data->state.range && data->set.timecondition) { if(fstated && !data->state.range && data->set.timecondition) {
if(!Curl_meets_timecondition(data, data->info.filetime)) { if(!Curl_meets_timecondition(data, (time_t)data->info.filetime)) {
*done = TRUE; *done = TRUE;
return CURLE_OK; return CURLE_OK;
} }

View File

@ -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 * Check to see if CURLOPT_TIMECONDITION was met by comparing the time of the
* remote document with the time provided by CURLOPT_TIMEVAL * 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)) if((timeofdoc == 0) || (data->set.timevalue == 0))
return TRUE; return TRUE;

View File

@ -47,7 +47,7 @@ CURLcode Curl_readrewind(struct connectdata *conn);
CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp); CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp);
CURLcode Curl_reconnect_request(struct connectdata **connp); CURLcode Curl_reconnect_request(struct connectdata **connp);
CURLcode Curl_retry_request(struct connectdata *conn, char **url); CURLcode Curl_retry_request(struct connectdata *conn, char **url);
bool Curl_meets_timecondition(struct SessionHandle *data, long timeofdoc); bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc);
/* This sets up a forthcoming transfer */ /* This sets up a forthcoming transfer */
void void