diff options
author | des <des@FreeBSD.org> | 2002-10-30 04:42:01 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-10-30 04:42:01 +0000 |
commit | 007c9b98dac84bdb0aaa1ae942543c8a35ffc2c3 (patch) | |
tree | c87b3f36fdc63a671b827cacf872da85777f01b8 /lib/libfetch | |
parent | 98982ac1d8b41f9cee7765accea88219e6018f51 (diff) | |
download | FreeBSD-src-007c9b98dac84bdb0aaa1ae942543c8a35ffc2c3.zip FreeBSD-src-007c9b98dac84bdb0aaa1ae942543c8a35ffc2c3.tar.gz |
Don't forget to set the error flag when _fetch_read() returns -1.
Diffstat (limited to 'lib/libfetch')
-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) { |