aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/fetch
diff options
context:
space:
mode:
authorGregory Terzian <gterzian@users.noreply.github.com>2019-09-29 22:55:47 +0800
committerGregory Terzian <gterzian@users.noreply.github.com>2019-10-08 17:58:20 +0800
commit4f3ba70704b8b160780af2e1b84d8a93a350af81 (patch)
tree981e3af507e76ce6fde4fd0b6957ec029529fa3b /components/net/fetch
parente05f0b41ba37dd4d61d427435ddd369974942312 (diff)
downloadservo-4f3ba70704b8b160780af2e1b84d8a93a350af81.tar.gz
servo-4f3ba70704b8b160780af2e1b84d8a93a350af81.zip
http-cache: wait on pending stores
and various small improvements
Diffstat (limited to 'components/net/fetch')
-rw-r--r--components/net/fetch/methods.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs
index 503e93d3687..b60265ce2b8 100644
--- a/components/net/fetch/methods.rs
+++ b/components/net/fetch/methods.rs
@@ -41,6 +41,7 @@ lazy_static! {
pub type Target<'a> = &'a mut (dyn FetchTaskTarget + Send);
+#[derive(Clone)]
pub enum Data {
Payload(Vec<u8>),
Done,
@@ -456,7 +457,7 @@ pub fn main_fetch(
// Step 24.
target.process_response_eof(&response);
- if let Ok(mut http_cache) = context.state.http_cache.write() {
+ if let Ok(http_cache) = context.state.http_cache.write() {
http_cache.update_awaiting_consumers(&request, &response);
}
@@ -478,7 +479,7 @@ fn wait_for_response(response: &mut Response, target: Target, done_chan: &mut Do
},
Data::Done => break,
Data::Cancelled => {
- response.aborted.store(true, Ordering::Relaxed);
+ response.aborted.store(true, Ordering::Release);
break;
},
}