Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Replace uv__req_unref by uv__req_unregister

  • Loading branch information
piscisaureus committed May 15, 2012
1 parent 7f80678 commit 966dd24c0f14e3ffd90e119628f3aa7d70b444f4
Showing with 12 additions and 12 deletions.
  1. +1 −1 src/unix/core.c
  2. +3 −3 src/unix/fs.c
  3. +6 −6 src/unix/stream.c
  4. +2 −2 src/unix/udp.c
@@ -316,7 +316,7 @@ static int uv_getaddrinfo_done(eio_req* req_) {

req->res = NULL;

uv__req_unref(req->loop, req);
uv__req_unregister(req->loop, req);

free(req->hints);
free(req->service);
@@ -77,13 +77,13 @@ static void uv_fs_req_init(uv_loop_t* loop, uv_fs_t* req, uv_fs_type fs_type,

/* synchronous requests don't increase the reference count */
if (!req->cb)
uv__req_unref(req->loop, req);
uv__req_unregister(req->loop, req);
}


void uv_fs_req_cleanup(uv_fs_t* req) {
if (req->cb)
uv__req_unref(req->loop, req);
uv__req_unregister(req->loop, req);

free(req->path);
req->path = NULL;
@@ -664,7 +664,7 @@ static void uv__work(eio_req* eio) {

static int uv__after_work(eio_req *eio) {
uv_work_t* req = eio->data;
uv__req_unref(req->loop, req);
uv__req_unregister(req->loop, req);
if (req->after_work_cb) {
req->after_work_cb(req);
}
@@ -134,7 +134,7 @@ void uv__stream_destroy(uv_stream_t* stream) {
ngx_queue_remove(q);

req = ngx_queue_data(q, uv_write_t, queue);
uv__req_unref(stream->loop, req);
uv__req_unregister(stream->loop, req);

if (req->bufs != req->bufsml)
free(req->bufs);
@@ -150,7 +150,7 @@ void uv__stream_destroy(uv_stream_t* stream) {
ngx_queue_remove(q);

req = ngx_queue_data(q, uv_write_t, queue);
uv__req_unref(stream->loop, req);
uv__req_unregister(stream->loop, req);

if (req->cb) {
uv__set_sys_error(stream->loop, req->error);
@@ -166,7 +166,7 @@ void uv__stream_destroy(uv_stream_t* stream) {

shutdown_req = stream->shutdown_req;
stream->shutdown_req = NULL;
uv__req_unref(stream->loop, shutdown_req);
uv__req_unregister(stream->loop, shutdown_req);

if (shutdown_req->cb) {
uv__set_artificial_error(stream->loop, UV_EINTR);
@@ -323,7 +323,7 @@ static void uv__drain(uv_stream_t* stream) {

req = stream->shutdown_req;
stream->shutdown_req = NULL;
uv__req_unref(stream->loop, req);
uv__req_unregister(stream->loop, req);

if (shutdown(stream->fd, SHUT_WR)) {
/* Error. Report it. User should call uv_close(). */
@@ -531,7 +531,7 @@ static void uv__write_callbacks(uv_stream_t* stream) {
q = ngx_queue_head(&stream->write_completed_queue);
req = ngx_queue_data(q, uv_write_t, queue);
ngx_queue_remove(q);
uv__req_unref(stream->loop, req);
uv__req_unregister(stream->loop, req);

/* NOTE: call callback AFTER freeing the request data. */
if (req->cb) {
@@ -800,7 +800,7 @@ static void uv__stream_connect(uv_stream_t* stream) {
ev_io_start(stream->loop->ev, &stream->read_watcher);

stream->connect_req = NULL;
uv__req_unref(stream->loop, req);
uv__req_unregister(stream->loop, req);

if (req->cb) {
uv__set_sys_error(stream->loop, error);
@@ -112,7 +112,7 @@ void uv__udp_finish_close(uv_udp_t* handle) {
ngx_queue_remove(q);

req = ngx_queue_data(q, uv_udp_send_t, queue);
uv__req_unref(handle->loop, req);
uv__req_unregister(handle->loop, req);

if (req->send_cb) {
/* FIXME proper error code like UV_EABORTED */
@@ -194,7 +194,7 @@ static void uv__udp_run_completed(uv_udp_t* handle) {
ngx_queue_remove(q);

req = ngx_queue_data(q, uv_udp_send_t, queue);
uv__req_unref(handle->loop, req);
uv__req_unregister(handle->loop, req);

if (req->bufs != req->bufsml)
free(req->bufs);

0 comments on commit 966dd24

Please sign in to comment.
You can’t perform that action at this time.