diff options
-rw-r--r-- | lib/libfetch/http.c | 8 |
1 files 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) { |