mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
avoid illegal sockfd on timeout
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
011f915dd0
commit
7201057d28
1 changed files with 5 additions and 2 deletions
|
@ -310,6 +310,7 @@ int
|
|||
lws_service_timeout_check(struct lws *wsi, unsigned int sec)
|
||||
{
|
||||
struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi];
|
||||
int n = 0;
|
||||
|
||||
/*
|
||||
* if extensions want in on it (eg, we are a mux parent)
|
||||
|
@ -327,13 +328,15 @@ lws_service_timeout_check(struct lws *wsi, unsigned int sec)
|
|||
*/
|
||||
if ((time_t)sec > wsi->pending_timeout_limit) {
|
||||
#if LWS_POSIX
|
||||
if (wsi->sock != LWS_SOCK_INVALID)
|
||||
n = pt->fds[wsi->sock].events;
|
||||
|
||||
/* no need to log normal idle keepalive timeout */
|
||||
if (wsi->pending_timeout != PENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE)
|
||||
lwsl_notice("wsi %p: TIMEDOUT WAITING on %d (did hdr %d, ah %p, wl %d, pfd events %d)\n",
|
||||
(void *)wsi, wsi->pending_timeout,
|
||||
wsi->hdr_parsing_completed, wsi->u.hdr.ah,
|
||||
pt->ah_wait_list_length,
|
||||
pt->fds[wsi->sock].events);
|
||||
pt->ah_wait_list_length, n);
|
||||
#endif
|
||||
/*
|
||||
* Since he failed a timeout, he already had a chance to do
|
||||
|
|
Loading…
Add table
Reference in a new issue