Rev 10 | Rev 8177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 10 | Rev 3841 | ||
---|---|---|---|
Line 207... | Line 207... | ||
207 | if(i==-1) errorquit("fork() error"); |
207 | if(i==-1) errorquit("fork() error"); |
208 | addpid(i); return; |
208 | addpid(i); return; |
209 | } |
209 | } |
210 | alarm(WIMS_TIMEOUT); |
210 | alarm(WIMS_TIMEOUT); |
211 | signal(SIGALRM,alarm1); |
211 | signal(SIGALRM,alarm1); |
212 | chdir("public_html"); |
212 | (void)chdir("public_html"); |
213 | i=0; do { |
213 | i=0; do { |
214 | l=read(soc, buf+i, 1); i++; |
214 | l=read(soc, buf+i, 1); i++; |
215 | } |
215 | } |
216 | while(i<QUERY_STRING_LIMIT && l>0 && (i<4 || memcmp(buf+i-4,"\r\n\r\n",4)!=0)); |
216 | while(i<QUERY_STRING_LIMIT && l>0 && (i<4 || memcmp(buf+i-4,"\r\n\r\n",4)!=0)); |
217 | buf[i]=0; |
217 | buf[i]=0; |
Line 292... | Line 292... | ||
292 | 292 | ||
293 | void parm(void) |
293 | void parm(void) |
294 | { |
294 | { |
295 | char *p; |
295 | char *p; |
296 | p=getenv("WIMS_HOME"); |
296 | p=getenv("WIMS_HOME"); |
297 | if(p!=NULL && *p!=0) chdir(p); |
297 | if(p!=NULL && *p!=0) (void)chdir(p); |
298 | p=getenv("WIMSD_PORT"); |
298 | p=getenv("WIMSD_PORT"); |
299 | if(p!=NULL && *p!=0) { |
299 | if(p!=NULL && *p!=0) { |
300 | int i; |
300 | int i; |
301 | i=atoi(p); |
301 | i=atoi(p); |
302 | if(i>0 && i<65536) sport=i; |
302 | if(i>0 && i<65536) sport=i; |
Line 312... | Line 312... | ||
312 | signal(SIGALRM,alarm2); |
312 | signal(SIGALRM,alarm2); |
313 | sport=8088; pidcnt=0; idle=0; |
313 | sport=8088; pidcnt=0; idle=0; |
314 | parm(); |
314 | parm(); |
315 | if(stat("public_html/wims.cgi",&st)!=0) { |
315 | if(stat("public_html/wims.cgi",&st)!=0) { |
316 | char buf[1024]; |
316 | char buf[1024]; |
317 | getcwd(buf,sizeof(buf)); |
317 | (void)getcwd(buf,sizeof(buf)); |
318 | fprintf(stderr,"Bad home directory %s: \ |
318 | fprintf(stderr,"Bad home directory %s: \ |
319 | wims.cgi not found.\n",buf); exit(1); |
319 | wims.cgi not found.\n",buf); exit(1); |
320 | } |
320 | } |
321 | /* if(stat("public_html/bin/pari",&st)==0) { |
321 | /* if(stat("public_html/bin/pari",&st)==0) { |
322 | fprintf(stderr,"wimsd must be run as nobody, \ |
322 | fprintf(stderr,"wimsd must be run as nobody, \ |