Fixed connection lost of debugging sessions. (#2636)

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
This commit is contained in:
László Langó 2018-12-12 15:41:42 +01:00 committed by Akos Kiss
parent 93e71150fe
commit 9b24bde4c6

View File

@ -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)