diff options
| author | manuel <manuel@mausz.at> | 2014-05-20 00:30:28 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2014-05-20 00:30:28 +0200 |
| commit | aafb377061b8926de4f3d8bddb204263cc45aa9c (patch) | |
| tree | 560870ddc3415fb4a38b0e0fcd329d03c71e9246 /ipme.c | |
| parent | 74ed200b0d1b98c7da6312ba361fead608a5a315 (diff) | |
| download | qmail-aafb377061b8926de4f3d8bddb204263cc45aa9c.tar.gz qmail-aafb377061b8926de4f3d8bddb204263cc45aa9c.tar.bz2 qmail-aafb377061b8926de4f3d8bddb204263cc45aa9c.zip | |
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
Diffstat (limited to 'ipme.c')
| -rw-r--r-- | ipme.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -56,7 +56,7 @@ int ipme_init() | |||
| 56 | if (!ipalloc_append(&ipme,&ix)) { return 0; } | 56 | if (!ipalloc_append(&ipme,&ix)) { return 0; } |
| 57 | if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1; | 57 | if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1; |
| 58 | 58 | ||
| 59 | len = 256; | 59 | len = 8192; /* any value big enough to get all the interfaces in one read is good */ |
| 60 | for (;;) { | 60 | for (;;) { |
| 61 | if (!stralloc_ready(&buf,len)) { close(s); return 0; } | 61 | if (!stralloc_ready(&buf,len)) { close(s); return 0; } |
| 62 | buf.len = 0; | 62 | buf.len = 0; |
| @@ -68,7 +68,7 @@ int ipme_init() | |||
| 68 | break; | 68 | break; |
| 69 | } | 69 | } |
| 70 | if (len > 200000) { close(s); return -1; } | 70 | if (len > 200000) { close(s); return -1; } |
| 71 | len += 100 + (len >> 2); | 71 | len *= 2; |
| 72 | } | 72 | } |
| 73 | x = buf.s; | 73 | x = buf.s; |
| 74 | while (x < buf.s + buf.len) { | 74 | while (x < buf.s + buf.len) { |
