Skip to content

Commit

Permalink
bugfix: failed to build on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuizhuhaomeng committed Aug 20, 2024
1 parent aad278b commit ea09d92
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ngx_http_lua_socket_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5725,6 +5725,7 @@ ngx_http_lua_socket_keepalive_close_handler(ngx_event_t *ev)
ngx_http_lua_socket_pool_t *spool;

int n;
int err;
char buf[1];
ngx_connection_t *c;

Expand All @@ -5747,18 +5748,19 @@ ngx_http_lua_socket_keepalive_close_handler(ngx_event_t *ev)
"lua tcp socket keepalive close handler check stale events");

n = recv(c->fd, buf, 1, MSG_PEEK);
err = ngx_socket_errno;
#if (NGX_HTTP_SSL)
/* ignore ssl protocol data like change cipher spec */
if (n == 1 && c->ssl != NULL) {
n = c->recv(c, (unsigned char *) buf, 1);
if (n == NGX_AGAIN) {
n = -1;
ngx_socket_errno = NGX_EAGAIN;
err = NGX_EAGAIN;
}
}
#endif

if (n == -1 && ngx_socket_errno == NGX_EAGAIN) {
if (n == -1 && err == NGX_EAGAIN) {
/* stale event */

if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
Expand Down

0 comments on commit ea09d92

Please sign in to comment.