]> git.sesse.net Git - vlc/commitdiff
Fixed an incorrect read() error handling (http access).
authorLaurent Aimar <fenrir@videolan.org>
Mon, 13 Apr 2009 19:24:05 +0000 (21:24 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 13 Apr 2009 19:27:13 +0000 (21:27 +0200)
It was based on xxcv investigation and preliminary patch.
It should fix #2644.

modules/access/http.c

index 0304f2d503aced9d1e250fe9befeb0291f24ec77..e10114f9cbc230cc6aa4bc8519822919e245e786 100644 (file)
@@ -750,7 +750,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
             }
         }
     }
-    else if( i_read == 0 )
+    else if( i_read <= 0 )
     {
         /*
          * I very much doubt that this will work.
@@ -781,7 +781,10 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
             }
         }
 
-        if( i_read == 0 ) p_access->info.b_eof = true;
+        if( i_read == 0 )
+            p_access->info.b_eof = true;
+        else if( i_read < 0 )
+            p_access->b_error = true;
     }
 
     if( p_access->info.i_size != -1 )