From d70c760338eb6f2bbf5e57e4692c68a467690d8a Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 14 Sep 2011 01:38:51 +0200 Subject: [PATCH] unix: fix write queue double init --- src/unix/stream.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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; }