From f2ae887a62e8ff75a22c81d8cc5e4c866b1171c7 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 17 Jan 2016 16:50:32 +1100 Subject: [PATCH] Fix initial rcvbufsiz detection --- src/ckpool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ckpool.c b/src/ckpool.c index bacfa791..2977c44b 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -524,7 +524,8 @@ static void clear_bufline(connsock_t *cs) cs->buf = ckzalloc(PAGESIZE); cs->bufsize = PAGESIZE; getsockopt(cs->fd, SOL_SOCKET, SO_RCVBUF, &cs->rcvbufsiz, &optlen); - LOGDEBUG("connsock rcvbufsiz set to %d", cs->rcvbufsiz); + cs->rcvbufsiz /= 2; + LOGDEBUG("connsock rcvbufsiz detected as %d", cs->rcvbufsiz); } else if (cs->buflen) { memmove(cs->buf, cs->buf + cs->bufofs, cs->buflen); memset(cs->buf + cs->buflen, 0, cs->bufofs);