httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/standard mod_cgi.c
Date Sat, 26 Aug 2000 19:45:17 GMT
trawick     00/08/26 12:45:16

  Modified:    src/modules/standard mod_cgi.c
  Log:
  Call ap_pass_brigade() *before* soaking up stderr.  The normal CGI
  is going to write a bunch of stuff to stdout and nothing to stderr.
  Reading stderr before processing the stdout pipe can cause deadlock if
  the CGI fills the kernel buffer for stdout because the CGI will stall
  writing to stdout while the httpd process will stall reading from the
  CGI's stderr.
  
  The NPH CGI behavior was unchanged.  If this is still a problem for NPH
  CGIs, it was a problem before filtering too.
  
  Also, get rid of a couple of unused variables in cgi_handler.
  
  Revision  Changes    Path
  1.60      +2 -3      apache-2.0/src/modules/standard/mod_cgi.c
  
  Index: mod_cgi.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cgi.c,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- mod_cgi.c	2000/08/25 22:18:15	1.59
  +++ mod_cgi.c	2000/08/26 19:45:15	1.60
  @@ -311,8 +311,6 @@
       apr_procattr_t *procattr;
       apr_proc_t *procnew = apr_pcalloc(p, sizeof(*procnew));
       apr_status_t rc = APR_SUCCESS;
  -    apr_file_t *file = NULL;
  -    apr_socket_t *sock = NULL;
   #if defined(RLIMIT_CPU)  || defined(RLIMIT_NPROC) || \
       defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS)
       core_dir_config *conf;
  @@ -661,6 +659,7 @@
               ap_brigade_append_buckets(bb, ap_bucket_create_pipe(script_in));
               ap_brigade_append_buckets(bb, ap_bucket_create_eos());
   	}
  +        ap_pass_brigade(r->filters, bb);
   
           log_script_err(r, script_err);
   	apr_close(script_err);
  @@ -670,9 +669,9 @@
           bb = ap_brigade_create(r->pool);
           ap_brigade_append_buckets(bb, ap_bucket_create_pipe(script_in));
           ap_brigade_append_buckets(bb, ap_bucket_create_eos());
  +        ap_pass_brigade(r->filters, bb);
       }
   
  -    ap_pass_brigade(r->filters, bb);
       return OK;			/* NOT r->status, even if it has changed. */
   }
   
  
  
  

Mime
View raw message