[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apreq-cvs
Subject:    cvs commit: httpd-apreq-2/src apreq_params.c apreq_params.h apreq_parsers.c apreq_parsers.h
From:       joes () apache ! org
Date:       2003-06-24 22:27:45
[Download RAW message or body]

joes        2003/06/24 15:27:44

  Modified:    glue/perl/t/apreq request.t
               glue/perl/t/response/TestApReq request.pm
               glue/perl/xsbuilder apreq_xs_postperl.h
               glue/perl/xsbuilder/Apache/Cookie Apache__Cookie.h Cookie_pm
               glue/perl/xsbuilder/Apache/Request Apache__Request.h
                        Request_pm
               glue/perl/xsbuilder/maps apreq_functions.map
                        apreq_structures.map apreq_types.map
               src      apreq_params.c apreq_params.h apreq_parsers.c
                        apreq_parsers.h
  Log:
  Drop const qualifier from apreq_upload return value.  Still futzing with \
apreq_xs_postperl.h and friends. The good news is that the upload test in \
glue/perl/t/apreq/request.t should pass now.  
  Revision  Changes    Path
  1.4       +1 -1      httpd-apreq-2/glue/perl/t/apreq/request.t
  
  Index: request.t
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/apreq/request.t,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- request.t	17 Jun 2003 11:33:43 -0000	1.3
  +++ request.t	24 Jun 2003 22:27:43 -0000	1.4
  @@ -6,7 +6,7 @@
   use Apache::TestUtil;
   use Apache::TestRequest qw(GET_BODY UPLOAD_BODY);
   
  -plan tests => 2, todo => [2];
  +plan tests => 2;
   
   my $location = "/TestApReq__request";
   #print GET_BODY $location;
  
  
  
  1.3       +26 -15    httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm
  
  Index: request.pm
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- request.pm	13 Jun 2003 09:46:52 -0000	1.2
  +++ request.pm	24 Jun 2003 22:27:44 -0000	1.3
  @@ -9,28 +9,39 @@
   
   sub handler {
       my $r = shift;
  -    my $apr = Apache::Request->new($r);
  +    my $req = Apache::Request->new($r);
   
  -    $r->content_type('text/plain');
  +    $req->content_type('text/plain');
   
  -    my $test  = $apr->param('test');
  -    my $value = $apr->param('value');
  +    my $test  = $req->param('test');
  +    my $value = $req->param('value');
   
  -#   return DECLINED unless defined $test;
  +    my $f = $r->input_filters;
  +    my $method = $r->method;
  +    my $bb = APR::Brigade->new($r->pool,
  +                               $r->connection->bucket_alloc);
  +    my $len = 0;
  +
  +    # ~ $apr->parse ???
  +    if ($method eq "POST") {
  +        do {
  +            $bb->destroy;
  +            $f->get_brigade($bb, 0, 0, 8000);
  +        } while $bb->last && !$bb->last->is_eos;
  +    }
   
       if ($test eq 'param') {
  -        $r->print($value);
  +        $req->print($value);
       }
       elsif ($test eq 'upload') {
  -        return -1;
  -        my $upload = $apr->upload;
  -        my $fh = $upload->fh;
  -        local $/;
  -        my $data = <$fh>;
  -        $r->print($data);
  -    } 
  -    else {
  -
  +        my ($upload) = values %{$req->upload};
  +        $bb = $upload->bb;
  +        my $b = $bb->first;
  +        while ($b = $bb->first) {
  +            $b->read(my $buffer);
  +            $r->print($buffer);
  +            $b->remove;
  +        }
       }
   
       return 0;
  
  
  
  1.10      +55 -51    httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_postperl.h
  
  Index: apreq_xs_postperl.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_postperl.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- apreq_xs_postperl.h	15 Jun 2003 10:33:00 -0000	1.9
  +++ apreq_xs_postperl.h	24 Jun 2003 22:27:44 -0000	1.10
  @@ -125,7 +125,7 @@
   #define apreq_xs_sv2env(type,sv) apreq_xs_perl2env(sv,#type)
   
   /** Converts apreq_env to a Perl package, which forms the
  - * base class for Apache::Request and Apache::Jar objects.
  + * base class for Apache::Request and Apache::Cookie::Jar objects.
    */
   #define APREQ_XS_DEFINE_ENV(type)                       \
   APR_INLINE                                              \
  @@ -209,6 +209,10 @@
       XSRETURN(1);                                                        \
   }  
   
  +
  +/* TABLE_GET */
  +
  +
   struct apreq_xs_do_arg {
       void            *env;
       PerlInterpreter *perl;
  @@ -230,66 +234,88 @@
       return 1;
   }
   
  +#define apreq_xs_sv2table(sv)      ((apr_table_t *) SvIVX(SvRV(sv)))
  +#define apreq_xs_table2sv(t,class) apreq_xs_table_c2perl(aTHX_ t, env, class)
  +#define apreq_xs_do(attr)          (items == 1 ? apreq_xs_table_keys \
  +                                   : apreq_xs_##attr##_table_values)
  +
  +#define apreq_xs_push(attr,sv,d,key) do {                               \
  +     apr_table_t *t = apreq_xs_##attr##_sv2table(sv);                   \
  +     if (t)                                                             \
  +         apr_table_do(apreq_xs_do(attr), &d, t, key, NULL);             \
  +} while (0)
  +
  +/** 
  + * @param attr       obj/attribute name.
  + * @param class      perl class the attribute is in (usually a table class).
  + * @param type       apreq data type: param or cookie.
  + * @param subclass   perl class for returned "type2sv" scalars.
  + * @param COND       expression that must be true for RETVAL to be added
  + *                   to the return list.
  + *
  + * @remark
  + * Requires macros for controlling behavior in context:
  + *
  + *             apreq_xs_##attr##_push           G_ARRAY
  + *             apreq_xs_##attr##_sv2table       G_SCALAR (items==1)
  + *             apreq_xs_##attr##_##type         G_SCALAR (items==2)
  + *             apreq_xs_##type##2sv             G_ARRAY and G_SCALAR
  + *
  + */
   
  -#define apreq_table_t apr_table_t
  -#define apreq_xs_table_sv2table(sv) apreq_xs_sv2(table,sv)
  -
  -/** requires definition of type##2sv macro */
  -
  -#define APREQ_XS_DEFINE_GET(type, subtype, subclass)                    \
  -static int apreq_xs_##type##_table_values(void *data, const char *key,  \
  -                                          const char *val)              \
  +#define APREQ_XS_DEFINE_GET(attr, class, type, subclass, COND)          \
  +static int apreq_xs_##attr##_table_values(void *data, const char *key,  \
  +                                                      const char *val)  \
   {                                                                       \
       struct apreq_xs_do_arg *d = (struct apreq_xs_do_arg *)data;         \
       void *env = d->env;                                                 \
       dTHXa(d->perl);                                                     \
       dSP;                                                                \
  -    if (val)                                                            \
  -        XPUSHs(sv_2mortal(apreq_xs_##subtype##2sv(                      \
  -            apreq_value_to_##subtype(apreq_strtoval(val)), subclass))); \
  -    else                                                                \
  +    if (val) {                                                          \
  +        apreq_##type##_t *RETVAL =                                      \
  +                          apreq_value_to_##type(apreq_strtoval(val));   \
  +        if (COND)                                                       \
  +            XPUSHs(sv_2mortal(apreq_xs_##type##2sv(RETVAL,class)));     \
  +    } else                                                              \
           XPUSHs(&PL_sv_undef);                                           \
                                                                           \
       PUTBACK;                                                            \
       return 1;                                                           \
   }                                                                       \
  -static XS(apreq_xs_##type##_table_get)                                  \
  +static XS(apreq_xs_##attr##_get)                                        \
   {                                                                       \
       dXSARGS;                                                            \
       const char *key = NULL;                                             \
                                                                           \
       if (items == 1 || items == 2) {                                     \
  -        apr_table_t *t  = apreq_xs_##type##_sv2table(ST(0));            \
  -        void *env = apreq_xs_sv2env(type, ST(0));                       \
  +        void *env = apreq_xs_sv2env(attr, ST(0));                       \
           struct apreq_xs_do_arg d = { env, aTHX };                       \
  -                                                                        \
  +        apreq_##type##_t *RETVAL;                                       \
           if (items == 2)                                                 \
               key = SvPV_nolen(ST(1));                                    \
                                                                           \
  -        if (t == NULL)                                                  \
  -            Perl_croak(aTHX_ "usage: $table->get($key)");               \
  -                                                                        \
           switch (GIMME_V) {                                              \
  -            const char *val;                                            \
  +            apreq_##type##_t *RETVAL;                                   \
                                                                           \
           case G_ARRAY:                                                   \
               XSprePUSH;                                                  \
               PUTBACK;                                                    \
  -            apr_table_do(items == 1 ? apreq_xs_table_keys :             \
  -                apreq_xs_##type##_table_values, &d, t, key, NULL);      \
  +            apreq_xs_##attr##_push(ST(0), d, key);                      \
               break;                                                      \
                                                                           \
           case G_SCALAR:                                                  \
               if (items == 1) {                                           \
  -               ST(0) = sv_2mortal(apreq_xs_table2sv(t));                \
  -               XSRETURN(1);                                             \
  +                apr_table_t *t = apreq_xs_##attr##_sv2table(ST(0));     \
  +                if (t == NULL)                                          \
  +                    XSRETURN_UNDEF;                                     \
  +                ST(0) = sv_2mortal(apreq_xs_table2sv(t,class));         \
  +                XSRETURN(1);                                            \
               }                                                           \
                                                                           \
  -            val = apr_table_get(t, key);                                \
  -            if (val == NULL)                                            \
  +            RETVAL = apreq_xs_##attr##_##type(ST(0), key);              \
  +            if (!RETVAL  || !(COND))                                    \
                   XSRETURN_UNDEF;                                         \
  -            ST(0) = sv_2mortal(apreq_xs_##subtype##2sv(                 \
  -              apreq_value_to_##subtype(apreq_strtoval(val)),subclass)); \
  +            ST(0) = sv_2mortal(apreq_xs_##type##2sv(RETVAL,subclass));  \
               XSRETURN(1);                                                \
                                                                           \
           default:                                                        \
  @@ -298,28 +324,6 @@
       }                                                                   \
       else                                                                \
   	Perl_croak(aTHX_ "Usage: $table->get($key)");                   \
  -}
  -
  -/* requires type##2env & type##2##subtype macros */
  -
  -#define APREQ_XS_DEFINE_TABLE(type, subtype)                            \
  -static XS(apreq_xs_##type##_##subtype)                                  \
  -{                                                                       \
  -    dXSARGS;                                                            \
  -    apreq_##type##_t *obj;                                              \
  -    apr_table_t *t;                                                     \
  -    void *env;                                                          \
  -    SV *sv;                                                             \
  -                                                                        \
  -    if (items != 1)                                                     \
  -        Perl_croak(aTHX_ "Usage: " #type "->" #subtype "()");           \
  -                                                                        \
  -    sv = ST(0);                                                         \
  -    obj = apreq_xs_sv2(type, sv);                                       \
  -    env = apreq_xs_sv2env(type, sv);                                    \
  -    t   = apreq_xs_##type##2##subtype(obj);                             \
  -    ST(0) = sv_2mortal(apreq_xs_table2sv(t));                           \
  -    XSRETURN(1);                                                        \
   }
   
   /** @} */
  
  
  
  1.7       +18 -12    \
httpd-apreq-2/glue/perl/xsbuilder/Apache/Cookie/Apache__Cookie.h  
  Index: Apache__Cookie.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/Apache/Cookie/Apache__Cookie.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Apache__Cookie.h	15 Jun 2003 10:33:00 -0000	1.6
  +++ Apache__Cookie.h	24 Jun 2003 22:27:44 -0000	1.7
  @@ -1,24 +1,30 @@
  -#define apreq_xs_jar_sv2table(sv) (apreq_xs_sv2(jar, sv)->cookies)
  -#define apreq_xs_jar2cookies(j) j->cookies
  +#define apreq_xs_jar2cookie(j) j->cookies
   #define apreq_xs_jar2env(j) j->env
   
  -#define apreq_xs_table2sv(t) apreq_xs_table_c2perl(aTHX_ t, env, \
  -                                                   "Apache::Cookie::Table")
   #define apreq_xs_cookie2sv(c,class) apreq_xs_2sv(c,class)
  +//#define apreq_xs_jar2sv(j,class) apreq_xs_
   
   APREQ_XS_DEFINE_ENV(cookie);
   APREQ_XS_DEFINE_ENV(jar);
  -
  -/* jar */
  -
  +APREQ_XS_DEFINE_MAKE(cookie);
   APREQ_XS_DEFINE_OBJECT(jar);
  -APREQ_XS_DEFINE_TABLE(jar, cookies);
  -APREQ_XS_DEFINE_GET(jar, cookie, "Apache::Cookie");
   
  -/* cookie */
  +/* GET macros */
  +#define S2C(s)  apreq_value_to_cookie(apreq_strtoval(s))
  +#define apreq_xs_jar_push(sv,d,key)   apreq_xs_push(jar,sv,d,key)
  +#define apreq_xs_table_push(sv,d,key) apreq_xs_push(table,sv,d,key)
  +#define apreq_xs_jar_sv2table(sv) (apreq_xs_sv2(jar, sv)->cookies)
  +#define apreq_xs_table_sv2table(sv) apreq_xs_sv2table(sv)
  +#define apreq_xs_jar_cookie(sv,k) \
  +                S2C(apr_table_get(apreq_xs_jar_sv2table(sv),k))
  +#define apreq_xs_table_cookie(sv,k) \
  +                S2C(apr_table_get(apreq_xs_table_sv2table(sv),k))
   
  -APREQ_XS_DEFINE_MAKE(cookie);
  -APREQ_XS_DEFINE_GET(table, cookie, "Apache::Cookie");
  +#define TABLE_PKG   "Apache::Cookie::Table"
  +#define COOKIE_PKG  "Apache::Cookie"
  +
  +APREQ_XS_DEFINE_GET(jar,   TABLE_PKG, cookie, COOKIE_PKG, 1);
  +APREQ_XS_DEFINE_GET(table, TABLE_PKG, cookie, COOKIE_PKG, 1);
   
   
   static XS(apreq_xs_cookie_as_string)
  
  
  
  1.7       +2 -2      httpd-apreq-2/glue/perl/xsbuilder/Apache/Cookie/Cookie_pm
  
  Index: Cookie_pm
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/Apache/Cookie/Cookie_pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Cookie_pm	15 Jun 2003 10:33:00 -0000	1.6
  +++ Cookie_pm	24 Jun 2003 22:27:44 -0000	1.7
  @@ -34,9 +34,9 @@
   sub fetch {
       my $self = shift;
       my $jar = $self->jar(@_);
  -    Dump($jar->cookies);
  +    Dump(scalar $jar->cookie);
       Dump($jar->get("apache"));
  -    return wantarray ? %{$jar->cookies} : $jar->cookies;
  +    return wantarray ? %{scalar $jar->cookie} : $jar->cookie;
   }
   
   sub freeze {
  
  
  
  1.8       +58 -86    \
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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Apache__Request.h	15 Jun 2003 10:33:00 -0000	1.7
  +++ Apache__Request.h	24 Jun 2003 22:27:44 -0000	1.8
  @@ -1,10 +1,6 @@
  -#define apreq_xs_request2env(r) r->env
  -#define apreq_xs_request2args(r) r->args
  -#define apreq_xs_request2body(r) r->body
  -#define apreq_xs_request2params(r) apreq_params(apreq_env_pool(env),r)
  -#define apreq_xs_param2rv(ptr) sv_setref_pv(newSV(0), "Apache::Upload", ptr)
  +#define apreq_xs_param2rv(ptr, class) sv_setref_pv(newSV(0), class, ptr)
   #define apreq_xs_rv2param(sv) ((apreq_param_t *)SvIVX(SvRV(sv)))
  -#define apreq_xs_table2sv(t) apreq_xs_2sv(t,"Apache::Request::Table")
  +
   
   APR_INLINE static SV *apreq_xs_param2sv(const apreq_param_t *param, 
                                           const char *class)
  @@ -18,86 +14,62 @@
   
   APREQ_XS_DEFINE_ENV(request);
   APREQ_XS_DEFINE_OBJECT(request);
  -
   APREQ_XS_DEFINE_MAKE(param);
   
  -APREQ_XS_DEFINE_TABLE(request, args);
  -APREQ_XS_DEFINE_TABLE(request, body);
  -APREQ_XS_DEFINE_TABLE(request, params);
  -
  -APREQ_XS_DEFINE_GET(table, param, NULL);
  -
  -static int apreq_xs_param_table_values(void *data, const char *key,
  -                                       const char *val)
  -{
  -    struct apreq_xs_do_arg *d = (struct apreq_xs_do_arg *)data;
  -    void *env = d->env;
  -    dTHXa(d->perl);
  -    dSP;
  -    if (val)
  -        XPUSHs(sv_2mortal(apreq_xs_param2sv(apreq_value_to_param(
  -                                       apreq_strtoval(val)),NULL)));
  -
  -    else
  -        XPUSHs(&PL_sv_undef);
  -
  -    PUTBACK;
  -    return 1;
  -}
  -
  -
  -#ifdef apreq_xs_table_do
  -#undef apreq_xs_table_do
  -#endif
  -
  -#define apreq_xs_table_do (items == 1 ? apreq_xs_table_keys \
  -                                      : apreq_xs_param_table_values)
  +/* Too many GET macros :-( */
   
  -static XS(apreq_xs_param)
  -{
  -    dXSARGS;
  -    const char *key = NULL;
  -
  -    if (items == 1 || items == 2) {
  -        SV *sv = ST(0);
  -        apreq_request_t *req = apreq_xs_sv2(request,sv);
  -        void *env = req->env;
  -        struct apreq_xs_do_arg d = { env, aTHX };
  -
  -        if (items == 2)
  -            key = SvPV_nolen(ST(1));
  -
  -        if (req == NULL)
  -            Perl_croak(aTHX_ "Usage: $req->param($key)");
  -
  -        switch (GIMME_V) {
  -            const apreq_param_t *param;
  -
  -        case G_ARRAY:
  -            XSprePUSH;
  -            PUTBACK;
  -            apr_table_do(apreq_xs_table_do, &d, req->args, key, NULL);
  -            if (req->body)
  -                apr_table_do(apreq_xs_table_do,&d,req->body,key,NULL);
  -
  -            break;
  -
  -        case G_SCALAR:
  -            if (items == 1) {
  -                ST(0) = sv_2mortal(apreq_xs_table2sv(
  -                                   apreq_params(apreq_env_pool(env), req)));
  -                XSRETURN(1);
  -            }
  -            param = apreq_param(req, key);
  -            if (param == NULL)
  -                XSRETURN_UNDEF;
  -            ST(0) = sv_2mortal(apreq_xs_param2sv(param,NULL));
  -            XSRETURN(1);
  -
  -        default:
  -            XSRETURN(0);
  -        }
  -    }
  -    else
  -	Perl_croak(aTHX_ "Usage: $req->param($key)");
  -}
  +#define S2P(s) apreq_value_to_param(apreq_strtoval(s))
  +#define apreq_xs_request_push(sv,d,key) do {                            \
  +    apreq_request_t *req = apreq_xs_sv2(request,sv);                    \
  +    apr_table_do(apreq_xs_do(request), &d, req->args, key, NULL);       \
  +    if (req->body)                                                      \
  +        apr_table_do(apreq_xs_do(request), &d, req->body, key, NULL);   \
  +} while (0)
  +#define apreq_xs_args_push(sv,d,k) apreq_xs_push(args,sv,d,k)
  +#define apreq_xs_body_push(sv,d,k) apreq_xs_push(body,sv,d,k)
  +#define apreq_xs_table_push(sv,d,k) apreq_xs_push(table,sv,d,k)
  +#define apreq_xs_upload_push(sv,d,key) do {                             \
  +    apr_table_t *t = apreq_xs_body_sv2table(sv);                        \
  +    if (t)                                                              \
  +        apr_table_do(apreq_xs_do(upload), &d, t, key, NULL);            \
  +} while (0)
  +
  +#define apreq_xs_upload_table_push(sv,d,k) apreq_xs_push(upload_table,sv,d,k)
  +
  +#define apreq_xs_request_sv2table(sv) apreq_params(apreq_env_pool(env), \
  +                                                   apreq_xs_sv2(request,sv))
  +#define apreq_xs_args_sv2table(sv) apreq_xs_sv2(request,sv)->args
  +#define apreq_xs_body_sv2table(sv) apreq_xs_sv2(request,sv)->body
  +#define apreq_xs_table_sv2table(sv) apreq_xs_sv2table(sv)
  +#define apreq_xs_upload_sv2table(sv) apreq_uploads(apreq_env_pool(env), \
  +                                                   apreq_xs_sv2(request,sv))
  +#define apreq_xs_upload_table_sv2table(sv) apreq_xs_sv2table(sv)
  +
  +#define apreq_xs_request_param(sv,k) apreq_param(apreq_xs_sv2(request,sv),k)
  +#define apreq_xs_args_param(sv,k) \
  +                     S2P(apr_table_get(apreq_xs_args_sv2table(sv),k))
  +#define apreq_xs_body_param(sv,k) \
  +                     S2P(apr_table_get(apreq_xs_body_sv2table(sv),k))
  +#define apreq_xs_table_param(sv,k) \
  +                     S2P(apr_table_get(apreq_xs_sv2table(sv),k))
  +#define apreq_xs_upload_param(sv,k) apreq_upload(apreq_xs_sv2(request,sv),k)
  +#define apreq_xs_upload_table_param(sv,k) \
  +                     S2P(apr_table_get(apreq_xs_sv2table(sv),k))
  +
  +#define PARAM_TABLE   "Apache::Request::Table"
  +
  +APREQ_XS_DEFINE_GET(request, PARAM_TABLE, param, NULL, 1);
  +APREQ_XS_DEFINE_GET(args,    PARAM_TABLE, param, NULL, 1);
  +APREQ_XS_DEFINE_GET(body,    PARAM_TABLE, param, NULL, 1);
  +APREQ_XS_DEFINE_GET(table,   PARAM_TABLE, param, NULL, 1);
  +
  +/* Upload API */
  +/* supercede earlier function definition */
  +#define apreq_xs_param2sv(param,class) apreq_xs_param2rv(param,class)
  +#define apreq_xs_sv2param(sv) apreq_xs_rv2param(sv)
  +
  +
  +#define UPLOAD_TABLE  "Apache::Upload::Table"
  +#define UPLOAD_PKG    "Apache::Upload"
  +APREQ_XS_DEFINE_GET(upload, UPLOAD_TABLE, param, UPLOAD_PKG, RETVAL->bb);
  +APREQ_XS_DEFINE_GET(upload_table, UPLOAD_TABLE, param, UPLOAD_PKG, 1);
  
  
  
  1.6       +3 -0      httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Request_pm
  
  Index: Request_pm
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Request_pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Request_pm	10 Jun 2003 10:50:31 -0000	1.5
  +++ Request_pm	24 Jun 2003 22:27:44 -0000	1.6
  @@ -4,6 +4,9 @@
   use APR;
   use APR::Table;
   
  +package Apache::Upload::Table;
  +use base 'APR::Table';
  +
   package Apache::Request::Table;
   use base 'APR::Table';
   
  
  
  
  1.8       +18 -8     httpd-apreq-2/glue/perl/xsbuilder/maps/apreq_functions.map
  
  Index: apreq_functions.map
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/maps/apreq_functions.map,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- apreq_functions.map	17 Jun 2003 11:23:09 -0000	1.7
  +++ apreq_functions.map	24 Jun 2003 22:27:44 -0000	1.8
  @@ -4,14 +4,25 @@
    apreq_request | apreq_xs_request | const char *:class, void *:env, const char \
*:qs=NULL  apreq_parse_request
    apreq_params
  - apreq_param | apreq_xs_param |
  + apreq_param | apreq_xs_request_get |
   
   MODULE=Apache::Request PACKAGE=Apache::Request
    DEFINE_env     | apreq_xs_request_env |
  + DEFINE_args    | apreq_xs_args_get |
  + DEFINE_body    | apreq_xs_body_get |
  + DEFINE_upload  | apreq_xs_upload_get |
   
   MODULE=Apache::Request PACKAGE=Apache::Request::Table \
                PREFIX=Apache__Request__Table_
  - DEFINE_get     | apreq_xs_table_table_get |
  - DEFINE_FETCH   | apreq_xs_table_table_get |
  + DEFINE_get     | apreq_xs_table_get |
  + DEFINE_FETCH   | apreq_xs_table_get |
  +
  +MODULE=Apache::Request PACKAGE=Apache::Upload PREFIX=Apache__Upload_
  +apr_bucket_brigade *:DEFINE_bb  | apreq_param_brigade(apreq_xs_sv2(param,sv))  | \
SV *:sv  +apr_table_t *:DEFINE_info | apreq_param_info(apreq_xs_sv2(param,sv)) | SV \
*:sv  +
  +MODULE=Apache::Request PACKAGE=Apache::Upload::Table PREFIX=Apache__Upload__Table_
  + DEFINE_get     | apreq_xs_upload_table_get |
  + DEFINE_FETCH   | apreq_xs_upload_table_get |
   
   MODULE=Apache::Cookie PACKAGE=Apache::Cookie
   # DEFINE_jar        | apreq_xs_jar | 
  @@ -28,13 +39,12 @@
   MODULE=Apache::Cookie PACKAGE=Apache::Cookie::Jar PREFIX=Apache__Cookie__Jar_
    DEFINE_new        | apreq_xs_jar           |
    DEFINE_env        | apreq_xs_jar_env       |
  - DEFINE_cookie     | apreq_xs_jar_table_get |
  - DEFINE_get        | apreq_xs_jar_table_get |
  - DEFINE_cookies    | apreq_xs_jar_cookies   |
  + DEFINE_cookie     | apreq_xs_jar_get |
  + DEFINE_get        | apreq_xs_jar_get |
   
   MODULE=Apache::Cookie PACKAGE=Apache::Cookie::Table PREFIX=Apache__Cookie__Table_
  - DEFINE_get        | apreq_xs_table_table_get |
  - DEFINE_FETCH      | apreq_xs_table_table_get |
  + DEFINE_get        | apreq_xs_table_get |
  + DEFINE_FETCH      | apreq_xs_table_get |
   
   
   MODULE=Apache::Request PACKAGE=Apache::Request::Util PREFIX=apreq_
  
  
  
  1.4       +4 -5      httpd-apreq-2/glue/perl/xsbuilder/maps/apreq_structures.map
  
  Index: apreq_structures.map
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/maps/apreq_structures.map,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apreq_structures.map	7 Jun 2003 19:57:43 -0000	1.3
  +++ apreq_structures.map	24 Jun 2003 22:27:44 -0000	1.4
  @@ -14,13 +14,12 @@
   #   data[1]
   #</apreq_value_t>
   
  -<apreq_param_t MODULE=Apache::Request>
  +!<apreq_param_t MODULE=Apache::Request>
   !  charset
  -!  language
  -   info
  -   bb
  +!   info
  +!   bb
   !   v
  -</apreq_param_t>
  +!</apreq_param_t>
   
   <apreq_request_t MODULE=Apache::Request>
   !   args
  
  
  
  1.4       +2 -2      httpd-apreq-2/glue/perl/xsbuilder/maps/apreq_types.map
  
  Index: apreq_types.map
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/maps/apreq_types.map,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apreq_types.map	7 Jun 2003 19:57:43 -0000	1.3
  +++ apreq_types.map	24 Jun 2003 22:27:44 -0000	1.4
  @@ -12,7 +12,7 @@
   #struct apr_hash_t           | APR::Hash
   #apr_hash_index_t            | APR::HashIndex
   
  -struct apreq_param_t        | Apache::Request::Param    | T_APREQ_PARAM
  +struct apreq_param_t        | Apache::Upload
   struct apreq_request_t      | Apache::Request           | T_APREQ_REQUEST
   struct apreq_jar_t          | Apache::Cookie::Jar       | T_APREQ_JAR
  -struct apreq_cookie_t       | Apache::Cookie            | T_APREQ_COOKIE
  +struct apreq_cookie_t       | Apache::Cookie
  
  
  
  1.20      +6 -4      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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- apreq_params.c	22 Jun 2003 15:34:43 -0000	1.19
  +++ apreq_params.c	24 Jun 2003 22:27:44 -0000	1.20
  @@ -108,6 +108,7 @@
           req->cfg      = NULL;
           req->body     = NULL;
           req->parser   = apreq_parser(env, NULL);
  +        req->pool     = p;
   
           /* XXX need to install copy/merge callbacks for apreq_param_t */
   
  @@ -129,6 +130,7 @@
           req->cfg      = NULL;
           req->body     = NULL;
           req->parser   = apreq_parser(env, NULL);
  +        req->pool     = p;
           /* XXX need to install copy/merge callbacks for apreq_param_t */ 
       }
   
  @@ -319,7 +321,7 @@
   static int upload_get(void *data, const char *key, const char *val)
   {
       const apreq_param_t *p = apreq_value_to_param(apreq_strtoval(val));
  -    const apreq_param_t **q = data;
  +    apreq_param_t **q = data;
       if (p->bb) {
           *q = p;
           return 1; /* upload found, stop */
  @@ -328,10 +330,10 @@
           return 0; /* keep searching */
   }
   
  -APREQ_DECLARE(const apreq_param_t *) apreq_upload(const apreq_request_t *req,
  -                                                  const char *key)
  +APREQ_DECLARE(apreq_param_t *) apreq_upload(const apreq_request_t *req,
  +                                            const char *key)
   {
  -    const apreq_param_t *param = NULL;
  +    apreq_param_t *param = NULL;
       if (req->body == NULL)
           return NULL;
       apr_table_do(upload_get, &param, req->body, key, NULL);
  
  
  
  1.18      +5 -2      httpd-apreq-2/src/apreq_params.h
  
  Index: apreq_params.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_params.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- apreq_params.h	22 Jun 2003 15:34:43 -0000	1.17
  +++ apreq_params.h	24 Jun 2003 22:27:44 -0000	1.18
  @@ -89,6 +89,8 @@
   #define apreq_value_to_param(ptr) apreq_attr_to_type(apreq_param_t, v, ptr)
   #define apreq_param_name(p)  ((p)->v.name)
   #define apreq_param_value(p) ((p)->v.data)
  +#define apreq_param_brigade(p)((p)->bb)
  +#define apreq_param_info(p) ((p)->info)
   
   APREQ_DECLARE(apreq_param_t *) apreq_make_param(apr_pool_t *p, 
                                                   const char *name, 
  @@ -102,6 +104,7 @@
       apr_table_t        *body;         /* post data */
       apreq_parser_t     *parser;
       apreq_cfg_t        *cfg;
  +    apr_pool_t         *pool;
       void               *env;
   } apreq_request_t;
   
  @@ -181,8 +184,8 @@
   APREQ_DECLARE(apr_table_t *) apreq_uploads(apr_pool_t *pool,
                                              const apreq_request_t *req);
   
  -APREQ_DECLARE(const apreq_param_t *) apreq_upload(const apreq_request_t *req,
  -                                                  const char *key);
  +APREQ_DECLARE(apreq_param_t *) apreq_upload(const apreq_request_t *req,
  +                                            const char *key);
   
   
   
  
  
  
  1.27      +4 -14     httpd-apreq-2/src/apreq_parsers.c
  
  Index: apreq_parsers.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_parsers.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- apreq_parsers.c	22 Jun 2003 16:44:20 -0000	1.26
  +++ apreq_parsers.c	24 Jun 2003 22:27:44 -0000	1.27
  @@ -739,21 +739,11 @@
               return rc;
       }
       else {
  -        int tries = 100;
  -        char *tmp;
  -           
  -        /* XXX: this should hopefully be replace with currently
  -         * non-existing apr_tmp_dir_get() */
  -        while (--tries > 0) {
  -            if ( (tmp = tempnam(NULL, "apreq")) == NULL ) {
  -                continue;
  -            }
  -            path = apr_pstrcat(pool, tmp, "XXXXXX", NULL);
  -            free(tmp);
  -            break;               
  -        }
  -        if (path == NULL)
  +        char *tmp = tempnam(NULL, "apreq");
  +        if (tmp == NULL)
               return APR_EGENERAL;
  +        path = apr_pstrcat(pool, tmp, "XXXXXX", NULL);
  +        free(tmp);
       }
       
       return apr_file_mktemp(fp, path, 
  
  
  
  1.15      +1 -0      httpd-apreq-2/src/apreq_parsers.h
  
  Index: apreq_parsers.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_parsers.h,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- apreq_parsers.h	22 Jun 2003 15:34:43 -0000	1.14
  +++ apreq_parsers.h	24 Jun 2003 22:27:44 -0000	1.15
  @@ -4,6 +4,7 @@
   #include "apreq.h"
   #include "apr_tables.h"
   #include "apr_buckets.h"
  +#include "apr_file_io.h"
   
   #ifdef  __cplusplus
   extern "C" {
  
  
  


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic