Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Replace uv__req_unref by uv__req_unregister
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed May 15, 2012
1 parent 7f80678 commit 966dd24
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/unix/core.c
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/unix/fs.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
12 changes: 6 additions & 6 deletions src/unix/stream.c
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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(). */
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/unix/udp.c
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 966dd24

Please sign in to comment.