From c0ebb57d9ec34dd8f29012b2b1b0465e14aedcaa Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Sat, 30 Nov 2019 19:24:42 +0800 Subject: [PATCH] protocol: cleanup pipe handle --- src/protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol.c b/src/protocol.c index d73e374..8f019a3 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -108,6 +108,7 @@ check_host_origin(struct lws *wsi) { void pss_tty_free(struct pss_tty *pss) { uv_read_stop((uv_stream_t *) &pss->pipe); + uv_close((uv_handle_t*) &pss->pipe, NULL); uv_signal_stop(&pss->watcher); close(pss->pty); @@ -324,7 +325,6 @@ callback_tty(struct lws *wsi, enum lws_callback_reasons reason, lws_close_reason(wsi, LWS_CLOSE_STATUS_NORMAL, NULL, 0); return 1; } else if (pss->pty_len < 0) { - lwsl_err("read error: %d (%s)\n", errno, strerror(errno)); lws_close_reason(wsi, LWS_CLOSE_STATUS_UNEXPECTED_CONDITION, NULL, 0); return -1; } -- 2.43.4