httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Fri, 25 Oct 2002 15:18:53 GMT
trawick     2002/10/25 08:18:53

  Modified:    .        CHANGES
               server   core.c
  Log:
  Fix streaming output from an nph- CGI script.  CGI:IRC now
  works.
  
  core output filter needs to detect when no more data is available from
  a pipe for a while so that it can flush what is already there
  
  normally, content-length filter handles this but for nph- script
  we don't have content-length filter in place
  
  PR:             8482
  
  Revision  Changes    Path
  1.962     +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.961
  retrieving revision 1.962
  diff -u -r1.961 -r1.962
  --- CHANGES	25 Oct 2002 06:52:01 -0000	1.961
  +++ CHANGES	25 Oct 2002 15:18:53 -0000	1.962
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.44
   
  +  *) Fix streaming output from an nph- CGI script.  CGI:IRC now
  +     works.  PR 8482  [Jeff Trawick]
  +
     *) More accurate logging of bytes sent in mod_logio when
        the client terminates the connection before the response
        is completely sent  [Bojan Smojver <bojan@rexursive.com>]
  
  
  
  1.215     +11 -1     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.214
  retrieving revision 1.215
  diff -u -r1.214 -r1.215
  --- core.c	25 Oct 2002 06:52:01 -0000	1.214
  +++ core.c	25 Oct 2002 15:18:53 -0000	1.215
  @@ -3663,6 +3663,7 @@
       conn_rec *c = f->c;
       core_net_rec *net = f->ctx;
       core_output_filter_ctx_t *ctx = net->out_ctx;
  +    apr_read_type_e eblock = APR_NONBLOCK_READ;
   
       if (ctx == NULL) {
           ctx = apr_pcalloc(c->pool, sizeof(*ctx));
  @@ -3738,7 +3739,16 @@
                   const char *str;
                   apr_size_t n;
   
  -                rv = apr_bucket_read(e, &str, &n, APR_BLOCK_READ);
  +                rv = apr_bucket_read(e, &str, &n, eblock);
  +                if (APR_STATUS_IS_EAGAIN(rv)) {
  +                    /* send what we have so far since we shouldn't expect more
  +                     * output for a while...  next time we read, block
  +                     */
  +                    more = apr_brigade_split(b, e);
  +                    eblock = APR_BLOCK_READ;
  +                    break;
  +                }
  +                eblock = APR_NONBLOCK_READ;
                   if (n) {
                       if (!fd) {
                           if (nvec == MAX_IOVEC_TO_WRITE) {
  
  
  

Mime
View raw message