[libsoup/cache] soup-cache: fix freshness calculation



commit 657110f01122241575bd179174234d5a68d6efbb
Author: Xan Lopez <xan gnome org>
Date:   Fri Jul 31 22:30:26 2009 +0300

    soup-cache: fix freshness calculation
    
    Need to cast the lifetime to 'int', since it's potentially (actually,
    often) compared with negative numbers.

 libsoup/soup-cache.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/libsoup/soup-cache.c b/libsoup/soup-cache.c
index 228f779..9e92160 100644
--- a/libsoup/soup-cache.c
+++ b/libsoup/soup-cache.c
@@ -188,9 +188,7 @@ static gboolean
 soup_cache_entry_is_fresh_enough (SoupCacheEntry *entry, int min_fresh)
 {
 	int limit = (min_fresh == -1) ? soup_cache_entry_get_current_age (entry) : min_fresh;
-
-	g_debug ("IS ENTRY FRESH ENOUGH? LIFETIME %d, CURRENT AGE %d, MIN-FRESH %d, FRESH: %d (Key: %s)", entry->freshness_lifetime, soup_cache_entry_get_current_age (entry), min_fresh, (gboolean) entry->freshness_lifetime > limit, entry->key);
-	return entry->freshness_lifetime > limit;
+	return ((int)entry->freshness_lifetime) > limit;
 }
 
 static char *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]