GeezerVison is showing github.com — src: use available ReqWrap instance for libuv req · nodejs/node@2f3a28d
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/node_file.cc +6-3Lines changed: 6 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1552,9 +1552,12 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) { | 1552 | 1552 | len = StringBytes::Write(env->isolate(), *stack_buffer, len, args[1], enc); | 1553 | 1553 | stack_buffer.SetLengthAndZeroTerminate(len); | 1554 | 1554 | uv_buf_t uvbuf = uv_buf_init(*stack_buffer, len); | 1555 | | - int err = uv_fs_write(env->event_loop(), req_wrap_async->req(), | 1556 | | - fd, &uvbuf, 1, pos, AfterInteger); | 1557 | | - req_wrap_async->Dispatched(); | | 1555 | + int err = req_wrap_async->Dispatch(uv_fs_write, | | 1556 | + fd, | | 1557 | + &uvbuf, | | 1558 | + 1, | | 1559 | + pos, | | 1560 | + AfterInteger); | 1558 | 1561 | if (err < 0) { | 1559 | 1562 | uv_fs_t* uv_req = req_wrap_async->req(); | 1560 | 1563 | uv_req->result = err; | |
Collapse file Copy file name to clipboardExpand all lines: src/stream_wrap.cc +8-8Lines changed: 8 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -276,10 +276,7 @@ WriteWrap* LibuvStreamWrap::CreateWriteWrap(Local<Object> object) { | 276 | 276 |
| 277 | 277 | int LibuvStreamWrap::DoShutdown(ShutdownWrap* req_wrap_) { | 278 | 278 | LibuvShutdownWrap* req_wrap = static_cast<LibuvShutdownWrap*>(req_wrap_); | 279 | | - int err; | 280 | | - err = uv_shutdown(req_wrap->req(), stream(), AfterUvShutdown); | 281 | | - req_wrap->Dispatched(); | 282 | | - return err; | | 279 | + return req_wrap->Dispatch(uv_shutdown, stream(), AfterUvShutdown); | 283 | 280 | } | 284 | 281 |
| 285 | 282 |
| @@ -340,9 +337,14 @@ int LibuvStreamWrap::DoWrite(WriteWrap* req_wrap, | 340 | 337 | LibuvWriteWrap* w = static_cast<LibuvWriteWrap*>(req_wrap); | 341 | 338 | int r; | 342 | 339 | if (send_handle == nullptr) { | 343 | | - r = uv_write(w->req(), stream(), bufs, count, AfterUvWrite); | | 340 | + r = w->Dispatch(uv_write, stream(), bufs, count, AfterUvWrite); | 344 | 341 | } else { | 345 | | - r = uv_write2(w->req(), stream(), bufs, count, send_handle, AfterUvWrite); | | 342 | + r = w->Dispatch(uv_write2, | | 343 | + stream(), | | 344 | + bufs, | | 345 | + count, | | 346 | + send_handle, | | 347 | + AfterUvWrite); | 346 | 348 | } | 347 | 349 |
| 348 | 350 | if (!r) { | @@ -356,8 +358,6 @@ int LibuvStreamWrap::DoWrite(WriteWrap* req_wrap, | 356 | 358 | } | 357 | 359 | } | 358 | 360 |
| 359 | | - w->Dispatched(); | 360 | | - | 361 | 361 | return r; | 362 | 362 | } | 363 | 363 |
| |
|