mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-25 04:59:30 +00:00
# Fixed send buffer overflow and increase send buffer size.
This commit is contained in:
parent
dc76879188
commit
0adad68471
2 changed files with 4 additions and 2 deletions
|
@ -482,7 +482,9 @@ int64_t Client::send(const rapidjson::Document &doc)
|
||||||
doc.Accept(writer);
|
doc.Accept(writer);
|
||||||
|
|
||||||
const size_t size = buffer.GetSize();
|
const size_t size = buffer.GetSize();
|
||||||
if (size > (sizeof(m_buf) - 2)) {
|
if (size > (sizeof(m_sendBuf) - 2)) {
|
||||||
|
LOG_ERR("[%s] send failed: \"send buffer overflow: %zu > %zu\"", m_pool.url(), size, (sizeof(m_sendBuf) - 2));
|
||||||
|
close();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ private:
|
||||||
bool m_quiet;
|
bool m_quiet;
|
||||||
char m_buf[kInputBufferSize];
|
char m_buf[kInputBufferSize];
|
||||||
char m_ip[46];
|
char m_ip[46];
|
||||||
char m_sendBuf[1024];
|
char m_sendBuf[2048];
|
||||||
const char *m_agent;
|
const char *m_agent;
|
||||||
IClientListener *m_listener;
|
IClientListener *m_listener;
|
||||||
int m_extensions;
|
int m_extensions;
|
||||||
|
|
Loading…
Reference in a new issue