Skip to content

Commit 6613be2

Browse files
committed
http/server/Send: revert response.length calculation ordering
Was accidently swapped by commit c45aae2
1 parent 2fb7fe1 commit 6613be2

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

debian/changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cm4all-beng-proxy (21.18) unstable; urgency=low
44
* bp: reduce MOUNT_LISTEN_STREAM idle timeout to 2 minutes
55
* http_client: fix use-after-free bug
66
* http_server: fix use-after-free bug
7+
* http_server: do not log LENGTH attribute for response without body
78
* istream/dechunk: fix integer overflow
89

910
--

src/http/server/Send.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,6 @@ HttpServerConnection::SubmitResponse(HttpStatus status,
211211
GrowingBuffer headers3 = headers.ToBuffer();
212212
headers3.Write("\r\n"sv);
213213

214-
/* make sure the access logger gets a negative value if there
215-
is no response body */
216-
response.length -= !body;
217-
218214
#ifdef HAVE_URING
219215
if (auto *uring_queue = socket->GetUringQueue()) {
220216
assert(uring_send == nullptr);
@@ -232,6 +228,10 @@ HttpServerConnection::SubmitResponse(HttpStatus status,
232228
assert(header_length.exhaustive);
233229
response.length = -header_length.length;
234230

231+
/* make sure the access logger gets a negative value if there
232+
is no response body */
233+
response.length -= !body;
234+
235235
SetResponseIstream(NewConcatIstream(request_pool, std::move(header_stream),
236236
std::move(body)));
237237
DeferWrite();

0 commit comments

Comments
 (0)