From 9b24bde4c6794f1556f2a6f19d4f67fe5c83449b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Lang=C3=B3?= Date: Wed, 12 Dec 2018 15:41:42 +0100 Subject: [PATCH] Fixed connection lost of debugging sessions. (#2636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The peek of the socket does not work on other platforms, beacause the errno is not set correctly. The code path added by #2427 Linux specific, so it has been guarded to solve connection lost issues during debugging sessions when the client does not send data but still connected. JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com --- jerry-ext/debugger/debugger-tcp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jerry-ext/debugger/debugger-tcp.c b/jerry-ext/debugger/debugger-tcp.c index 8b00ae65e..12082f66e 100644 --- a/jerry-ext/debugger/debugger-tcp.c +++ b/jerry-ext/debugger/debugger-tcp.c @@ -77,6 +77,7 @@ jerryx_debugger_tcp_send (jerry_debugger_transport_header_t *header_p, /**< tcp do { +#ifdef __linux__ ssize_t is_err = recv (tcp_p->tcp_socket, NULL, 0, MSG_PEEK); if (is_err == 0 && errno != EWOULDBLOCK) @@ -86,6 +87,8 @@ jerryx_debugger_tcp_send (jerry_debugger_transport_header_t *header_p, /**< tcp jerryx_debugger_tcp_log_error (err_val); return false; } +#endif /* __linux__ */ + ssize_t sent_bytes = send (tcp_p->tcp_socket, message_p, message_length, 0); if (sent_bytes < 0)