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 protocol.c
Date Tue, 20 Mar 2001 21:40:54 GMT
trawick     01/03/20 13:40:53

  Modified:    .        CHANGES
               server   protocol.c
  Log:
  Empty out the brigade shared by ap_getline()/ap_get_client_block()
  on error exit from ap_getline().  Some other code got upset because
  the wrong data was in the brigade.
  
  Revision  Changes    Path
  1.139     +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.138
  retrieving revision 1.139
  diff -u -r1.138 -r1.139
  --- CHANGES	2001/03/19 21:54:54	1.138
  +++ CHANGES	2001/03/20 21:40:41	1.139
  @@ -1,5 +1,9 @@
   Changes with Apache 2.0.15-dev
   
  +  *) Empty out the brigade shared by ap_getline()/ap_get_client_block()
  +     on error exit from ap_getline().  Some other code got upset because
  +     the wrong data was in the brigade.  [Greg Ames, Jeff Trawick]
  +
     *) Handle ap_discard_request_body() being called more than once.
        [Greg Ames, Jeff Trawick]
   
  
  
  
  1.9       +15 -6     httpd-2.0/server/protocol.c
  
  Index: protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- protocol.c	2001/03/19 21:54:56	1.8
  +++ protocol.c	2001/03/20 21:40:50	1.9
  @@ -519,8 +519,12 @@
   
       while (1) {
           if (APR_BRIGADE_EMPTY(b)) {
  -            if (ap_get_brigade(c->input_filters, b, AP_MODE_BLOCKING) != APR_SUCCESS
||
  +            if ((retval = ap_get_brigade(c->input_filters, b, AP_MODE_BLOCKING)) !=
APR_SUCCESS ||
                   APR_BRIGADE_EMPTY(b)) {
  +                apr_brigade_destroy(b);
  +                if (retval != APR_EOF && retval != APR_TIMEUP) {
  +                    ap_log_rerror(APLOG_MARK, APLOG_ERR, retval, r, "ap_get_brigade() failed");
  +                }
                   return -1;
               }
           }
  @@ -530,10 +534,15 @@
               continue;
           }
           retval = apr_bucket_read(e, &temp, &length, APR_BLOCK_READ);
  -
           if (retval != APR_SUCCESS) {
  -            total = ((length < 0) && (total == 0)) ? -1 : total;
  -            break;
  +            apr_brigade_destroy(b);
  +            ap_log_rerror(APLOG_MARK, APLOG_ERR, retval, r, "apr_bucket_read() failed");
  +            if (total) {
  +                break; /* report previously-read data to caller, do ap_xlate_proto_to_ascii()
*/
  +            }
  +            else {
  +                return -1;
  +            }
           }
   
           if ((looking_ahead) && (*temp != APR_ASCII_BLANK) && (*temp !=
APR_ASCII_TAB)) { 
  @@ -552,12 +561,12 @@
           else {
               /* input line was larger than the caller's buffer */
               apr_brigade_destroy(b); 
  -            
  +
               /* don't need to worry about req_cfg->bb being bogus.
                * the request is about to die, and ErrorDocument
                * redirects get a new req_cfg->bb
                */
  -            
  +
               return -1;
           }
           
  
  
  

Mime
View raw message