diff options
author | Patrick Griffis <pgriffis@igalia.com> | 2021-10-03 11:45:44 -0500 |
---|---|---|
committer | Patrick Griffis <pgriffis@igalia.com> | 2021-10-03 11:45:44 -0500 |
commit | 32a079c2bf10c99075eac0cab5425fbe31148ba4 (patch) | |
tree | 928d9110d2a0884a61ac5238813e884207cc0429 | |
parent | 4d5a65e843b954dc604a04e2b497d1db0348d9c0 (diff) | |
download | libsoup-32a079c2bf10c99075eac0cab5425fbe31148ba4.tar.gz |
cache: Use gint64 to handle time
GDateTime returns gint64 for unix timestamps instead of time_t
as it can store larger values.
This was a regression introduced in 4596b4ec.
Fixes #236
-rw-r--r-- | libsoup/cache/soup-cache.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libsoup/cache/soup-cache.c b/libsoup/cache/soup-cache.c index 550c37b0..ddd215b1 100644 --- a/libsoup/cache/soup-cache.c +++ b/libsoup/cache/soup-cache.c @@ -412,7 +412,7 @@ soup_cache_entry_set_freshness (SoupCacheEntry *entry, SoupMessage *msg, SoupCac date = soup_message_headers_get_one_common (entry->headers, SOUP_HEADER_DATE); if (expires && date) { GDateTime *expires_d, *date_d; - time_t expires_t, date_t; + gint64 expires_t, date_t; expires_d = soup_date_time_new_from_http_string (expires); if (expires_d) { @@ -456,7 +456,7 @@ soup_cache_entry_set_freshness (SoupCacheEntry *entry, SoupMessage *msg, SoupCac last_modified = soup_message_headers_get_one_common (entry->headers, SOUP_HEADER_LAST_MODIFIED); if (last_modified) { GDateTime *soup_date; - time_t now, last_modified_t; + gint64 now, last_modified_t; soup_date = soup_date_time_new_from_http_string (last_modified); last_modified_t = g_date_time_to_unix (soup_date); @@ -504,7 +504,7 @@ soup_cache_entry_new (SoupCache *cache, SoupMessage *msg, time_t request_time, t if (date) { GDateTime *soup_date; const char *age; - time_t date_value, apparent_age, corrected_received_age, response_delay, age_value = 0; + gint64 date_value, apparent_age, corrected_received_age, response_delay, age_value = 0; soup_date = soup_date_time_new_from_http_string (date); date_value = g_date_time_to_unix (soup_date); |