[libsoup/wip/2038-time] cache: Use gint64 to handle time GDateTime returns gint64 for unix timestamps instead of time_t as i
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/2038-time] cache: Use gint64 to handle time GDateTime returns gint64 for unix timestamps instead of time_t as i
- Date: Sun, 3 Oct 2021 16:46:28 +0000 (UTC)
commit 32a079c2bf10c99075eac0cab5425fbe31148ba4
Author: Patrick Griffis <pgriffis igalia com>
Date: Sun Oct 3 11:45:44 2021 -0500
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
libsoup/cache/soup-cache.c | 6 +++---
1 file 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]