From 03816d7283d11324578e066c6801fce448319c56 Mon Sep 17 00:00:00 2001 From: claudio Date: Wed, 3 Nov 2021 13:29:28 +0000 Subject: [PATCH] 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@ --- usr.sbin/rpki-client/http.c | 4 ++-- 1 file 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 * Copyright (c) 2020 Claudio Jeker @@ -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; -- 2.20.1