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 2003/04/23 09:00:33 UTC

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

joes        2003/04/23 00:00:33

  Modified:    env      mod_apreq.c
               src      apreq_params.c
  Log:
  Return default parser initialization to apreq_request().
  
  Revision  Changes    Path
  1.9       +1 -8      httpd-apreq-2/env/mod_apreq.c
  
  Index: mod_apreq.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/env/mod_apreq.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mod_apreq.c	23 Apr 2003 06:48:57 -0000	1.8
  +++ mod_apreq.c	23 Apr 2003 07:00:32 -0000	1.9
  @@ -204,14 +204,7 @@
           if (ctx->bb_parse == NULL)
               ctx->bb_parse = apr_brigade_create(r->pool, f->c->bucket_alloc);
           if (ctx->req == NULL) {
  -            apreq_parser_t *parser;
  -            ctx->req = apreq_request(r, NULL);
  -            parser = apreq_make_parser(r->pool, APREQ_URL_ENCTYPE,
  -                                       apreq_parse_urlencoded, NULL, ctx->req);
  -            apreq_register_parser(ctx->req, parser);
  -            parser = apreq_make_parser(r->pool, APREQ_MFD_ENCTYPE,
  -                                       apreq_parse_multipart, NULL, ctx->req);
  -            apreq_register_parser(ctx->req, parser);
  +            ctx->req = apreq_request(r, r->args);
           }
           apreq_log(APREQ_DEBUG 0, r, "filter initialized");
       }
  
  
  
  1.13      +15 -2     httpd-apreq-2/src/apreq_params.c
  
  Index: apreq_params.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_params.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- apreq_params.c	22 Apr 2003 21:00:13 -0000	1.12
  +++ apreq_params.c	23 Apr 2003 07:00:33 -0000	1.13
  @@ -57,6 +57,7 @@
    */
   
   #include "apreq_params.h"
  +#include "apreq_parsers.h"
   #include "apreq_env.h"
   #include "apr_strings.h"
   
  @@ -106,6 +107,7 @@
   APREQ_DECLARE(apreq_request_t *) apreq_request(void *ctx, const char *args)
   {
       apreq_request_t *req;
  +    apreq_parser_t *parser;
       apr_status_t s;
   
       if (args == NULL) {
  @@ -128,7 +130,12 @@
           req->body     = NULL;
           req->v.name = enctype(p, apreq_env_content_type(ctx));
           /* XXX need to install copy/merge callbacks for apreq_param_t */
  -
  +        parser = apreq_make_parser(p, APREQ_URL_ENCTYPE,
  +                                   apreq_parse_urlencoded, NULL, req);
  +        apreq_register_parser(req, parser);
  +        parser = apreq_make_parser(p, APREQ_MFD_ENCTYPE,
  +                                   apreq_parse_multipart, NULL, req);
  +        apreq_register_parser(req, parser);
   
           /* XXX get/set race condition here wrt apreq_env_request? */
           old_req = apreq_env_request(ctx, req);
  @@ -150,7 +157,13 @@
           req->args     = apreq_make_table(p, APREQ_NELTS);
           req->body     = NULL;
           req->v.name = enctype(p, apreq_env_content_type(ctx));
  -        /* XXX need to install copy/merge callbacks for apreq_param_t */
  +        /* XXX need to install copy/merge callbacks for apreq_param_t */ 
  +        parser = apreq_make_parser(p, APREQ_URL_ENCTYPE,
  +                                   apreq_parse_urlencoded, NULL, req);
  +        apreq_register_parser(req, parser);
  +        parser = apreq_make_parser(p, APREQ_MFD_ENCTYPE,
  +                                   apreq_parse_multipart, NULL, req);
  +        apreq_register_parser(req, parser);
       }
   
       s = (args == NULL) ? APR_SUCCESS :