From 52193737a575d2e26e7be17cf5ca78f9a063a2b5 Mon Sep 17 00:00:00 2001 From: Paul Corke Date: Tue, 11 Nov 2008 10:05:45 +0000 Subject: [PATCH] httpd: correctly reads from ufd[]... MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ...in the case where there are multiple clients, not all of which are waiting to be serviced. Signed-off-by: Rémi Denis-Courmont --- src/network/httpd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/network/httpd.c b/src/network/httpd.c index 546a77eee4..0e5406b0d2 100644 --- a/src/network/httpd.c +++ b/src/network/httpd.c @@ -2464,10 +2464,11 @@ retry: /* Handle client sockets */ vlc_mutex_lock( &host->lock ); now = mdate(); + nfd = host->nfd; for( int i_client = 0; i_client < host->i_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])] ); @@ -2501,6 +2502,8 @@ retry: { cl->b_read_waiting = true; } + + ++nfd; } vlc_mutex_unlock( &host->lock ); -- 2.39.5