http-cache: improve handling of network errors and partial content

This commit is contained in:
Gregory Terzian 2019-06-01 16:40:50 +08:00
parent d544c186b9
commit 4f41065dfb
2 changed files with 40 additions and 9 deletions

View file

@ -457,10 +457,8 @@ pub fn main_fetch(
// Step 24.
target.process_response_eof(&response);
if !response.is_network_error() {
if let Ok(mut http_cache) = context.state.http_cache.write() {
http_cache.update_awaiting_consumers(&request, &response);
}
if let Ok(mut http_cache) = context.state.http_cache.write() {
http_cache.update_awaiting_consumers(&request, &response);
}
// Steps 25-27.