From bba064044be1f6f5c0d1d88dfeb2ab423f68e64a Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 29 Jan 2016 14:49:23 +1100 Subject: [PATCH] Increase bidirectional buffer sizes to trusted remotes to 2MB default --- src/connector.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/connector.c b/src/connector.c index 55fccb0a..24414023 100644 --- a/src/connector.c +++ b/src/connector.c @@ -1068,7 +1068,9 @@ static void remote_server(ckpool_t *ckp, cdata_t *cdata, client_instance_t *clie ASPRINTF(&buf, "{\"result\":true,\"bkey\":true}\n"); send_client_msg(cdata, client->id, buf); if (!ckp->rmem_warn) - set_recvbufsize(ckp, client->fd, 1048576); + set_recvbufsize(ckp, client->fd, 2097152); + if (!ckp->wmem_warn) + client->sendbufsize = set_sendbufsize(ckp, client->fd, 2097152); } static bool connect_upstream(ckpool_t *ckp, connsock_t *cs) @@ -1086,8 +1088,10 @@ static bool connect_upstream(ckpool_t *ckp, connsock_t *cs) keep_sockalive(cs->fd); /* We want large send buffers for upstreaming messages */ + if (!ckp->rmem_warn) + set_recvbufsize(ckp, cs->fd, 2097152); if (!ckp->wmem_warn) - cs->sendbufsiz = set_sendbufsize(ckp, cs->fd, 1048576); + cs->sendbufsiz = set_sendbufsize(ckp, cs->fd, 2097152); JSON_CPACK(req, "{ss,sb,s[s]}", "method", "mining.remote",