diff options
author | João Souto <joao.jpgs@hotmail.com> | 2020-03-11 22:19:24 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 18:19:24 -0400 |
commit | fb5c31416d4b9e526ca0fcc134dc8f366e367012 (patch) | |
tree | cffd644e8f6b99db10a75ecb6e32879d9f4c3ce0 /cli/ops/fetch.rs | |
parent | 810e4a16bedbc77ef0651f4f24626d98ca566083 (diff) |
Add waker to StreamResource to fix hang on close bugs (#4293)
Diffstat (limited to 'cli/ops/fetch.rs')
-rw-r--r-- | cli/ops/fetch.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/ops/fetch.rs b/cli/ops/fetch.rs index 9f36ad5fd..d222787a6 100644 --- a/cli/ops/fetch.rs +++ b/cli/ops/fetch.rs @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use super::dispatch_json::{Deserialize, JsonOp, Value}; -use super::io::StreamResource; +use super::io::{StreamResource, StreamResourceHolder}; use crate::http_util::{create_http_client, HttpBody}; use crate::op_error::OpError; use crate::state::State; @@ -80,7 +80,9 @@ pub fn op_fetch( let mut state = state_.borrow_mut(); let rid = state.resource_table.add( "httpBody", - Box::new(StreamResource::HttpBody(Box::new(body))), + Box::new(StreamResourceHolder::new(StreamResource::HttpBody( + Box::new(body), + ))), ); let json_res = json!({ |