summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2021-11-03 13:29:29 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2021-11-03 13:29:29 +0000
commitb02fbcd4408696ebe1342bea772b658c94404b25 (patch)
treee8bec7586ce82711cb733db19d99daaf73928c3f /usr.sbin
parent51f2bcb40c86fa514ae44349e743337d50da4fd5 (diff)
For chunked encoding on switch to STATE_RESPONSE_CHUNKED_TRAILER when
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@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rpki-client/http.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/rpki-client/http.c b/usr.sbin/rpki-client/http.c
index 1cd81024c29..25d951ae302 100644
--- a/usr.sbin/rpki-client/http.c
+++ b/usr.sbin/rpki-client/http.c
@@ -1,4 +1,4 @@
-/* $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>
@@ -1679,7 +1679,7 @@ data_write(struct http_connection *conn)
/* 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;