From 86962eb7aa90665cbf7d6f993264129c81ec52ef Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:49:05 +0100 Subject: [PATCH] Fixed a bug with Letsencrypt certs One of internal buffers was too small --- src/stratum_server.cpp | 3 ++- src/stratum_server.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stratum_server.cpp b/src/stratum_server.cpp index d4d0577..51c46ed 100644 --- a/src/stratum_server.cpp +++ b/src/stratum_server.cpp @@ -58,7 +58,8 @@ StratumServer::StratumServer(p2pool* pool) , m_totalFailedShares(0) , m_apiLastUpdateTime(0) { - m_callbackBuf.resize(STRATUM_BUF_SIZE); + // Need a bigger buffer for the TLS handshake + m_callbackBuf.resize(STRATUM_CALLBACK_BUF_SIZE); // Diffuse the initial state in case it has low quality m_rng.discard(10000); diff --git a/src/stratum_server.h b/src/stratum_server.h index e92d875..84257ef 100644 --- a/src/stratum_server.h +++ b/src/stratum_server.h @@ -26,6 +26,7 @@ class p2pool; class BlockTemplate; static constexpr size_t STRATUM_BUF_SIZE = log::Stream::BUF_SIZE + 1; +static constexpr size_t STRATUM_CALLBACK_BUF_SIZE = 16384; static constexpr int DEFAULT_STRATUM_PORT = 3333; class StratumServer : public TCPServer