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/07/15 15:15:13 UTC

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

joes        2003/07/15 06:15:12

  Modified:    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_pod
               src      apreq_params.c apreq_params.h apreq_parsers.c
  Log:
  Drop param->charset from apreq_params.h
  
  Revision  Changes    Path
  1.15      +10 -4     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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- apreq_xs_postperl.h	13 Jul 2003 05:03:49 -0000	1.14
  +++ apreq_xs_postperl.h	15 Jul 2003 13:15:10 -0000	1.15
  @@ -256,8 +256,8 @@
       class = SvPV_nolen(ST(0));                                          \
       env = (void *)SvIVX(SvRV(ST(1)));                                   \
       pool = apreq_env_pool(env);                                         \
  -    key = SvPV(ST(2), klen);                                            \
  -    val = SvPV(ST(3), vlen);                                            \
  +    key = SvPVbyte(ST(2), klen);                                        \
  +    val = SvPVbyte(ST(3), vlen);                                        \
       t = apreq_make_##type(pool, key, klen, val, vlen);                  \
                                                                           \
       ST(0) = sv_2mortal(apreq_xs_##type##2sv(t,class));                  \
  @@ -390,7 +390,10 @@
       if (items != 1)
           Perl_croak(aTHX_ "Usage: encode($string)");
   
  -    src = SvPV(ST(0), slen);
  +    src = SvPVbyte(ST(0), slen);
  +    if (src == NULL)
  +        XSRETURN_UNDEF;
  +
       ST(0) = sv_newmortal();
       SvUPGRADE(ST(0), SVt_PV);
       SvGROW(ST(0), 3 * slen + 1);
  @@ -409,7 +412,10 @@
       if (items != 1)
           Perl_croak(aTHX_ "Usage: decode($string)");
   
  -    src = SvPV(ST(0), slen);
  +    src = SvPVbyte(ST(0), slen);
  +    if (src == NULL)
  +        XSRETURN_UNDEF;
  +
       ST(0) = sv_newmortal();
       SvUPGRADE(ST(0), SVt_PV);
       SvGROW(ST(0), slen + 1);
  
  
  
  1.14      +2 -1      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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Apache__Cookie.h	1 Jul 2003 19:03:49 -0000	1.13
  +++ Apache__Cookie.h	15 Jul 2003 13:15:10 -0000	1.14
  @@ -158,7 +158,8 @@
   
       for (j = 1; j + 1 < items; j += 2) {
           STRLEN alen, vlen;
  -        const char *attr = SvPV(ST(j),alen), *val = SvPV(ST(j+1),vlen);
  +        const char *attr = SvPVbyte(ST(j),alen), 
  +                    *val = SvPVbyte(ST(j+1),vlen);
           status = apreq_cookie_attr(p, c, attr, alen, val, vlen); 
           if (status != APR_SUCCESS)
               break;
  
  
  
  1.10      +3 -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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Cookie_pm	13 Jul 2003 17:54:59 -0000	1.9
  +++ Cookie_pm	15 Jul 2003 13:15:10 -0000	1.10
  @@ -53,9 +53,10 @@
       }
   }
   
  -sub value {
  +sub thaw {
       my $self = shift;
  -    return $self->thaw if $self->can("thaw");
       my @rv = map decode($_), split /&/, $self->raw_value;
       return wantarray ? @rv : $rv[0];
   }
  +
  +sub value { shift->thaw }
  
  
  
  1.15      +4 -12     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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Apache__Request.h	11 Jul 2003 23:16:58 -0000	1.14
  +++ Apache__Request.h	15 Jul 2003 13:15:10 -0000	1.15
  @@ -55,17 +55,7 @@
   
   #define apreq_xs_param2rv(ptr, class) apreq_xs_2sv(ptr,class)
   #define apreq_xs_rv2param(sv) ((apreq_param_t *)SvIVX(SvRV(sv)))
  -
  -
  -APR_INLINE static SV *apreq_xs_param2sv(const apreq_param_t *param, 
  -                                        const char *class)
  -{
  -    SV *sv = newSVpvn(param->v.data, param->v.size);
  -    if (param->charset == UTF_8)
  -        SvUTF8_on(sv);
  -
  -    return sv;
  -}
  +#define apreq_xs_param2sv(ptr,class) newSVpvn((ptr)->v.data,(ptr)->v.size)
   
   APREQ_XS_DEFINE_ENV(request);
   APREQ_XS_DEFINE_OBJECT(request);
  @@ -127,6 +117,7 @@
   
   /* Upload API */
   /* supercede earlier function definition */
  +#undef apreq_xs_param2sv
   #define apreq_xs_param2sv(param,class) apreq_xs_param2rv(param,class)
   #define apreq_xs_sv2param(sv) apreq_xs_rv2param(sv)
   
  @@ -196,7 +187,8 @@
   
       for (j = 1; j + 1 < items; j += 2) {
           STRLEN alen, vlen;
  -        const char *attr = SvPV(ST(j),alen), *val = SvPV(ST(j+1),vlen);
  +        const char *attr = SvPVbyte(ST(j),alen), 
  +                    *val = SvPVbyte(ST(j+1),vlen);
           status = apreq_request_config(req, attr, alen, val, vlen); 
           if (status != APR_SUCCESS)
               break;
  
  
  
  1.2       +7 -7      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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Request_pod	29 Jun 2003 23:42:30 -0000	1.1
  +++ Request_pod	15 Jul 2003 13:15:10 -0000	1.2
  @@ -49,7 +49,7 @@
   
   =over 4
   
  -=item POST_MAX [OK]
  +=item POST_MAX
   
   Limit the size of POST data (in bytes).  I<Apache::Request::parse> will 
   return an error code if the size is exceeded:
  @@ -63,7 +63,7 @@
        return $status;
    }
   
  -=item DISABLE_UPLOADS [OK]
  +=item DISABLE_UPLOADS
   
   Disable file uploads.  I<Apache::Request::parse> will return an
   error code if a file upload is attempted:
  @@ -77,7 +77,7 @@
        return $status;
    }
   
  -=item TEMP_DIR [OK]
  +=item TEMP_DIR
   
   Sets the directory where upload files are spooled.  On a *nix-like
   that supports link(2), the TEMP_DIR should be located on the same
  @@ -112,7 +112,7 @@
   
   =back
   
  -=head2 instance [DEPRECATED]
  +=head2 instance [DEPRECATED, same as C<new>]
   
   The instance() class method allows Apache::Request to be a singleton.
   This means that whenever you call Apache::Request->instance() within a
  @@ -275,13 +275,13 @@
   
   =over 4
   
  -=head2 name [OK]
  +=head2 name
   
   The name of the filefield parameter:
   
       my $name = $upload->name;
   
  -=head2 filename [OK]
  +=head2 filename
   
   The filename of the uploaded file:
   
  @@ -346,7 +346,7 @@
   debugging purposes, and is possibly subject to change in a future
   version of Apache::Request.
   
  -=head2 link [OK]
  +=head2 link
   
   To avoid recopying the spool file on a *nix-like system,
   I<link> will create a hard link to it:
  
  
  
  1.31      +0 -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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- apreq_params.c	9 Jul 2003 15:55:02 -0000	1.30
  +++ apreq_params.c	15 Jul 2003 13:15:11 -0000	1.31
  @@ -80,7 +80,6 @@
   {
       apreq_param_t *param = apr_palloc(p, nlen + vlen + 1 + sizeof *param);
       apreq_value_t *v = &param->v;
  -    param->charset = APREQ_CHARSET;
       param->info = NULL;
       param->bb = NULL;
   
  @@ -191,7 +190,6 @@
           return NULL;
   
       param = apr_palloc(pool, nlen + vlen + 1 + sizeof *param);
  -    param->charset = ASCII;     /* XXX: UTF_8 */
       param->info = NULL;
       param->bb = NULL;
   
  
  
  
  1.25      +0 -3      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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- apreq_params.h	30 Jun 2003 20:42:14 -0000	1.24
  +++ apreq_params.h	15 Jul 2003 13:15:11 -0000	1.25
  @@ -77,12 +77,9 @@
    * @{
    */
   
  -#define APREQ_CHARSET  UTF_8;
   
   /** Common data structure for params and file uploads */
   typedef struct apreq_param_t {
  -    enum { ASCII, UTF_8, UTF_16, ISO_LATIN_1 } charset; /**< Not sure this
  -                                                         * field is needed */
       apr_table_t         *info; /**< header table associated with the param */
       apr_bucket_brigade  *bb;   /**< brigade to spool upload files */
       apreq_value_t        v;    /**< underlying name/value/status info */
  
  
  
  1.32      +0 -2      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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- apreq_parsers.c	9 Jul 2003 22:07:05 -0000	1.31
  +++ apreq_parsers.c	15 Jul 2003 13:15:12 -0000	1.32
  @@ -179,7 +179,6 @@
   
       param->bb = NULL;
       param->info = NULL;
  -    param->charset = UTF_8;
   
       v->name = v->data + vlen + 1;
   
  @@ -1004,7 +1003,6 @@
                   }
                   len = off;
                   param = apr_palloc(pool, len + sizeof *param);
  -                param->charset = APREQ_CHARSET;
                   param->bb = NULL;
                   param->info = ctx->info;