Return-Path: Delivered-To: apmail-httpd-apreq-cvs-archive@www.apache.org Received: (qmail 92580 invoked from network); 22 Feb 2005 06:27:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 22 Feb 2005 06:27:44 -0000 Received: (qmail 13087 invoked by uid 500); 22 Feb 2005 06:27:34 -0000 Delivered-To: apmail-httpd-apreq-cvs-archive@httpd.apache.org Received: (qmail 12999 invoked by uid 500); 22 Feb 2005 06:27:34 -0000 Mailing-List: contact apreq-cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: apreq-dev@httpd.apache.org List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list apreq-cvs@httpd.apache.org Received: (qmail 12951 invoked by uid 99); 22 Feb 2005 06:27:33 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 21 Feb 2005 22:27:31 -0800 Received: (qmail 92508 invoked by uid 65534); 22 Feb 2005 06:27:30 -0000 Message-ID: <20050222062730.92506.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Tue, 22 Feb 2005 06:27:30 -0000 Subject: svn commit: r154800 - in httpd/apreq/branches/multi-env-unstable: glue/perl/lib/Apache/ glue/perl/t/apreq/ glue/perl/xsbuilder/ glue/perl/xsbuilder/APR/Request/ glue/perl/xsbuilder/APR/Request/Param/ include/ library/ module/ module/apache2/ To: apreq-cvs@httpd.apache.org From: joes@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: joes Date: Mon Feb 21 22:27:27 2005 New Revision: 154800 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D154800 Log: Get the glue/perl/t/apreq/big_input tests passing again on *nix. Also reorder apreq_params arguments to match OO pattern. Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/lib/Apache/Request.pm httpd/apreq/branches/multi-env-unstable/glue/perl/t/apreq/big_input.t httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /Param/Param.xs httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /Request.xs httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/apreq_xs_po= stperl.h httpd/apreq/branches/multi-env-unstable/include/apreq_module.h httpd/apreq/branches/multi-env-unstable/library/module.c httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c httpd/apreq/branches/multi-env-unstable/module/apache2/handle.c httpd/apreq/branches/multi-env-unstable/module/test_cgi.c Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/lib/Apache/Requ= est.pm URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= glue/perl/lib/Apache/Request.pm?view=3Ddiff&r1=3D154799&r2=3D154800 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/apreq/branches/multi-env-unstable/glue/perl/lib/Apache/Request.pm= (original) +++ httpd/apreq/branches/multi-env-unstable/glue/perl/lib/Apache/Request.pm= Mon Feb 21 22:27:27 2005 @@ -3,6 +3,19 @@ use Apache::RequestRec; push our @ISA, qw/Apache::RequestRec APR::Request::Apache2/; =20 +sub param { + return &APR::Request::args, &APR::Request::body + if wantarray; + + my ($req, $key) =3D @_; + + return APR::Request::params($req, $req->pool) + if @_ =3D=3D 1; + + return APR::Request::param($req, $key); +} + + package Apache::Upload; use APR::Request::Param; push our @ISA, qw/APR::Request::Param/; Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/t/apreq/big_inp= ut.t URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= glue/perl/t/apreq/big_input.t?view=3Ddiff&r1=3D154799&r2=3D154800 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/apreq/branches/multi-env-unstable/glue/perl/t/apreq/big_input.t (= original) +++ httpd/apreq/branches/multi-env-unstable/glue/perl/t/apreq/big_input.t M= on Feb 21 22:27:27 2005 @@ -18,7 +18,7 @@ my @big_key_num =3D (5, 15, 25); my @big_keys =3D ('a'..'z'); =20 -plan tests =3D> @key_len * @key_num + @big_key_len * @big_key_num, under_c= onstruction; +plan tests =3D> @key_len * @key_num + @big_key_len * @big_key_num, have_lw= p; =20 =20 # GET Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/R= equest/Param/Param.xs URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= glue/perl/xsbuilder/APR/Request/Param/Param.xs?view=3Ddiff&r1=3D154799&r2= =3D154800 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /Param/Param.xs (original) +++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /Param/Param.xs Mon Feb 21 22:27:27 2005 @@ -38,7 +38,7 @@ IV iv; =20 if (items =3D=3D 0 || items > 2 || !SvROK(ST(0)) - || !sv_derived_from(ST(0), "APR::Request")) + || !sv_derived_from(ST(0), HANDLE_CLASS)) Perl_croak(aTHX_ "Usage: APR::Request::args($req [,$name])"); =20 sv =3D ST(0); @@ -80,7 +80,7 @@ XSRETURN_EMPTY; =20 d.pkg =3D PARAM_CLASS; - d.parent =3D SvRV(obj); + d.parent =3D obj; =20 switch (GIMME_V) { =20 @@ -114,12 +114,12 @@ IV iv; =20 if (items =3D=3D 0 || items > 2 || !SvROK(ST(0)) - || !sv_derived_from(ST(0), "APR::Request")) + || !sv_derived_from(ST(0),HANDLE_CLASS)) Perl_croak(aTHX_ "Usage: APR::Request::body($req [,$name])"); =20 sv =3D ST(0); obj =3D apreq_xs_sv2object(aTHX_ sv, HANDLE_CLASS, 'r'); - iv =3D SvIVX(SvRV(obj)); + iv =3D SvIVX(obj); req =3D INT2PTR(apreq_handle_t *, iv); =20 =20 @@ -156,7 +156,7 @@ XSRETURN_EMPTY; =20 d.pkg =3D PARAM_CLASS; - d.parent =3D SvRV(obj); + d.parent =3D obj; =20 switch (GIMME_V) { =20 @@ -403,3 +403,52 @@ =20 OUTPUT: RETVAL + +MODULE =3D APR::Request::Param PACKAGE =3D APR::Request + +SV* +param(handle, key) + SV *handle + char *key + PREINIT: + SV *obj; + IV iv; + apreq_handle_t *req; + apreq_param_t *param; + + CODE: + obj =3D apreq_xs_sv2object(aTHX_ handle, HANDLE_CLASS, 'r'); + iv =3D SvIVX(obj); + req =3D INT2PTR(apreq_handle_t *, iv); + param =3D apreq_param(req, key); + + if (param =3D=3D NULL) + RETVAL =3D &PL_sv_undef; + else + RETVAL =3D apreq_xs_param2sv(aTHX_ param, PARAM_CLASS, obj); + + + OUTPUT: + RETVAL + +SV * +params(handle, pool) + SV *handle + APR::Pool pool + PREINIT: + SV *obj; + IV iv; + apreq_handle_t *req; + apr_table_t *t; + + CODE: + obj =3D apreq_xs_sv2object(aTHX_ handle, HANDLE_CLASS, 'r'); + iv =3D SvIVX(obj); + req =3D INT2PTR(apreq_handle_t *, iv); + t =3D apreq_params(req, pool); + RETVAL =3D apreq_xs_table2sv(aTHX_ t, TABLE_CLASS, obj,=20 + PARAM_CLASS, sizeof(PARAM_CLASS)-1); + + OUTPUT: + RETVAL + =20 Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/R= equest/Request.xs URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= glue/perl/xsbuilder/APR/Request/Request.xs?view=3Ddiff&r1=3D154799&r2=3D154= 800 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /Request.xs (original) +++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /Request.xs Mon Feb 21 22:27:27 2005 @@ -28,6 +28,8 @@ PUTBACK; } =20 + + MODULE =3D APR::Request PACKAGE =3D APR::Request =20 SV* Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/apreq= _xs_postperl.h URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= glue/perl/xsbuilder/apreq_xs_postperl.h?view=3Ddiff&r1=3D154799&r2=3D154800 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/apreq_xs_po= stperl.h (original) +++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/apreq_xs_po= stperl.h Mon Feb 21 22:27:27 2005 @@ -365,7 +365,7 @@ #define APREQ_XS_THROW_ERROR(attr, status, func, errpkg) do { \ if (!sv_derived_from(sv, errpkg)) { \ HV *hv =3D newHV(); \ - SV *rv =3D newRV_inc(SvRV(obj)); \ + SV *rv =3D newRV_inc(obj); \ sv_setsv(*hv_fetch(hv, "_" #attr, 2, 1), sv_2mortal(rv)); \ apreq_xs_croak(aTHX_ hv, status, func, errpkg); \ } \ Modified: httpd/apreq/branches/multi-env-unstable/include/apreq_module.h URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= include/apreq_module.h?view=3Ddiff&r1=3D154799&r2=3D154800 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/apreq/branches/multi-env-unstable/include/apreq_module.h (origina= l) +++ httpd/apreq/branches/multi-env-unstable/include/apreq_module.h Mon Feb = 21 22:27:27 2005 @@ -77,7 +77,8 @@ case APR_INCOMPLETE: case APR_EINIT: case APREQ_ERROR_NODATA: - + case APREQ_ERROR_NOPARSER: + case APREQ_ERROR_NOHEADER: return 0; default: return 1; @@ -353,8 +354,7 @@ APREQ_DECLARE(unsigned)apreq_ua_cookie_version(apreq_handle_t *req); =20 =20 -APREQ_DECLARE(apreq_param_t *)apreq_param(apreq_handle_t *env,=20 - const char *name); +APREQ_DECLARE(apreq_param_t *)apreq_param(apreq_handle_t *req, const char = *key); =20 #define apreq_cookie(req, name) apreq_jar_get(req, name) =20 @@ -365,12 +365,10 @@ * @req * @remark Also parses the request if necessary. */ -APREQ_DECLARE(apr_table_t *) apreq_params(apr_pool_t *p, - apreq_handle_t *req); +APREQ_DECLARE(apr_table_t *) apreq_params(apreq_handle_t *req, apr_pool_t = *p); =20 =20 -APREQ_DECLARE(apr_table_t *)apreq_cookies(apr_pool_t *p, - apreq_handle_t *req); +APREQ_DECLARE(apr_table_t *)apreq_cookies(apreq_handle_t *req, apr_pool_t = *p); =20 /** * Force a complete parse. Modified: httpd/apreq/branches/multi-env-unstable/library/module.c URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= library/module.c?view=3Ddiff&r1=3D154799&r2=3D154800 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/apreq/branches/multi-env-unstable/library/module.c (original) +++ httpd/apreq/branches/multi-env-unstable/library/module.c Mon Feb 21 22:= 27:27 2005 @@ -88,30 +88,28 @@ } =20 =20 -APREQ_DECLARE(apreq_param_t *)apreq_param(apreq_handle_t *env,=20 - const char *name) +APREQ_DECLARE(apreq_param_t *)apreq_param(apreq_handle_t *req, const char = *key) { - apreq_param_t *param =3D apreq_args_get(env, name); + apreq_param_t *param =3D apreq_args_get(req, key); if (param =3D=3D NULL) - return apreq_body_get(env, name); + return apreq_body_get(req, key); else return param; } =20 =20 -APREQ_DECLARE(apr_table_t *)apreq_params(apr_pool_t *pool, - apreq_handle_t *env) +APREQ_DECLARE(apr_table_t *)apreq_params(apreq_handle_t *req, apr_pool_t *= p) { const apr_table_t *args, *body; =20 - if (apreq_args(env, &args) =3D=3D APR_SUCCESS) - if (apreq_body(env, &body) =3D=3D APR_SUCCESS) - return apr_table_overlay(pool, args, body); + if (apreq_args(req, &args) =3D=3D APR_SUCCESS) + if (apreq_body(req, &body) =3D=3D APR_SUCCESS) + return apr_table_overlay(p, args, body); else - return apr_table_copy(pool, args); + return apr_table_copy(p, args); else - if (apreq_body(env, &body) =3D=3D APR_SUCCESS) - return apr_table_copy(pool, body); + if (apreq_body(req, &body) =3D=3D APR_SUCCESS) + return apr_table_copy(p, body); else return NULL; =20 Modified: httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= module/apache2/filter.c?view=3Ddiff&r1=3D154799&r2=3D154800 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c (origin= al) +++ httpd/apreq/branches/multi-env-unstable/module/apache2/filter.c Mon Feb= 21 22:27:27 2005 @@ -243,7 +243,7 @@ } } else { - ctx->status =3D APREQ_ERROR_NOPARSER; + ctx->status =3D APREQ_ERROR_NOHEADER; return; } } Modified: httpd/apreq/branches/multi-env-unstable/module/apache2/handle.c URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= module/apache2/handle.c?view=3Ddiff&r1=3D154799&r2=3D154800 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/apreq/branches/multi-env-unstable/module/apache2/handle.c (origin= al) +++ httpd/apreq/branches/multi-env-unstable/module/apache2/handle.c Mon Feb= 21 22:27:27 2005 @@ -128,9 +128,9 @@ return APR_SUCCESS; } =20 -static apr_status_t apache2_body(apreq_handle_t *env, const apr_table_t **= t) +static apr_status_t apache2_body(apreq_handle_t *req, const apr_table_t **= t) { - ap_filter_t *f =3D get_apreq_filter(env); + ap_filter_t *f =3D get_apreq_filter(req); struct filter_ctx *ctx; =20 if (f->ctx =3D=3D NULL) Modified: httpd/apreq/branches/multi-env-unstable/module/test_cgi.c URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= module/test_cgi.c?view=3Ddiff&r1=3D154799&r2=3D154800 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/apreq/branches/multi-env-unstable/module/test_cgi.c (original) +++ httpd/apreq/branches/multi-env-unstable/module/test_cgi.c Mon Feb 21 22= :27:27 2005 @@ -116,7 +116,7 @@ } =20 else {=20 - const apr_table_t *params =3D apreq_params(pool, req); + const apr_table_t *params =3D apreq_params(req, pool); int count =3D 0; apr_file_printf(out, "%s", "Content-Type: text/plain\n\n"); =20