the full chunk was fetched. If the chunk size is bigger than
HTTP_BUF_SIZE iosz will be not zero and STATE_RESPONSE_DATA should
be used to fetch another buffer full of data.
OK beck@
-/* $OpenBSD: http.c,v 1.46 2021/10/29 08:51:20 claudio Exp $ */
+/* $OpenBSD: http.c,v 1.47 2021/11/03 13:29:28 claudio Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
/* all data written, switch back to read */
if (conn->bufpos == 0 || conn->iosz == 0) {
- if (conn->chunked)
+ if (conn->chunked && conn->iosz == 0)
conn->state = STATE_RESPONSE_CHUNKED_TRAILER;
else
conn->state = STATE_RESPONSE_DATA;