unix: fix write queue double init

This commit is contained in:
Ben Noordhuis 2011-09-14 01:38:51 +02:00
parent 3c00d87b42
commit d70c760338

View File

@ -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;
}