[vlc-devel] [PATCH] http chunked encoding fix

Georgi Chorbadzhiyski gf at unixsol.org
Sat Sep 2 22:08:17 CEST 2006


Hello vlc-devel,
the following patch fixes chunked processing in access/http.c to return EOF (0) instead
of -1 on error. Patch is against vlc 0.8.5.

Without this patch, when vlc reads from http server serving request with chunked
encoding and http server dies or it is restarted, vlc just loops forever reporting
"failed reading chunk-header line", until it is killed.

With this patch applied and --loop option used, when remote server dies vlc reconnects
and continues to stream.

Tested with apache's mod_proxy serving ASF stream. Please apply.

Signed-off-by: Georgi Chorbadzhiyski <gf at unixsol.org>


diff -urp vlc-0.8.5/modules/access/http.c vlc-0.8.5-patched/modules/access/http.c
--- vlc-0.8.5/modules/access/http.c	2006-05-06 18:52:18.000000000 +0300
+++ vlc-0.8.5-patched/modules/access/http.c	2006-09-02 22:15:36.000000000 +0300
@@ -495,7 +495,8 @@ static int Read( access_t *p_access, uin
             if( psz == NULL )
             {
                 msg_Dbg( p_access, "failed reading chunk-header line" );
-                return -1;
+                /* This is definitely fatal error. Better treat it as EOF. */
+                return 0;
             }
             p_sys->i_chunk = strtoll( psz, NULL, 16 );
             free( psz );

-- 
Georgi Chorbadzhiyski
http://georgi.unixsol.org/

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list