summaryrefslogtreecommitdiff
path: root/core/bindings.rs
diff options
context:
space:
mode:
authorInteon <42113979+inteon@users.noreply.github.com>2021-02-23 13:08:50 +0100
committerGitHub <noreply@github.com>2021-02-23 13:08:50 +0100
commitdccf5e0c5c7f04409809104dd23472bcc058e170 (patch)
tree23bad9b434c45fd08315abef66f1fe16add14a44 /core/bindings.rs
parent2e24af23002b6d77543861bf9b2a6027e0357a93 (diff)
refactor(core): Allow multiple overflown responses in single poll (#9433)
This commit rewrites "JsRuntime::poll" function to fix a corner case that might caused "overflown_response" to be overwritten by other overflown response. The logic has been changed to allow returning multiple overflown response alongside responses from shared queue.
Diffstat (limited to 'core/bindings.rs')
-rw-r--r--core/bindings.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/bindings.rs b/core/bindings.rs
index bb5589080..157b58a9d 100644
--- a/core/bindings.rs
+++ b/core/bindings.rs
@@ -368,7 +368,7 @@ fn send<'s>(
mut rv: v8::ReturnValue,
) {
let state_rc = JsRuntime::state(scope);
- let state = state_rc.borrow_mut();
+ let mut state = state_rc.borrow_mut();
let op_id = match v8::Local::<v8::Integer>::try_from(args.get(0))
.map_err(AnyError::from)
@@ -412,12 +412,12 @@ fn send<'s>(
Op::Async(fut) => {
let fut2 = fut.map(move |buf| (op_id, buf));
state.pending_ops.push(fut2.boxed_local());
- state.have_unpolled_ops.set(true);
+ state.have_unpolled_ops = true;
}
Op::AsyncUnref(fut) => {
let fut2 = fut.map(move |buf| (op_id, buf));
state.pending_unref_ops.push(fut2.boxed_local());
- state.have_unpolled_ops.set(true);
+ state.have_unpolled_ops = true;
}
Op::NotFound => {
let msg = format!("Unknown op id: {}", op_id);