From aafb377061b8926de4f3d8bddb204263cc45aa9c Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 20 May 2014 00:30:28 +0200 Subject: Increase memory buffer from 256 to 8k This patch increases the size of the memory buffer that qmail uses when querying the system for a list of all local IP addresses. This mailing list message describes the problem and includes the patch file. see http://www.mail-archive.com/qmail@id.wustl.edu/msg20935.html --- ipme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipme.c b/ipme.c index 9eabad0..f636ab5 100644 --- a/ipme.c +++ b/ipme.c @@ -56,7 +56,7 @@ int ipme_init() if (!ipalloc_append(&ipme,&ix)) { return 0; } if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1; - len = 256; + len = 8192; /* any value big enough to get all the interfaces in one read is good */ for (;;) { if (!stralloc_ready(&buf,len)) { close(s); return 0; } buf.len = 0; @@ -68,7 +68,7 @@ int ipme_init() break; } if (len > 200000) { close(s); return -1; } - len += 100 + (len >> 2); + len *= 2; } x = buf.s; while (x < buf.s + buf.len) { -- cgit v1.2.3