aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-09-28 11:04:43 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-09-28 11:04:43 +0000
commite9aa07f660a3663281416fd5d391bcee78a117ec (patch)
tree08fbb9bd2d1d605bca7331266b50ee15da7c0613
parent88e21894c7ccc38384004aa2aba2dd5123fc1f15 (diff)
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)
-rw-r--r--lib/getinfo.c2
-rw-r--r--lib/transfer.c2
-rw-r--r--lib/urldata.h4
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c
index 88a139e3a..6149073ac 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -46,7 +46,7 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
info->httpcode = 0;
info->httpversion=0;
- info->filetime=0;
+ info->filetime=-1; /* -1 is an illegal time and thus means unknown */
return CURLE_OK;
}
diff --git a/lib/transfer.c b/lib/transfer.c
index c42970c58..dc628982b 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -627,7 +627,7 @@ Transfer(struct connectdata *c_conn)
(data->set.timecondition || data->set.get_filetime) ) {
time_t secs=time(NULL);
timeofdoc = curl_getdate(p+strlen("Last-Modified:"), &secs);
- if(data->set.get_filetime)
+ if(data->set.get_filetime>=0)
data->info.filetime = timeofdoc;
}
else if ((httpcode >= 300 && httpcode < 400) &&
diff --git a/lib/urldata.h b/lib/urldata.h
index ed0099ddd..1bb51b44d 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -352,8 +352,8 @@ struct connectdata {
struct PureInfo {
int httpcode;
int httpversion;
- time_t filetime; /* If requested, this is might get set. It may be 0 if
- the time was unretrievable */
+ long filetime; /* If requested, this is might get set. Set to -1 if
+ the time was unretrievable */
long header_size; /* size of read header(s) in bytes */
long request_size; /* the amount of bytes sent in the request(s) */
};