[libsoup] soup-cache: fix a warning (and a bug)



commit d9bf1c08c846196c4c2932a1f56402614d4d19fe
Author: Dan Winship <danw gnome org>
Date:   Tue Jan 25 12:23:08 2011 -0500

    soup-cache: fix a warning (and a bug)
    
    If a request specifies "Cache-Control: max-age=0", revalidate the
    response, but don't mark the cache entry as "must_revalidate", since
    the need for revalidation applies only to the current request.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=640556

 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 f7d3bfb..25c0709 100644
--- a/libsoup/soup-cache.c
+++ b/libsoup/soup-cache.c
@@ -1254,7 +1254,6 @@ soup_cache_has_response (SoupCache *cache, SoupMessage *msg)
 	SoupCacheEntry *entry;
 	const char *cache_control, *pragma;
 	gpointer value;
-	gboolean must_revalidate;
 	int max_age, max_stale, min_fresh;
 	GList *lru_item, *item;
 
@@ -1312,7 +1311,6 @@ soup_cache_has_response (SoupCache *cache, SoupMessage *msg)
 	 * directives that would prevent its use.
 	 */
 
-	must_revalidate = FALSE;
 	max_age = max_stale = min_fresh = -1;
 
 	/* For HTTP 1.0 compatibility. RFC2616 section 14.9.4
@@ -1340,7 +1338,7 @@ soup_cache_has_response (SoupCache *cache, SoupMessage *msg)
 			/* Forcing cache revalidaton
 			 */
 			if (!max_age)
-				entry->must_revalidate = TRUE;
+				return SOUP_CACHE_RESPONSE_NEEDS_VALIDATION;
 		}
 
 		/* max-stale can have no value set, we need to use _extended */



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