From 007c9b98dac84bdb0aaa1ae942543c8a35ffc2c3 Mon Sep 17 00:00:00 2001 From: des Date: Wed, 30 Oct 2002 04:42:01 +0000 Subject: Don't forget to set the error flag when _fetch_read() returns -1. --- lib/libfetch/http.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index fe8262a..02ccce3 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -196,8 +196,10 @@ _http_fillbuf(struct httpio *io, size_t len) if (io->chunked == 0) { if (_http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = _fetch_read(io->conn, io->buf, len)) == -1) + if ((io->buflen = _fetch_read(io->conn, io->buf, len)) == -1) { + io->error = 1; return (-1); + } io->bufpos = 0; return (io->buflen); } @@ -217,8 +219,10 @@ _http_fillbuf(struct httpio *io, size_t len) len = io->chunksize; if (_http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = _fetch_read(io->conn, io->buf, len)) == -1) + if ((io->buflen = _fetch_read(io->conn, io->buf, len)) == -1) { + io->error = 1; return (-1); + } io->chunksize -= io->buflen; if (io->chunksize == 0) { -- cgit v1.1