Commit 52193737 authored by Paul Corke's avatar Paul Corke Committed by Rémi Denis-Courmont

httpd: correctly reads from ufd[]...

...in the case where there are multiple clients, not all of which are
waiting to be serviced.
Signed-off-by: default avatarRémi Denis-Courmont <rdenis@simphalempin.com>
parent 4ee5170c
...@@ -2464,10 +2464,11 @@ retry: ...@@ -2464,10 +2464,11 @@ retry:
/* Handle client sockets */ /* Handle client sockets */
vlc_mutex_lock( &host->lock ); vlc_mutex_lock( &host->lock );
now = mdate(); now = mdate();
nfd = host->nfd;
for( int i_client = 0; i_client < host->i_client; i_client++ ) for( int i_client = 0; i_client < host->i_client; i_client++ )
{ {
httpd_client_t *cl = host->client[i_client]; httpd_client_t *cl = host->client[i_client];
const struct pollfd *pufd = &ufd[host->nfd + i_client]; const struct pollfd *pufd = &ufd[nfd];
assert( pufd < &ufd[sizeof(ufd) / sizeof(ufd[0])] ); assert( pufd < &ufd[sizeof(ufd) / sizeof(ufd[0])] );
...@@ -2501,6 +2502,8 @@ retry: ...@@ -2501,6 +2502,8 @@ retry:
{ {
cl->b_read_waiting = true; cl->b_read_waiting = true;
} }
++nfd;
} }
vlc_mutex_unlock( &host->lock ); vlc_mutex_unlock( &host->lock );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment