You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by jo...@apache.org on 2004/04/16 18:37:55 UTC

cvs commit: httpd-apreq-2/src apreq_env.c

joes        2004/04/16 09:37:55

  Modified:    glue/perl/xsbuilder/Apache/Request Apache__Request.h
                        Request_pod
               src      apreq_env.c
  Log:
  Fix ->config
  
  Revision  Changes    Path
  1.24      +18 -5     httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Apache__Request.h
  
  Index: Apache__Request.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Apache__Request.h,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Apache__Request.h	13 Apr 2004 21:46:38 -0000	1.23
  +++ Apache__Request.h	16 Apr 2004 16:37:55 -0000	1.24
  @@ -176,7 +176,7 @@
       dXSARGS;
       apreq_request_t *req;
       apr_status_t status = APR_SUCCESS;
  -    /* int j = 1; */
  +    int j;
       if (items == 0)
           XSRETURN_UNDEF;
       if (!SvROK(ST(0)))
  @@ -184,17 +184,30 @@
   
       req = apreq_xs_sv2(request,ST(0));
   
  -    XSRETURN_UNDEF; /* XXX fixme (apreq_request_config is now gone)
  -
       for (j = 1; j + 1 < items; j += 2) {
           STRLEN alen, vlen;
           const char *attr = SvPVbyte(ST(j),alen), 
                       *val = SvPVbyte(ST(j+1),vlen);
  -        status = apreq_request_config(req, attr, alen, val, vlen); 
  +
  +        if (strcasecmp(attr,"POST_MAX")== 0
  +            || strcasecmp(attr, "MAX_BODY") == 0) 
  +        {
  +            status = apreq_env_max_body(req->env,(apr_off_t)apreq_atoi64f(val));
  +        }
  +        else if (strcasecmp(attr, "TEMP_DIR") == 0) {
  +            apreq_env_temp_dir(req->env, val);
  +        }
  +        else if (strcasecmp(attr, "MAX_BRIGADE") == 0) {
  +            apreq_env_max_brigade(req->env, (apr_ssize_t)apreq_atoi64f(val));
  +        }
  +        else {
  +            Perl_warn(aTHX_ "Apache::Request::config: "
  +                      "Unrecognized attribute %s", attr);
  +        }
  +
           if (status != APR_SUCCESS)
               break;
       }
  -*/
       XSRETURN_IV(status);
   }
   
  
  
  
  1.8       +2 -2      httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Request_pod
  
  Index: Request_pod
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Request_pod,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Request_pod	15 Jan 2004 05:05:56 -0000	1.7
  +++ Request_pod	16 Apr 2004 16:37:55 -0000	1.8
  @@ -43,11 +43,11 @@
   
   =over 4
   
  -=item POST_MAX
  +=item POST_MAX, MAX_BODY
   
   Limit the size of POST data (in bytes).
   
  -=item DISABLE_UPLOADS
  +=item DISABLE_UPLOADS [TODO]
   
   Disable file uploads.
   
  
  
  
  1.6       +4 -0      httpd-apreq-2/src/apreq_env.c
  
  Index: apreq_env.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_env.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- apreq_env.c	24 Mar 2004 08:22:48 -0000	1.5
  +++ apreq_env.c	16 Apr 2004 16:37:55 -0000	1.6
  @@ -91,6 +91,10 @@
   
   APREQ_DECLARE(const char *) apreq_env_temp_dir(void *env, const char *path)
   {
  +    if (path != NULL)
  +        /* ensure path is a valid pointer during the entire request */
  +        path = apr_pstrdup(apreq_env_pool(env),path);
  +
       return apreq_env->temp_dir(env,path);
   }