mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 12:12:35 +03:00
Ensure that candidate count is reduced if a conditional request results in a non-304 response
svn path=/trunk/netsurf/; revision=10791
This commit is contained in:
parent
b6418a9048
commit
a7dd752046
@ -1653,6 +1653,13 @@ void llcache_fetch_callback(fetch_msg msg, void *p, const void *data,
|
|||||||
/* 3xx responses */
|
/* 3xx responses */
|
||||||
case FETCH_REDIRECT:
|
case FETCH_REDIRECT:
|
||||||
/* Request resulted in a redirect */
|
/* Request resulted in a redirect */
|
||||||
|
|
||||||
|
/* Release candidate, if any */
|
||||||
|
if (object->candidate != NULL) {
|
||||||
|
object->candidate->candidate_count--;
|
||||||
|
object->candidate = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
error = llcache_fetch_redirect(object, data, &object);
|
error = llcache_fetch_redirect(object, data, &object);
|
||||||
break;
|
break;
|
||||||
case FETCH_NOTMODIFIED:
|
case FETCH_NOTMODIFIED:
|
||||||
@ -1665,6 +1672,12 @@ void llcache_fetch_callback(fetch_msg msg, void *p, const void *data,
|
|||||||
/* Received a fetch header */
|
/* Received a fetch header */
|
||||||
object->fetch.state = LLCACHE_FETCH_HEADERS;
|
object->fetch.state = LLCACHE_FETCH_HEADERS;
|
||||||
|
|
||||||
|
/* Release candidate, if any */
|
||||||
|
if (object->candidate != NULL) {
|
||||||
|
object->candidate->candidate_count--;
|
||||||
|
object->candidate = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
error = llcache_fetch_process_header(object, data, size);
|
error = llcache_fetch_process_header(object, data, size);
|
||||||
break;
|
break;
|
||||||
case FETCH_DATA:
|
case FETCH_DATA:
|
||||||
@ -1725,6 +1738,12 @@ void llcache_fetch_callback(fetch_msg msg, void *p, const void *data,
|
|||||||
object->fetch.state = LLCACHE_FETCH_COMPLETE;
|
object->fetch.state = LLCACHE_FETCH_COMPLETE;
|
||||||
object->fetch.fetch = NULL;
|
object->fetch.fetch = NULL;
|
||||||
|
|
||||||
|
/* Release candidate, if any */
|
||||||
|
if (object->candidate != NULL) {
|
||||||
|
object->candidate->candidate_count--;
|
||||||
|
object->candidate = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Invalidate cache control data */
|
/* Invalidate cache control data */
|
||||||
llcache_invalidate_cache_control_data(object);
|
llcache_invalidate_cache_control_data(object);
|
||||||
|
|
||||||
@ -1748,10 +1767,24 @@ void llcache_fetch_callback(fetch_msg msg, void *p, const void *data,
|
|||||||
/* Events requiring action */
|
/* Events requiring action */
|
||||||
case FETCH_AUTH:
|
case FETCH_AUTH:
|
||||||
/* Need Authentication */
|
/* Need Authentication */
|
||||||
|
|
||||||
|
/* Release candidate, if any */
|
||||||
|
if (object->candidate != NULL) {
|
||||||
|
object->candidate->candidate_count--;
|
||||||
|
object->candidate = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
error = llcache_fetch_auth(object, data);
|
error = llcache_fetch_auth(object, data);
|
||||||
break;
|
break;
|
||||||
case FETCH_CERT_ERR:
|
case FETCH_CERT_ERR:
|
||||||
/* Something went wrong when validating TLS certificates */
|
/* Something went wrong when validating TLS certificates */
|
||||||
|
|
||||||
|
/* Release candidate, if any */
|
||||||
|
if (object->candidate != NULL) {
|
||||||
|
object->candidate->candidate_count--;
|
||||||
|
object->candidate = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
error = llcache_fetch_cert_error(object, data, size);
|
error = llcache_fetch_cert_error(object, data, size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1930,6 +1963,7 @@ nserror llcache_fetch_notmodified(llcache_object *object,
|
|||||||
|
|
||||||
/* Candidate is now our object */
|
/* Candidate is now our object */
|
||||||
*replacement = object->candidate;
|
*replacement = object->candidate;
|
||||||
|
object->candidate = NULL;
|
||||||
|
|
||||||
/* Old object will be flushed from the cache on the next poll */
|
/* Old object will be flushed from the cache on the next poll */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user