Skip to content

Commit 7adbd91

Browse files
committed
http/server/Send: initialize response.length in the io_uring code path
1 parent 6613be2 commit 7adbd91

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/http/server/Send.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,13 @@ HttpServerConnection::SubmitResponse(HttpStatus status,
215215
if (auto *uring_queue = socket->GetUringQueue()) {
216216
assert(uring_send == nullptr);
217217

218-
if (body)
218+
if (body) {
219+
response.length = 0;
219220
SetResponseIstream(std::move(body));
221+
} else
222+
/* negative value means the access logger
223+
suppresses the LENGTH attribute */
224+
response.length = -1;
220225

221226
StartUringSend(*uring_queue, std::move(headers3));
222227
return;

0 commit comments

Comments
 (0)