mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
Merge pull request #7495 from Icinga/bugfix/http-buffer-revert
Revert: Always reset Boost beast buffer in HttpServerConnection#ProcessMessages #7476
This commit is contained in:
commit
6a059e972a
@ -495,6 +495,11 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc)
|
|||||||
namespace http = beast::http;
|
namespace http = beast::http;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
/* Do not reset the buffer in the state machine.
|
||||||
|
* EnsureValidHeaders already reads from the stream into the buffer,
|
||||||
|
* EnsureValidBody continues. ProcessRequest() actually handles the request
|
||||||
|
* and needs the full buffer.
|
||||||
|
*/
|
||||||
beast::flat_buffer buf;
|
beast::flat_buffer buf;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -508,8 +513,6 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc)
|
|||||||
|
|
||||||
response.set(http::field::server, l_ServerHeader);
|
response.set(http::field::server, l_ServerHeader);
|
||||||
|
|
||||||
// Best practice is to always reset the buffer.
|
|
||||||
buf = {};
|
|
||||||
if (!EnsureValidHeaders(*m_Stream, buf, parser, response, m_ShuttingDown, yc)) {
|
if (!EnsureValidHeaders(*m_Stream, buf, parser, response, m_ShuttingDown, yc)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -555,8 +558,6 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Best practice is to always reset the buffer.
|
|
||||||
buf = {};
|
|
||||||
if (!EnsureValidBody(*m_Stream, buf, parser, authenticatedUser, response, m_ShuttingDown, yc)) {
|
if (!EnsureValidBody(*m_Stream, buf, parser, authenticatedUser, response, m_ShuttingDown, yc)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user