From fb79b01e7bcea0876b2e62da67e9ca12b5458349 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Mon, 13 Apr 2009 21:24:05 +0200 Subject: [PATCH] Fixed an incorrect read() error handling (http access). It was based on xxcv investigation and preliminary patch. It should fix #2644. --- modules/access/http.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/access/http.c b/modules/access/http.c index 0304f2d503..e10114f9cb 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -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 ) -- 2.39.5