]> prime8.dev >> repos - ttyd.git/commitdiff
protocol: cleanup pipe handle
authorShuanglei Tao <tsl0922@gmail.com>
Sat, 30 Nov 2019 11:24:42 +0000 (19:24 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Sat, 30 Nov 2019 11:24:42 +0000 (19:24 +0800)
src/protocol.c

index d73e3746b4c7a241390985df7461137368f9329c..8f019a37277c563ca16f2d4cb3323a7eabdd4224 100644 (file)
@@ -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;
             }