1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-10 09:02:45 -05:00

#2207 Fixed regression in HTTP parser.

This commit is contained in:
XMRig
2021-04-10 21:02:59 +07:00
parent 3c6077fb02
commit 30cfcc27db
5 changed files with 7 additions and 14 deletions

View File

@@ -50,14 +50,7 @@ void xmrig::HttpServer::onConnection(uv_stream_t *stream, uint16_t)
{
auto ctx = static_cast<HttpContext*>(tcp->data);
if (nread >= 0) {
const auto size = static_cast<size_t>(nread);
const auto parsed = ctx->parse(buf->base, size);
if (parsed < size) {
ctx->close();
}
} else {
if (nread < 0 || !ctx->parse(buf->base, static_cast<size_t>(nread))) {
ctx->close();
}