summaryrefslogtreecommitdiffstats
path: root/spawn.c
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2013-02-04 02:42:39 +0100
committermanuel <manuel@mausz.at>2013-02-04 02:42:39 +0100
commitd2b166c433e97c710ec6906493a3bd400d731491 (patch)
treeaf1d09a4c31ddb794715ec57d23ce1d98e92e018 /spawn.c
parent881bcbeb395bd6a06e8bcac3d97b2ca3ed3e2f67 (diff)
downloadqmail-d2b166c433e97c710ec6906493a3bd400d731491.tar.gz
qmail-d2b166c433e97c710ec6906493a3bd400d731491.tar.bz2
qmail-d2b166c433e97c710ec6906493a3bd400d731491.zip
[PATCH] Increase limits for large mail systems
big-concurrency
Diffstat (limited to 'spawn.c')
-rw-r--r--spawn.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/spawn.c b/spawn.c
index b2aee78..1672d57 100644
--- a/spawn.c
+++ b/spawn.c
@@ -63,7 +63,7 @@ int okwrite(fd,buf,n) int fd; char *buf; int n;
63int flagreading = 1; 63int flagreading = 1;
64char outbuf[1024]; substdio ssout; 64char outbuf[1024]; substdio ssout;
65 65
66int stage = 0; /* reading 0:delnum 1:messid 2:sender 3:recip */ 66int stage = 0; /* reading 0:delnum 1:delnum2 2:messid 3:sender 4:recip */
67int flagabort = 0; /* if 1, everything except delnum is garbage */ 67int flagabort = 0; /* if 1, everything except delnum is garbage */
68int delnum; 68int delnum;
69stralloc messid = {0}; 69stralloc messid = {0};
@@ -73,6 +73,7 @@ stralloc recip = {0};
73void err(s) char *s; 73void err(s) char *s;
74{ 74{
75 char ch; ch = delnum; substdio_put(&ssout,&ch,1); 75 char ch; ch = delnum; substdio_put(&ssout,&ch,1);
76 ch = delnum >> 8; substdio_put(&ssout,&ch,1);
76 substdio_puts(&ssout,s); substdio_putflush(&ssout,"",1); 77 substdio_puts(&ssout,s); substdio_putflush(&ssout,"",1);
77} 78}
78 79
@@ -155,16 +156,19 @@ void getcmd()
155 { 156 {
156 case 0: 157 case 0:
157 delnum = (unsigned int) (unsigned char) ch; 158 delnum = (unsigned int) (unsigned char) ch;
158 messid.len = 0; stage = 1; break; 159 stage = 1; break;
159 case 1: 160 case 1:
161 delnum += (unsigned int) ((unsigned int) ch) << 8;
162 messid.len = 0; stage = 2; break;
163 case 2:
160 if (!stralloc_append(&messid,&ch)) flagabort = 1; 164 if (!stralloc_append(&messid,&ch)) flagabort = 1;
161 if (ch) break; 165 if (ch) break;
162 sender.len = 0; stage = 2; break; 166 sender.len = 0; stage = 3; break;
163 case 2: 167 case 3:
164 if (!stralloc_append(&sender,&ch)) flagabort = 1; 168 if (!stralloc_append(&sender,&ch)) flagabort = 1;
165 if (ch) break; 169 if (ch) break;
166 recip.len = 0; stage = 3; break; 170 recip.len = 0; stage = 4; break;
167 case 3: 171 case 4:
168 if (!stralloc_append(&recip,&ch)) flagabort = 1; 172 if (!stralloc_append(&recip,&ch)) flagabort = 1;
169 if (ch) break; 173 if (ch) break;
170 docmd(); 174 docmd();
@@ -201,7 +205,8 @@ char **argv;
201 205
202 initialize(argc,argv); 206 initialize(argc,argv);
203 207
204 ch = auto_spawn; substdio_putflush(&ssout,&ch,1); 208 ch = auto_spawn; substdio_put(&ssout,&ch,1);
209 ch = auto_spawn >> 8; substdio_putflush(&ssout,&ch,1);
205 210
206 for (i = 0;i < auto_spawn;++i) { d[i].used = 0; d[i].output.s = 0; } 211 for (i = 0;i < auto_spawn;++i) { d[i].used = 0; d[i].output.s = 0; }
207 212
@@ -236,7 +241,8 @@ char **argv;
236 continue; /* read error on a readable pipe? be serious */ 241 continue; /* read error on a readable pipe? be serious */
237 if (r == 0) 242 if (r == 0)
238 { 243 {
239 ch = i; substdio_put(&ssout,&ch,1); 244 char ch; ch = i; substdio_put(&ssout,&ch,1);
245 ch = i >> 8; substdio_put(&ssout,&ch,1);
240 report(&ssout,d[i].wstat,d[i].output.s,d[i].output.len); 246 report(&ssout,d[i].wstat,d[i].output.s,d[i].output.len);
241 substdio_put(&ssout,"",1); 247 substdio_put(&ssout,"",1);
242 substdio_flush(&ssout); 248 substdio_flush(&ssout);