From 1bed575100213d8f283c21158b008db685aca5b0 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Thu, 27 May 2004 03:44:45 +0000 Subject: fix receiving the last bytes of a http connection now .ram files should work again with http CVS patchset: 6596 CVS date: 2004/05/27 03:44:45 --- src/input/input_http.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/input/input_http.c b/src/input/input_http.c index 22ba50a75..17e4748f0 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -19,7 +19,7 @@ * * input plugin for http network streams * - * $Id: input_http.c,v 1.89 2004/05/16 14:04:13 tmattern Exp $ + * $Id: input_http.c,v 1.90 2004/05/27 03:44:45 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -393,11 +393,14 @@ static off_t http_plugin_read (input_plugin_t *this_gen, n = nlen - num_bytes; if (n) { - if (http_plugin_read_int (this, &buf[num_bytes], n) != n) - return -1; + int read_bytes; + read_bytes = http_plugin_read_int (this, &buf[num_bytes], n); + + if (read_bytes < 0) + return read_bytes; - num_bytes += n; - this->curpos += n; + num_bytes += read_bytes; + this->curpos += read_bytes; } return num_bytes; -- cgit v1.2.3