[vlc-devel] commit: httpd: correctly reads from ufd[]... (Paul Corke )

git version control git at videolan.org
Wed Nov 12 17:12:27 CET 2008


vlc | branch: 0.9-bugfix | Paul Corke <paulc at datatote.co.uk> | Tue Nov 11 10:05:45 2008 +0000| [5b113afad959a191ddde3c0813506d16d20d190e] | committer: 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: Rémi Denis-Courmont <rdenis at simphalempin.com>
(cherry picked from commit 52193737a575d2e26e7be17cf5ca78f9a063a2b5)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5b113afad959a191ddde3c0813506d16d20d190e
---

 src/network/httpd.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/network/httpd.c b/src/network/httpd.c
index c9c6cc8..62775d6 100644
--- a/src/network/httpd.c
+++ b/src/network/httpd.c
@@ -2465,10 +2465,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])] );
 
@@ -2502,6 +2503,8 @@ retry:
             {
                 cl->b_read_waiting = true;
             }
+
+            ++nfd;
         }
         vlc_mutex_unlock( &host->lock );
 




More information about the vlc-devel mailing list