httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: httpd-2.0/modules/proxy proxy_util.c
Date Thu, 03 Jan 2002 19:20:54 GMT
stoddard    02/01/03 11:20:54

  Modified:    modules/http http_protocol.c
               modules/proxy proxy_util.c
  Log:
  Fix seg fault in HTTP_IN when trying to handle the LimitRequestBody
  directive when reading a proxy response. We should bypass LimitRequestBody
  activities when handling a response from the proxied server.
  
  I don't think this will circumvent requestbody checking on a large request
  coming into the server that is destined to be proxied. (not tested though).
  
  Revision  Changes    Path
  1.384     +17 -4     httpd-2.0/modules/http/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_protocol.c,v
  retrieving revision 1.383
  retrieving revision 1.384
  diff -u -r1.383 -r1.384
  --- http_protocol.c	2 Jan 2002 07:56:24 -0000	1.383
  +++ http_protocol.c	3 Jan 2002 19:20:54 -0000	1.384
  @@ -519,9 +519,11 @@
       } state;
   } http_ctx_t;
   
  -/* This is the input filter for HTTP requests.  It handles chunked and
  - * content-length bodies.  This can only be inserted/used after the headers
  - * are successfully parsed. */
  +/* This is the HTTP_INPUT filter for HTTP requests and responses from 
  + * proxied servers (mod_proxy).  It handles chunked and content-length 
  + * bodies.  This can only be inserted/used after the headers
  + * are successfully parsed. 
  + */
   apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
                               ap_input_mode_t mode, apr_off_t *readbytes)
   {
  @@ -540,7 +542,18 @@
           ctx->state = BODY_NONE;
           ctx->remaining = 0;
           ctx->limit_used = 0;
  -        ctx->limit = ap_get_limit_req_body(f->r);
  +
  +        /* LimitRequestBody does not apply to proxied responses.
  +         * Consider implementing this check in its own filter. 
  +         * Would adding a directive to limit the size of proxied 
  +         * responses be useful?
  +         */
  +        if (!f->r->proxyreq) {
  +            ctx->limit = ap_get_limit_req_body(f->r);
  +        }
  +        else {
  +            ctx->limit = 0;
  +        }
   
           tenc = apr_table_get(f->r->headers_in, "Transfer-Encoding");
           lenp = apr_table_get(f->r->headers_in, "Content-Length");
  
  
  
  1.77      +1 -0      httpd-2.0/modules/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_util.c,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- proxy_util.c	2 Jan 2002 19:12:40 -0000	1.76
  +++ proxy_util.c	3 Jan 2002 19:20:54 -0000	1.77
  @@ -374,6 +374,7 @@
       rp->notes           = apr_table_make(c->pool, 5);
   
       rp->server = r->server;
  +    rp->proxyreq = r->proxyreq;
       rp->request_time = r->request_time;
       rp->connection      = c;
       rp->output_filters  = c->output_filters;
  
  
  

Mime
View raw message