httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: CGI 3 second problem
Date Wed, 19 Mar 1997 19:12:13 GMT
Actually, here's a stopgap solution that might work and would be good
enough for 1.2.  Instead of allocating out of r->pool, allocate out of
r->main->pool if it is a subrequest.

Dean

Index: mod_cgi.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_cgi.c,v
retrieving revision 1.35
diff -c -3 -r1.35 mod_cgi.c
*** mod_cgi.c	1997/03/07 14:15:39	1.35
--- mod_cgi.c	1997/03/19 19:06:56
***************
*** 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) {


Mime
View raw message