Don't forget to set the error flag when _fetch_read() returns -1.
This commit is contained in:
parent
65393a863e
commit
cab8495092
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user