mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
cover-proxy-read-EAGAIN.patch
Subject: [PATCH] Because of nonblocking sockets reading from proxy might not work in one turn. We should check for EAGAIN.
This commit is contained in:
parent
5efcb3f7de
commit
cfa8ac34c7
1 changed files with 7 additions and 0 deletions
|
@ -78,6 +78,13 @@ int lws_client_socket_service(struct libwebsocket_context *context,
|
|||
n = recv(wsi->sock, context->service_buffer,
|
||||
sizeof(context->service_buffer), 0);
|
||||
if (n < 0) {
|
||||
|
||||
if (errno == EAGAIN) {
|
||||
lwsl_debug(
|
||||
"Proxy read returned EAGAIN... retrying\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
libwebsocket_close_and_free_session(context, wsi,
|
||||
LWS_CLOSE_STATUS_NOSTATUS);
|
||||
lwsl_err("ERROR reading from proxy socket\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue