akosut      96/06/17 13:25:15

  Modified:    src       CHANGES mod_cgi.c
  Log:
  "This is at least meant to make Apache behave a little more sensibly
  when a script stops reading output early (or the pipe just gets
  jammed).  I believe this is the bug that Mark Weiser was raising hell
  about at www5..."
  
  Submitted by: Robert S. Thau
  
  Revision  Changes    Path
  1.31      +1 -0      apache/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -C3 -r1.30 -r1.31
  *** CHANGES   1996/06/17 20:17:01     1.30
  --- CHANGES   1996/06/17 20:25:12     1.31
  ***************
  *** 19,24 ****
  --- 19,25 ----
            a) more mod_proxy bugs
            b) early termination of inetd requests
            c) compile warnings on several systems
  +         d) problems when scripts stop reading output early
    
    Changes with Apache 1.1b3:
    
  
  
  
  1.9       +14 -1     apache/src/mod_cgi.c
  
  Index: mod_cgi.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/mod_cgi.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -C3 -r1.8 -r1.9
  *** mod_cgi.c 1996/05/22 17:35:38     1.8
  --- mod_cgi.c 1996/06/17 20:25:13     1.9
  ***************
  *** 308,315 ****
            len_read = read_client_block (r, argsbuffer, len_to_read);
            if (len_read == 0)
                break;
  !         fwrite (argsbuffer, 1, len_read, script_out);
            remaining -= len_read;
        }
        
        fflush (script_out);
  --- 308,328 ----
            len_read = read_client_block (r, argsbuffer, len_to_read);
            if (len_read == 0)
                break;
  !         if (fwrite (argsbuffer, 1, len_read, script_out) == 0)
  !             break;
            remaining -= len_read;
  +     }
  + 
  +     /* If script stopped reading early, soak up remaining stuff from
  +      * client...
  +      */
  +     
  +     while (remaining > 0) {
  +         int len_read, len_to_read = remaining;
  +         if (len_to_read > HUGE_STRING_LEN) len_to_read = HUGE_STRING_LEN;
  +         
  +         len_read = read_client_block (r, argsbuffer, len_to_read);
  +         if (len_read == 0) break;
        }
        
        fflush (script_out);
  
  
  

Reply via email to