diff options
author | Anna Henningsen <anna@addaleax.net> | 2017-12-30 12:40:54 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-01-14 14:41:14 +0100 |
commit | 20f6aaee7308d5f426de11def6ad9de8848222f5 (patch) | |
tree | 72a250807ae1be3fdcd47747f0ac2d21cc1f6dae /src/stream_base.cc | |
parent | 8b751f7eb7b05a0b27f52e2288a636fdd78e9ecb (diff) | |
download | android-node-v8-20f6aaee7308d5f426de11def6ad9de8848222f5.tar.gz android-node-v8-20f6aaee7308d5f426de11def6ad9de8848222f5.tar.bz2 android-node-v8-20f6aaee7308d5f426de11def6ad9de8848222f5.zip |
src: remove `HasWriteQueue()`
Tests are passing without it, and this otherwise makes the
code harder to reason about because the `async` flag on the
write request object would not be set even though the callback
would still be pending.
PR-URL: https://github.com/nodejs/node/pull/18019
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/stream_base.cc')
-rw-r--r-- | src/stream_base.cc | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/stream_base.cc b/src/stream_base.cc index b1aea79d52..ecb5f3dd1b 100644 --- a/src/stream_base.cc +++ b/src/stream_base.cc @@ -195,8 +195,7 @@ int StreamBase::Writev(const FunctionCallbackInfo<Value>& args) { } err = DoWrite(req_wrap, buf_list, count, nullptr); - if (HasWriteQueue()) - req_wrap_obj->Set(env->async(), True(env->isolate())); + req_wrap_obj->Set(env->async(), True(env->isolate())); if (err) req_wrap->Dispose(); @@ -254,8 +253,7 @@ int StreamBase::WriteBuffer(const FunctionCallbackInfo<Value>& args) { } err = DoWrite(req_wrap, bufs, count, nullptr); - if (HasWriteQueue()) - req_wrap_obj->Set(env->async(), True(env->isolate())); + req_wrap_obj->Set(env->async(), True(env->isolate())); req_wrap_obj->Set(env->buffer_string(), args[1]); if (err) @@ -381,8 +379,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo<Value>& args) { reinterpret_cast<uv_stream_t*>(send_handle)); } - if (HasWriteQueue()) - req_wrap_obj->Set(env->async(), True(env->isolate())); + req_wrap_obj->Set(env->async(), True(env->isolate())); if (err) req_wrap->Dispose(); @@ -476,10 +473,6 @@ int StreamResource::DoTryWrite(uv_buf_t** bufs, size_t* count) { return 0; } -bool StreamResource::HasWriteQueue() { - return true; -} - const char* StreamResource::Error() const { return nullptr; |