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:
@@ -77,6 +77,7 @@ jerryx_debugger_tcp_send (jerry_debugger_transport_header_t *header_p, /**< tcp
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
#ifdef __linux__
|
||||||
ssize_t is_err = recv (tcp_p->tcp_socket, NULL, 0, MSG_PEEK);
|
ssize_t is_err = recv (tcp_p->tcp_socket, NULL, 0, MSG_PEEK);
|
||||||
|
|
||||||
if (is_err == 0 && errno != EWOULDBLOCK)
|
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);
|
jerryx_debugger_tcp_log_error (err_val);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif /* __linux__ */
|
||||||
|
|
||||||
ssize_t sent_bytes = send (tcp_p->tcp_socket, message_p, message_length, 0);
|
ssize_t sent_bytes = send (tcp_p->tcp_socket, message_p, message_length, 0);
|
||||||
|
|
||||||
if (sent_bytes < 0)
|
if (sent_bytes < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user