From e24f8de6ea8b27172e10a890d97d86b668203697 Mon Sep 17 00:00:00 2001 From: Xpol Wan Date: Wed, 9 Mar 2016 20:50:42 +0800 Subject: [PATCH] remove duplicated close code in `tcp__cleanup_async_cb`. `tt->reset_fn(tt)` aka `tcp__reset` already closed the tcp handle. --- src/tr/uv/tr_uv_tcp_aux.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/tr/uv/tr_uv_tcp_aux.c b/src/tr/uv/tr_uv_tcp_aux.c index 70f1cce..95cbf59 100644 --- a/src/tr/uv/tr_uv_tcp_aux.c +++ b/src/tr/uv/tr_uv_tcp_aux.c @@ -658,10 +658,6 @@ void tcp__cleanup_async_cb(uv_async_t* a) } tcp__cleanup_pc_json(&tt->handshake_opts); - - if (!uv_is_closing((uv_handle_t*)&tt->socket)) { - uv_close((uv_handle_t*)&tt->socket, NULL); - } tt->reconn_times = 0; #define C(x) uv_close((uv_handle_t*)&tt->x, NULL)