From 9f23616dfcabbc5f5931337125e26cbcb91f3e84 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 19 Jan 2016 09:56:49 +1100 Subject: [PATCH] Generically set send/recv buffers larger on passthroughs --- src/ckpool.h | 2 +- src/generator.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ckpool.h b/src/ckpool.h index d247bdd0..0f00e926 100644 --- a/src/ckpool.h +++ b/src/ckpool.h @@ -82,7 +82,7 @@ struct connsock { int buflen; int bufsize; int rcvbufsiz; - bool rcvbufsiz_setfail; + int sendbufsiz; ckpool_t *ckp; /* Semaphore used to serialise request/responses */ diff --git a/src/generator.c b/src/generator.c index 3a1390ed..f5fa7f2d 100644 --- a/src/generator.c +++ b/src/generator.c @@ -445,6 +445,12 @@ static bool connect_proxy(ckpool_t *ckp, connsock_t *cs, proxy_instance_t *proxy cs->fd, proxy->epfd); return false; } + } else { + /* We want large send/recv buffers on passthroughs */ + if (!ckp->rmem_warn) + cs->rcvbufsiz = set_recvbufsize(ckp, cs->fd, 1048576); + if (!ckp->wmem_warn) + cs->sendbufsiz = set_sendbufsize(ckp, cs->fd, 1048576); } return true; }