# Fixed send buffer overflow and increase send buffer size.

This commit is contained in:
XMRig 2018-09-20 07:33:32 +03:00
parent dc76879188
commit 0adad68471
2 changed files with 4 additions and 2 deletions

View file

@ -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;
} }

View file

@ -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;