fielding 97/03/31 22:17:53
Modified: src CHANGES mod_cgi.c Log: Stopgap solution for CGI 3-second delay with server-side includes: if processing a subrequest, allocate memory from r->main->pool instead of r->pool so that we can avoid waiting for free_proc_chain to cleanup in the middle of an SSI request. Submitted by: Dean Gaudet, PR #122 Reviewed by: Roy Fielding Revision Changes Path 1.219 +5 -0 apache/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache/src/CHANGES,v retrieving revision 1.218 retrieving revision 1.219 diff -C3 -r1.218 -r1.219 *** CHANGES 1997/04/01 05:41:43 1.218 --- CHANGES 1997/04/01 06:17:51 1.219 *************** *** 1,5 **** --- 1,10 ---- Changes with Apache 1.2b8 + *) Stopgap solution for CGI 3-second delay with server-side includes: if + processing a subrequest, allocate memory from r->main->pool instead + of r->pool so that we can avoid waiting for free_proc_chain to cleanup + in the middle of an SSI request. [Dean Gaudet] PR #122 + *) Fixed status of response when POST is received for a nonexistant URL (was sending 405, now 404) and when any method is sent with a full-URI that doesn't match the server and the server is not acting 1.36 +14 -8 apache/src/mod_cgi.c Index: mod_cgi.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_cgi.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C3 -r1.35 -r1.36 *** mod_cgi.c 1997/03/07 14:15:39 1.35 --- mod_cgi.c 1997/04/01 06:17:52 1.36 *************** *** 155,161 **** { NULL} }; ! int log_scripterror(request_rec *r, cgi_server_conf *conf, int ret, char *error) { FILE *f; --- 155,161 ---- { NULL} }; ! static int log_scripterror(request_rec *r, cgi_server_conf *conf, int ret, char *error) { FILE *f; *************** *** 182,188 **** return ret; } ! int log_script(request_rec *r, cgi_server_conf *conf, int ret, char *dbuf, char *sbuf, FILE *script_in, FILE *script_err) { table *hdrs_arr = r->headers_in; --- 182,188 ---- return ret; } ! static int log_script(request_rec *r, cgi_server_conf *conf, int ret, char *dbuf, char *sbuf, FILE *script_in, FILE *script_err) { table *hdrs_arr = r->headers_in; *************** *** 252,259 **** fputs("\n", f); } ! pfclose(r->pool, script_in); ! pfclose(r->pool, script_err); pfclose(r->pool, f); return ret; --- 252,259 ---- fputs("\n", f); } ! pfclose(r->main ? r->main->pool : r->pool, script_in); ! pfclose(r->main ? r->main->pool : r->pool, script_err); pfclose(r->pool, f); return ret; *************** *** 406,412 **** cld.debug = conf->logname ? 1 : 0; if (!(child_pid = ! spawn_child_err (r->pool, cgi_child, (void *)&cld, nph ? just_wait : kill_after_timeout, #ifdef __EMX__ &script_out, &script_in, &script_err))) { --- 406,418 ---- cld.debug = conf->logname ? 1 : 0; if (!(child_pid = ! /* ! * we spawn out of r->main if it's there so that we can avoid ! * waiting for free_proc_chain to cleanup in the middle of an ! * SSI request -djg ! */ ! spawn_child_err (r->main ? r->main->pool : r->pool, cgi_child, ! (void *)&cld, nph ? just_wait : kill_after_timeout, #ifdef __EMX__ &script_out, &script_in, &script_err))) { *************** *** 467,473 **** kill_timeout (r); } ! pfclose (r->pool, script_out); /* Handle script return... */ if (script_in && !nph) { --- 473,479 ---- kill_timeout (r); } ! pfclose (r->main ? r->main->pool : r->pool, script_out); /* Handle script return... */ if (script_in && !nph) { *************** *** 519,526 **** while (fgets(argsbuffer, HUGE_STRING_LEN-1, script_err) != NULL) continue; kill_timeout (r); ! pfclose (r->pool, script_in); ! pfclose (r->pool, script_err); } if (nph) { --- 525,532 ---- while (fgets(argsbuffer, HUGE_STRING_LEN-1, script_err) != NULL) continue; kill_timeout (r); ! pfclose (r->main ? r->main->pool : r->pool, script_in); ! pfclose (r->main ? r->main->pool : r->pool, script_err); } if (nph) {