diff --git a/src/unix/stream.c b/src/unix/stream.c index b48f216a..736150ce 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -642,6 +642,7 @@ int uv_write(uv_write_t* req, uv_stream_t* handle, uv_buf_t bufs[], int bufcnt, uv__req_init((uv_req_t*) req); req->cb = cb; req->handle = handle; + req->type = UV_WRITE; ngx_queue_init(&req->queue); assert((handle->type == UV_TCP || handle->type == UV_NAMED_PIPE) @@ -654,10 +655,6 @@ int uv_write(uv_write_t* req, uv_stream_t* handle, uv_buf_t bufs[], int bufcnt, return -1; } - ngx_queue_init(&req->queue); - req->type = UV_WRITE; - - if (bufcnt < UV_REQ_BUFSML_SIZE) { req->bufs = req->bufsml; }