1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-07 07:55:04 -05:00

Compare commits

...

2 Commits

Author SHA1 Message Date
xmrig
0d9af3347d Merge pull request #3652 from SChernykh/dev
Fixed HttpsClient::flush logic
2025-04-17 16:12:31 +07:00
SChernykh
d24e13e605 Fixed HttpsClient::flush logic
- Don't write empty buffers
- Don't write if an error was returned
2025-04-17 10:32:14 +02:00

View File

@@ -189,10 +189,12 @@ void xmrig::HttpsClient::flush(bool close)
}
char *data = nullptr;
const size_t size = BIO_get_mem_data(m_write, &data); // NOLINT(cppcoreguidelines-pro-type-cstyle-cast)
std::string body(data, size);
const long size = BIO_get_mem_data(m_write, &data); // NOLINT(cppcoreguidelines-pro-type-cstyle-cast)
std::string body(data, (size > 0) ? size : 0);
(void) BIO_reset(m_write);
if (!body.empty()) {
HttpContext::write(std::move(body), close);
}
}