mirror of
https://github.com/curl/curl.git
synced 2025-02-23 15:10:03 +08:00
filetime should be -1 if the remote time was unknown as 0 is actually a
valid time. we now store the filetime as a long to know for sure it can hold -1 (there exist some unsigned time_t cases)
This commit is contained in:
parent
88e21894c7
commit
e9aa07f660
@ -46,7 +46,7 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
|
|||||||
|
|
||||||
info->httpcode = 0;
|
info->httpcode = 0;
|
||||||
info->httpversion=0;
|
info->httpversion=0;
|
||||||
info->filetime=0;
|
info->filetime=-1; /* -1 is an illegal time and thus means unknown */
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
@ -627,7 +627,7 @@ Transfer(struct connectdata *c_conn)
|
|||||||
(data->set.timecondition || data->set.get_filetime) ) {
|
(data->set.timecondition || data->set.get_filetime) ) {
|
||||||
time_t secs=time(NULL);
|
time_t secs=time(NULL);
|
||||||
timeofdoc = curl_getdate(p+strlen("Last-Modified:"), &secs);
|
timeofdoc = curl_getdate(p+strlen("Last-Modified:"), &secs);
|
||||||
if(data->set.get_filetime)
|
if(data->set.get_filetime>=0)
|
||||||
data->info.filetime = timeofdoc;
|
data->info.filetime = timeofdoc;
|
||||||
}
|
}
|
||||||
else if ((httpcode >= 300 && httpcode < 400) &&
|
else if ((httpcode >= 300 && httpcode < 400) &&
|
||||||
|
@ -352,8 +352,8 @@ struct connectdata {
|
|||||||
struct PureInfo {
|
struct PureInfo {
|
||||||
int httpcode;
|
int httpcode;
|
||||||
int httpversion;
|
int httpversion;
|
||||||
time_t filetime; /* If requested, this is might get set. It may be 0 if
|
long filetime; /* If requested, this is might get set. Set to -1 if
|
||||||
the time was unretrievable */
|
the time was unretrievable */
|
||||||
long header_size; /* size of read header(s) in bytes */
|
long header_size; /* size of read header(s) in bytes */
|
||||||
long request_size; /* the amount of bytes sent in the request(s) */
|
long request_size; /* the amount of bytes sent in the request(s) */
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user