@@ -242,13 +242,18 @@ void StreamWrap::OnReadImpl(ssize_t nread,
242
242
}
243
243
244
244
245
- void StreamWrap::OnReadCommon (uv_stream_t * handle,
246
- ssize_t nread,
247
- const uv_buf_t * buf,
248
- uv_handle_type pending) {
245
+ void StreamWrap::OnRead (uv_stream_t * handle,
246
+ ssize_t nread,
247
+ const uv_buf_t * buf) {
249
248
StreamWrap* wrap = static_cast <StreamWrap*>(handle->data );
250
249
HandleScope scope (wrap->env ()->isolate ());
251
250
Context::Scope context_scope (wrap->env ()->context ());
251
+ uv_handle_type type = UV_UNKNOWN_HANDLE;
252
+
253
+ if (wrap->is_named_pipe_ipc () &&
254
+ uv_pipe_pending_count (reinterpret_cast <uv_pipe_t *>(handle)) > 0 ) {
255
+ type = uv_pipe_pending_type (reinterpret_cast <uv_pipe_t *>(handle));
256
+ }
252
257
253
258
// We should not be getting this callback if someone as already called
254
259
// uv_close() on the handle.
@@ -262,22 +267,7 @@ void StreamWrap::OnReadCommon(uv_stream_t* handle,
262
267
}
263
268
}
264
269
265
- static_cast <StreamBase*>(wrap)->OnRead (nread, buf, pending);
266
- }
267
-
268
-
269
- void StreamWrap::OnRead (uv_stream_t * handle,
270
- ssize_t nread,
271
- const uv_buf_t * buf) {
272
- StreamWrap* wrap = static_cast <StreamWrap*>(handle->data );
273
- uv_handle_type type = UV_UNKNOWN_HANDLE;
274
-
275
- if (wrap->is_named_pipe_ipc () &&
276
- uv_pipe_pending_count (reinterpret_cast <uv_pipe_t *>(handle)) > 0 ) {
277
- type = uv_pipe_pending_type (reinterpret_cast <uv_pipe_t *>(handle));
278
- }
279
-
280
- OnReadCommon (handle, nread, buf, type);
270
+ static_cast <StreamBase*>(wrap)->OnRead (nread, buf, type);
281
271
}
282
272
283
273
0 commit comments