diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-01-25 02:43:06 +0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-02-01 12:53:53 +0300 |
commit | 5898dc3d0c071a8e5135ba0a80565dd19d49cb32 (patch) | |
tree | 8bf1fd4236b183dfd8509b8d5bc43ec7f659f14a /src/stream_base-inl.h | |
parent | 7c4b09b24bbe7d6a8cbad256f47b30a101a909ea (diff) |
src: simplify handles for libuv streams
Instead of passing along the handle object, just set it as a
property on the stream handle object and let the read handler
grab it from there.
PR-URL: https://github.com/nodejs/node/pull/18334
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/stream_base-inl.h')
-rw-r--r-- | src/stream_base-inl.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index 287978a8703..76922c1d8af 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -33,9 +33,7 @@ inline StreamListener::~StreamListener() { inline void StreamListener::PassReadErrorToPreviousListener(ssize_t nread) { CHECK_NE(previous_listener_, nullptr); - previous_listener_->OnStreamRead(nread, - uv_buf_init(nullptr, 0), - UV_UNKNOWN_HANDLE); + previous_listener_->OnStreamRead(nread, uv_buf_init(nullptr, 0)); } @@ -85,12 +83,10 @@ inline uv_buf_t StreamResource::EmitAlloc(size_t suggested_size) { return listener_->OnStreamAlloc(suggested_size); } -inline void StreamResource::EmitRead(ssize_t nread, - const uv_buf_t& buf, - uv_handle_type pending) { +inline void StreamResource::EmitRead(ssize_t nread, const uv_buf_t& buf) { if (nread > 0) bytes_read_ += static_cast<uint64_t>(nread); - listener_->OnStreamRead(nread, buf, pending); + listener_->OnStreamRead(nread, buf); } inline void StreamResource::EmitAfterWrite(WriteWrap* w, int status) { |