From f76720753cbeb751a408446c897eae45bceb1c92 Mon Sep 17 00:00:00 2001 From: luqiuwen Date: Mon, 9 Sep 2019 13:20:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=BF=9E=E6=8E=A5=E9=94=80?= =?UTF-8?q?=E6=AF=81=E6=97=B6=E6=B2=A1=E6=9C=89=E5=85=B3=E9=97=ADFD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82=20*=20=E5=8E=9F=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E8=BF=9E=E6=8E=A5=E9=94=80=E6=AF=81=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=B0=86=E5=85=B3=E9=97=ADFD=E7=9A=84=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=94=BE=E5=85=A5=E7=9A=84assert=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E4=BC=98=E5=8C=96=E7=BC=96=E8=AF=91=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=85=B3=E9=97=ADFD=E7=9A=84=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E7=BC=96=E8=AF=91=EF=BC=9B=20*=20=E7=8E=B0?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=8C=E5=B0=86=E5=85=B3=E9=97=ADFD?= =?UTF-8?q?=E7=9A=84=E8=AF=AD=E5=8F=A5=E4=BB=8Eassert=E4=B8=AD=E7=A7=BB?= =?UTF-8?q?=E5=87=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/src/tcp_stream.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/src/tcp_stream.cpp b/platform/src/tcp_stream.cpp index fa33f6a..c2c1486 100644 --- a/platform/src/tcp_stream.cpp +++ b/platform/src/tcp_stream.cpp @@ -401,6 +401,7 @@ evutil_socket_t __conn_private_release_fd(struct tfe_conn_private * conn) static void __conn_private_destory(struct tfe_conn_private * conn) { + int ret = 0; if (conn->bev) { bufferevent_disable(conn->bev, EV_READ | EV_WRITE); @@ -415,10 +416,12 @@ static void __conn_private_destory(struct tfe_conn_private * conn) if (conn->fd > 0) { - assert(evutil_closesocket(conn->fd) >= 0); + ret = evutil_closesocket(conn->fd); + assert(ret >= 0); } free(conn); + (void)ret; TFE_PROXY_STAT_INCREASE(STAT_FD_INSTANT_CLOSE, 1); }