diff options
author | Fedor Indutny <fedor@indutny.com> | 2015-04-29 13:50:36 +0200 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2015-05-01 13:52:11 +0200 |
commit | 30b7349176da785cd7294fec8c31cfb9c5f791e8 (patch) | |
tree | 654a06fd798ea50bf023c01071473f509446abbd /src/stream_wrap.cc | |
parent | 78f4b038f89349f1c033911178fb6b411831e99e (diff) | |
download | android-node-v8-30b7349176da785cd7294fec8c31cfb9c5f791e8.tar.gz android-node-v8-30b7349176da785cd7294fec8c31cfb9c5f791e8.tar.bz2 android-node-v8-30b7349176da785cd7294fec8c31cfb9c5f791e8.zip |
stream_base: dispatch reqs in the stream impl
Dispatch requests in the implementation of the stream, not in the code
creating these requests. The requests might be piled up and invoked
internally in the implementation, so it should know better when it is
the time to dispatch them.
In fact, TLS was doing exactly this thing which led us to...
Fix: https://github.com/iojs/io.js/issues/1512
PR-URL: https://github.com/iojs/io.js/pull/1563
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Diffstat (limited to 'src/stream_wrap.cc')
-rw-r--r-- | src/stream_wrap.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index be5757d4a6..540639d458 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -279,7 +279,10 @@ void StreamWrap::SetBlocking(const FunctionCallbackInfo<Value>& args) { int StreamWrap::DoShutdown(ShutdownWrap* req_wrap) { - return uv_shutdown(&req_wrap->req_, stream(), AfterShutdown); + int err; + err = uv_shutdown(&req_wrap->req_, stream(), AfterShutdown); + req_wrap->Dispatched(); + return err; } @@ -353,6 +356,7 @@ int StreamWrap::DoWrite(WriteWrap* w, } } + w->Dispatched(); UpdateWriteQueueSize(); return r; |