dougm       00/09/27 12:44:24

  Modified:    .        Changes ToDo
               src/modules/perl Apache.xs
  Log:
  fix $r->read() so it will not block if all data has already been read
  and so that Apache will not hang during ap_discard_request_body() on
  error or redirect after all data has been read
  
  Revision  Changes    Path
  1.529     +4 -0      modperl/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.528
  retrieving revision 1.529
  diff -u -r1.528 -r1.529
  --- Changes   2000/09/27 17:55:21     1.528
  +++ Changes   2000/09/27 19:44:20     1.529
  @@ -10,6 +10,10 @@
   
   =item 1.24_01-dev
   
  +fix $r->read() so it will not block if all data has already been read
  +and so that Apache will not hang during ap_discard_request_body() on
  +error or redirect after all data has been read
  +
   fix for Makefile.PL ADD_MODULE=src/module/foo/libfoo.a
   [Nelson Oliveira <[EMAIL PROTECTED]>]
   
  
  
  
  1.255     +0 -4      modperl/ToDo
  
  Index: ToDo
  ===================================================================
  RCS file: /home/cvs/modperl/ToDo,v
  retrieving revision 1.254
  retrieving revision 1.255
  diff -u -r1.254 -r1.255
  --- ToDo      2000/09/27 18:19:13     1.254
  +++ ToDo      2000/09/27 19:44:20     1.255
  @@ -65,10 +65,6 @@
   
   - Apache::PerlRun::flush_namespace should be re-written in c
   
  -- should $r->content unset $r->headers_in('content-length') ?
  -NOTE: im worried this could break apps who need to know content-length 
  -after data has been read
  -
   - syswrite/WRITE
   
   - Jeffrey W. Baker's Apache::Util::escape_html() replacement
  
  
  
  1.110     +12 -7     modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===================================================================
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.109
  retrieving revision 1.110
  diff -u -r1.109 -r1.110
  --- Apache.xs 2000/09/27 16:25:56     1.109
  +++ Apache.xs 2000/09/27 19:44:23     1.110
  @@ -954,22 +954,27 @@
       int      bufsiz
   
       PREINIT:
  -    long nrd = 0;
  +    long nrd = 0, old_read_length;
       int rc;
   
       PPCODE:
  -    if ((rc = setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK) {
  -     aplog_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r->server, 
  -                 "mod_perl: setup_client_block failed: %d", rc);
  -     XSRETURN_UNDEF;
  +    if (!r->read_length) {
  +        if ((rc = setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK) {
  +            aplog_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r->server, 
  +                        "mod_perl: setup_client_block failed: %d", rc);
  +            XSRETURN_UNDEF;
  +        }
       }
   
  +    old_read_length = r->read_length;
  +    r->read_length = 0;
  +
       if (should_client_block(r)) {
           SvUPGRADE(buffer, SVt_PV);
           SvGROW(buffer, bufsiz+1);
           nrd = get_client_block(r, SvPVX(buffer), bufsiz);
  -        r->read_length = 0;
  -    } 
  +    }
  +    r->read_length += old_read_length;
   
       if (nrd > 0) {
           XPUSHs(sv_2mortal(newSViv((long)nrd)));
  
  
  

Reply via email to