mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-18 08:39:50 +03:00
Reset fetch state when refetching object.
Ensure that cache control data is invalidated for 401/certificate failure so that conditional headers are not emitted when object is refetched. svn path=/trunk/netsurf/; revision=10408
This commit is contained in:
parent
b008327de1
commit
ca0daa1a66
@ -937,6 +937,9 @@ nserror llcache_object_refetch(llcache_object *object)
|
|||||||
object->cache.etag = NULL;
|
object->cache.etag = NULL;
|
||||||
object->cache.last_modified = 0;
|
object->cache.last_modified = 0;
|
||||||
|
|
||||||
|
/* Reset fetch state */
|
||||||
|
object->fetch.state = LLCACHE_FETCH_INIT;
|
||||||
|
|
||||||
#ifdef LLCACHE_TRACE
|
#ifdef LLCACHE_TRACE
|
||||||
LOG(("Refetching %p", object));
|
LOG(("Refetching %p", object));
|
||||||
#endif
|
#endif
|
||||||
@ -2077,6 +2080,9 @@ nserror llcache_fetch_auth(llcache_object *object, const char *realm)
|
|||||||
fetch_abort(object->fetch.fetch);
|
fetch_abort(object->fetch.fetch);
|
||||||
object->fetch.fetch = NULL;
|
object->fetch.fetch = NULL;
|
||||||
|
|
||||||
|
/* Invalidate cache-control data */
|
||||||
|
memset(&object->cache, 0, sizeof(llcache_cache_control));
|
||||||
|
|
||||||
/* Destroy headers */
|
/* Destroy headers */
|
||||||
while (object->num_headers > 0) {
|
while (object->num_headers > 0) {
|
||||||
object->num_headers--;
|
object->num_headers--;
|
||||||
@ -2111,10 +2117,7 @@ nserror llcache_fetch_auth(llcache_object *object, const char *realm)
|
|||||||
} else {
|
} else {
|
||||||
llcache_event event;
|
llcache_event event;
|
||||||
|
|
||||||
/* Invalidate cache-control data */
|
/* Mark object complete */
|
||||||
memset(&object->cache, 0,
|
|
||||||
sizeof(llcache_cache_control));
|
|
||||||
/* Mark it complete */
|
|
||||||
object->fetch.state = LLCACHE_FETCH_COMPLETE;
|
object->fetch.state = LLCACHE_FETCH_COMPLETE;
|
||||||
|
|
||||||
/* Inform client(s) that object fetch failed */
|
/* Inform client(s) that object fetch failed */
|
||||||
@ -2151,6 +2154,9 @@ nserror llcache_fetch_cert_error(llcache_object *object,
|
|||||||
fetch_abort(object->fetch.fetch);
|
fetch_abort(object->fetch.fetch);
|
||||||
object->fetch.fetch = NULL;
|
object->fetch.fetch = NULL;
|
||||||
|
|
||||||
|
/* Invalidate cache-control data */
|
||||||
|
memset(&object->cache, 0, sizeof(llcache_cache_control));
|
||||||
|
|
||||||
if (query_cb != NULL) {
|
if (query_cb != NULL) {
|
||||||
llcache_query query;
|
llcache_query query;
|
||||||
|
|
||||||
@ -2165,9 +2171,7 @@ nserror llcache_fetch_cert_error(llcache_object *object,
|
|||||||
} else {
|
} else {
|
||||||
llcache_event event;
|
llcache_event event;
|
||||||
|
|
||||||
/* Invalidate cache-control data */
|
/* Mark object complete */
|
||||||
memset(&object->cache, 0, sizeof(llcache_cache_control));
|
|
||||||
/* Mark it complete */
|
|
||||||
object->fetch.state = LLCACHE_FETCH_COMPLETE;
|
object->fetch.state = LLCACHE_FETCH_COMPLETE;
|
||||||
|
|
||||||
/* Inform client(s) that object fetch failed */
|
/* Inform client(s) that object fetch failed */
|
||||||
|
Loading…
Reference in New Issue
Block a user