From ca5207bb4c90beaba38bebf5dc9b2642c1918d4a Mon Sep 17 00:00:00 2001 From: Jianhui Zhao Date: Thu, 21 Nov 2024 16:50:46 +0800 Subject: [PATCH] fix: free http con when `ssl_read` return 0. Signed-off-by: Jianhui Zhao --- src/http.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/http.c b/src/http.c index 4bdc54a..0104720 100644 --- a/src/http.c +++ b/src/http.c @@ -126,7 +126,8 @@ static void on_net_read(struct ev_loop *loop, struct ev_io *w, int revents) } if (ret == SSL_WANT_READ || ret == SSL_WANT_WRITE) return; - + if (ret == 0) + goto done; } else { #endif ret = read(w->fd, buf, sizeof(buf));