httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <...@sunstarsys.com>
Subject Re: libapreq 0.32 ready yet?
Date Mon, 18 Jun 2001 18:57:04 GMT
Jim Winstead <jimw@trainedmonkey.com> writes:

> On Mon, Jun 18, 2001 at 11:28:49AM -0700, Doug MacEachern wrote:
> > On Mon, 18 Jun 2001, Jim Winstead wrote:
> >  
> > > but are you sure it worked before? i don't see any code in 0.31 to
> > > actually implement the POST_MAX handling.
> > 
> > % grep -i post_max Request/Request.xs
> >             if (strcaseEQ(key, "post_max")) {
> >                 RETVAL->post_max = (int)SvIV(ST(i+1));
> 
> d'oh! you'd think i would have looked for it in lowercase. :)
> 
> it looks to me like this code only gets used for regular post data,
> and not file uploads. it looks to me like this was true in 0.31, too.

Try 

  % grep --line-number --context=3 post_max c/apache_request.c
  78-     int rsize, len_read, rpos=0;
  79-     long length = r->remaining;
  80-
  81:     if (length > req->post_max && req->post_max > 0) {
  82-         ap_log_rerror(REQ_ERROR, "[libapreq] entity too large (%d, max=%d)",
  83:                       (int)length, req->post_max);
  84-         return HTTP_REQUEST_ENTITY_TOO_LARGE;
  85-     }
  86-
  --
  201-    req->status = OK;
  202-    req->parms = ap_make_table(r->pool, DEFAULT_TABLE_NELTS);
  203-    req->upload = NULL;
  204:    req->post_max = -1;
  205-    req->disable_uploads = 0;
  206-    req->upload_hook = NULL;
  207-    req->hook_data = NULL;
  --
  397-    return rc;
  398-    }
  399-
  400:    if ((length = r->remaining) > req->post_max && req->post_max
> 0) {
  401-    ap_log_rerror(REQ_ERROR, "[libapreq] entity too large (%d, max=%d)",
  402:                 (int)length, req->post_max);
  403-    return HTTP_REQUEST_ENTITY_TOO_LARGE;
  404-    }
  405-

The last set (lines 400-404) is for verifying multipart/form-data posts.
It's arguably a little silly, since r->remaining is always less than
(or equal to) the content length.

-- 
Joe Schaefer


Mime
View raw message