diff options
author | murgatroid99 <mlumish@google.com> | 2017-02-08 11:56:52 -0800 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2017-02-17 12:10:26 -0800 |
commit | 1191b7202d86f01857f74d0709792fb74eac5a37 (patch) | |
tree | 6161f0d0a94e5308c4d38ed87589e92d3c905f8d /src/core | |
parent | fa301e3674a1cc786eb4dd4253a0e677f2eb68e3 (diff) |
Improve Node and libuv testing and test coverage
Allow Node tests to run with or without UV, change default version to 7, add some portability tests. Also make some more core tests work with libuv
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lib/iomgr/tcp_uv.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/lib/iomgr/tcp_uv.c b/src/core/lib/iomgr/tcp_uv.c index a1ee597d09..72955631b5 100644 --- a/src/core/lib/iomgr/tcp_uv.c +++ b/src/core/lib/iomgr/tcp_uv.c @@ -79,8 +79,6 @@ typedef struct { grpc_pollset *pollset; } grpc_tcp; -static void uv_close_callback(uv_handle_t *handle) { gpr_free(handle); } - static void tcp_free(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) { grpc_resource_user_unref(exec_ctx, tcp->resource_user); gpr_free(tcp); @@ -119,6 +117,13 @@ static void tcp_unref(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) { static void tcp_ref(grpc_tcp *tcp) { gpr_ref(&tcp->refcount); } #endif +static void uv_close_callback(uv_handle_t *handle) { + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_tcp *tcp = handle->data; + TCP_UNREF(&exec_ctx, tcp, "destroy"); + grpc_exec_ctx_finish(&exec_ctx); +} + static void alloc_uv_buf(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; @@ -311,7 +316,6 @@ static void uv_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) { grpc_network_status_unregister_endpoint(ep); grpc_tcp *tcp = (grpc_tcp *)ep; uv_close((uv_handle_t *)tcp->handle, uv_close_callback); - TCP_UNREF(exec_ctx, tcp, "destroy"); } static char *uv_get_peer(grpc_endpoint *ep) { |