Return-Path: Delivered-To: apmail-httpd-apreq-cvs-archive@www.apache.org Received: (qmail 59948 invoked from network); 1 Mar 2005 01:20:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Mar 2005 01:20:21 -0000 Received: (qmail 99312 invoked by uid 500); 1 Mar 2005 01:20:20 -0000 Delivered-To: apmail-httpd-apreq-cvs-archive@httpd.apache.org Received: (qmail 99276 invoked by uid 500); 1 Mar 2005 01:20:20 -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 99262 invoked by uid 99); 1 Mar 2005 01:20:20 -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, 28 Feb 2005 17:20:19 -0800 Received: (qmail 59939 invoked by uid 65534); 1 Mar 2005 01:20:18 -0000 Message-ID: <20050301012018.59937.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, 01 Mar 2005 01:20:18 -0000 Subject: svn commit: r155725 - in httpd/apreq/branches/multi-env-unstable: ./ glue/perl/xsbuilder/ glue/perl/xsbuilder/APR/Request/Apache2/ glue/perl/xsbuilder/APR/Request/CGI/ glue/perl/xsbuilder/APR/Request/Cookie/ glue/perl/xsbuilder/APR/Request/Param/ include/ library/ library/t/ module/ 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 28 17:20:13 2005 New Revision: 155725 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D155725 Log: Replace v->size with v->nlen + v->dlen. Added supporting apreq_value_table_add(). Modified: httpd/apreq/branches/multi-env-unstable/CHANGES httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /Apache2/APR__Request__Apache2.h httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /CGI/APR__Request__CGI.h httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /Cookie/Cookie.xs httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /Param/Param.xs httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/apreq_xs_po= stperl.h httpd/apreq/branches/multi-env-unstable/include/apreq.h httpd/apreq/branches/multi-env-unstable/include/apreq_cookie.h httpd/apreq/branches/multi-env-unstable/include/apreq_param.h httpd/apreq/branches/multi-env-unstable/library/cookie.c httpd/apreq/branches/multi-env-unstable/library/param.c httpd/apreq/branches/multi-env-unstable/library/parser_header.c httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c httpd/apreq/branches/multi-env-unstable/library/t/params.c httpd/apreq/branches/multi-env-unstable/library/util.c httpd/apreq/branches/multi-env-unstable/module/test_cgi.c Modified: httpd/apreq/branches/multi-env-unstable/CHANGES URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= CHANGES?view=3Ddiff&r1=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/CHANGES (original) +++ httpd/apreq/branches/multi-env-unstable/CHANGES Mon Feb 28 17:20:13 2005 @@ -5,11 +5,8 @@ @section v2_05_dev Changes with libapreq2-2.05-dev =20 - C API [joes] - Change v->size semantics: now it represents the total - amount of memory appended to the apreq_value_t struct. - Added supporting apreq_param_nlen(), apreq_param_vlen(),=20 - apreq_param_size(), apreq_cookie_nlen(), apreq_cookie_vlen(),=20 - apreq_cookie_size(), apreq_value_table_add(). + Replace v->size with v->nlen + v->dlen. + Added supporting apreq_value_table_add(). =20 - C API [joes] Remove apreq_cookie_attr(). Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/R= equest/Apache2/APR__Request__Apache2.h URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= glue/perl/xsbuilder/APR/Request/Apache2/APR__Request__Apache2.h?view=3Ddiff= &r1=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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= /Apache2/APR__Request__Apache2.h (original) +++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /Apache2/APR__Request__Apache2.h Mon Feb 28 17:20:13 2005 @@ -82,7 +82,7 @@ dTHXa(d->perl); dSP; apreq_param_t *p =3D apreq_value_to_param(val); - SV *sv =3D newSVpvn(key, apreq_param_nlen(p)); + SV *sv =3D newSVpvn(key, p->v.nlen); if (apreq_param_is_tainted(p)) SvTAINTED_on(sv); =20 Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/R= equest/CGI/APR__Request__CGI.h URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= glue/perl/xsbuilder/APR/Request/CGI/APR__Request__CGI.h?view=3Ddiff&r1=3D15= 5724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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= /CGI/APR__Request__CGI.h (original) +++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /CGI/APR__Request__CGI.h Mon Feb 28 17:20:13 2005 @@ -79,7 +79,7 @@ dTHXa(d->perl); dSP; apreq_param_t *p =3D apreq_value_to_param(val); - SV *sv =3D newSVpvn(key, apreq_param_nlen(p)); + SV *sv =3D newSVpvn(key, p->v.nlen); if (apreq_param_is_tainted(p)) SvTAINTED_on(sv); =20 Modified: httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/R= equest/Cookie/Cookie.xs URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= glue/perl/xsbuilder/APR/Request/Cookie/Cookie.xs?view=3Ddiff&r1=3D155724&r2= =3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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= /Cookie/Cookie.xs (original) +++ httpd/apreq/branches/multi-env-unstable/glue/perl/xsbuilder/APR/Request= /Cookie/Cookie.xs Mon Feb 28 17:20:13 2005 @@ -7,7 +7,7 @@ dTHXa(d->perl); dSP; apreq_cookie_t *c =3D apreq_value_to_cookie(val); - SV *sv =3D newSVpv(key, 0); + SV *sv =3D newSVpvn(key, c->v.nlen); if (apreq_cookie_is_tainted(c)) SvTAINTED_on(sv); =20 @@ -217,7 +217,7 @@ /*nada*/ =20 CODE: - RETVAL =3D newSVpvn(obj->v.data, apreq_cookie_vlen(obj)); + RETVAL =3D newSVpvn(obj->v.data, obj->v.dlen); if (apreq_cookie_is_tainted(obj)) SvTAINTED_on(RETVAL); =20 @@ -247,7 +247,7 @@ APR::Request::Cookie obj =20 CODE: - RETVAL =3D newSVpvn(obj->v.name, apreq_cookie_nlen(obj)); + RETVAL =3D newSVpvn(obj->v.name, obj->v.nlen); if (apreq_cookie_is_tainted(obj)) SvTAINTED_on(RETVAL); =20 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=3D155724&r2= =3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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 28 17:20:13 2005 @@ -7,7 +7,7 @@ dTHXa(d->perl); dSP; apreq_param_t *p =3D apreq_value_to_param(val); - SV *sv =3D newSVpvn(key, apreq_param_nlen(p)); + SV *sv =3D newSVpvn(key, p->v.nlen); if (apreq_param_is_tainted(p)) SvTAINTED_on(sv); =20 @@ -296,7 +296,7 @@ /*nada*/ =20 CODE: - RETVAL =3D newSVpvn(obj->v.data, apreq_param_vlen(obj)); + RETVAL =3D newSVpvn(obj->v.data, obj->v.dlen); if (apreq_param_is_tainted(obj)) SvTAINTED_on(RETVAL); =20 @@ -326,7 +326,7 @@ APR::Request::Param obj =20 CODE: - RETVAL =3D newSVpvn(obj->v.name, apreq_param_nlen(obj)); + RETVAL =3D newSVpvn(obj->v.name, obj->v.nlen); if (apreq_param_is_tainted(obj)) SvTAINTED_on(RETVAL); =20 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=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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 28 17:20:13 2005 @@ -142,7 +142,7 @@ const char *class, SV *parent) { if (class =3D=3D NULL) { - SV *rv =3D newSVpvn(p->v.data, apreq_param_vlen(p)); + SV *rv =3D newSVpvn(p->v.data, p->v.dlen); if (apreq_param_is_tainted(p)) SvTAINTED_on(rv); /*XXX add charset fixups */ @@ -157,7 +157,7 @@ const char *class, SV *parent) { if (class =3D=3D NULL) { - SV *rv =3D newSVpvn(c->v.data, apreq_cookie_vlen(c)); + SV *rv =3D newSVpvn(c->v.data, c->v.dlen); if (apreq_cookie_is_tainted(c)) SvTAINTED_on(rv); /*XXX add charset fixups? */ Modified: httpd/apreq/branches/multi-env-unstable/include/apreq.h URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= include/apreq.h?view=3Ddiff&r1=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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.h (original) +++ httpd/apreq/branches/multi-env-unstable/include/apreq.h Mon Feb 28 17:2= 0:13 2005 @@ -92,15 +92,13 @@ /** @brief libapreq's pre-extensible string type */ typedef struct apreq_value_t { char *name; /**< value name */ - apr_size_t size; /**< total size (nlen + dlen + 1) */ + apr_size_t nlen; /**< length of name */ + apr_size_t dlen; /**< length of data */ char data[1]; /**< value data */ } apreq_value_t; =20 static APR_INLINE void apreq_value_table_add(const apreq_value_t *v, apr_table_t *t) { -#ifdef APREQ_DEBUG - assert(v->size =3D=3D (v->name - v->data) + strlen(v->name)); -#endif apr_table_addn(t, v->name, v->data); } =20 Modified: httpd/apreq/branches/multi-env-unstable/include/apreq_cookie.h URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= include/apreq_cookie.h?view=3Ddiff&r1=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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_cookie.h (origina= l) +++ httpd/apreq/branches/multi-env-unstable/include/apreq_cookie.h Mon Feb = 28 17:20:13 2005 @@ -74,17 +74,6 @@ apreq_attr_to_type(apreq_value_t, data, deconst.out)); } =20 -static APR_INLINE -apr_size_t apreq_cookie_nlen(const apreq_cookie_t *c) { - return c->v.size - (c->v.name - c->v.data); -} - -static APR_INLINE -apr_size_t apreq_cookie_vlen(const apreq_cookie_t *c) { - return (c->v.name - c->v.data) - 1; -} - - /**@return 1 if this is an RFC cookie, 0 if its a Netscape cookie. */ static APR_INLINE unsigned apreq_cookie_version(const apreq_cookie_t *c) { Modified: httpd/apreq/branches/multi-env-unstable/include/apreq_param.h URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= include/apreq_param.h?view=3Ddiff&r1=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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_param.h (original) +++ httpd/apreq/branches/multi-env-unstable/include/apreq_param.h Mon Feb 2= 8 17:20:13 2005 @@ -40,16 +40,6 @@ const apreq_value_t v; /**< underlying name/value info */ } apreq_param_t; =20 -static APR_INLINE -apr_size_t apreq_param_nlen(const apreq_param_t *p) { - return p->v.size - (p->v.name - p->v.data); -} - -static APR_INLINE -apr_size_t apreq_param_vlen(const apreq_param_t *p) { - return (p->v.name - p->v.data) - 1; -} - APREQ_DECLARE(apr_size_t)apreq_param_size(const apreq_param_t *p); =20 =20 Modified: httpd/apreq/branches/multi-env-unstable/library/cookie.c URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= library/cookie.c?view=3Ddiff&r1=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/cookie.c (original) +++ httpd/apreq/branches/multi-env-unstable/library/cookie.c Mon Feb 28 17:= 20:13 2005 @@ -42,8 +42,7 @@ if (c->commentURL !=3D NULL) alen +=3D strlen(c->commentURL); =20 - return (apr_size_t)alen + c->v.size + sizeof *c; - + return (apr_size_t)alen + c->v.nlen + c->v.dlen; } =20 APREQ_DECLARE(void) apreq_cookie_expires(apreq_cookie_t *c,=20 @@ -157,17 +156,16 @@ return NULL; =20 *(const apreq_value_t **)&v =3D &c->v; - v->size =3D nlen + vlen + 1; =20 if (vlen > 0 && value !=3D NULL) memcpy(v->data, value, vlen); v->data[vlen] =3D 0; - + v->dlen =3D vlen; v->name =3D v->data + vlen + 1; if (name !=3D NULL) memcpy (v->name, name, nlen); v->name[nlen] =3D 0; - + v->nlen =3D nlen; /* session cookie is the default */ c->max_age =3D -1; =20 Modified: httpd/apreq/branches/multi-env-unstable/library/param.c URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= library/param.c?view=3Ddiff&r1=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/param.c (original) +++ httpd/apreq/branches/multi-env-unstable/library/param.c Mon Feb 28 17:2= 0:13 2005 @@ -44,16 +44,17 @@ param->flags =3D 0;=20 =20 *(const apreq_value_t **)&v =3D ¶m->v; - v->size =3D vlen + nlen + 1; =20 if (vlen && val !=3D NULL) memcpy(v->data, val, vlen); v->data[vlen] =3D 0; + v->dlen =3D vlen; =20 v->name =3D v->data + vlen + 1; if (nlen && name !=3D NULL) memcpy(v->name, name, nlen); v->name[nlen] =3D 0; + v->nlen =3D nlen; =20 return param; } @@ -75,7 +76,7 @@ if (p->upload !=3D NULL) apr_brigade_length(p->upload, 0, &blen); =20 - return (apr_size_t)blen + tlen + p->v.size + sizeof *p; + return (apr_size_t)blen + tlen + p->v.nlen + p->v.dlen; =20 } =20 @@ -117,7 +118,8 @@ *param =3D NULL; return status; } - v->size =3D nlen + vlen + 1; + v->nlen =3D nlen; + v->dlen =3D vlen; *param =3D p; =20 return APR_SUCCESS; @@ -127,16 +129,12 @@ APREQ_DECLARE(char *) apreq_param_encode(apr_pool_t *pool, const apreq_param_t *param) { - apr_size_t dlen, nlen, vlen; + apr_size_t dlen; char *data; - - nlen =3D apreq_param_nlen(param); - vlen =3D apreq_param_vlen(param); - - data =3D apr_palloc(pool, 3 * (nlen + vlen) + 2); - dlen =3D apreq_encode(data, param->v.name, nlen); + data =3D apr_palloc(pool, 3 * (param->v.nlen + param->v.dlen) + 2); + dlen =3D apreq_encode(data, param->v.name, param->v.nlen); data[dlen++] =3D '=3D'; - dlen +=3D apreq_encode(data + dlen, param->v.data, vlen); + dlen +=3D apreq_encode(data + dlen, param->v.data, param->v.dlen); =20 return data; } Modified: httpd/apreq/branches/multi-env-unstable/library/parser_header.c URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= library/parser_header.c?view=3Ddiff&r1=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/parser_header.c (origin= al) +++ httpd/apreq/branches/multi-env-unstable/library/parser_header.c Mon Feb= 28 17:20:13 2005 @@ -126,6 +126,7 @@ --dest; =20 dest[-1] =3D 0; + v->dlen =3D (dest - v->data) - 1; =20 /* write name */ v->name =3D dest; @@ -137,7 +138,7 @@ ++iov; } *dest =3D 0; - v->size =3D dest - v->data; + nlen =3D dest - v->name; =20 while ((f =3D APR_BRIGADE_FIRST(bb)) !=3D e) apr_bucket_delete(f); Modified: httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded= .c URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= library/parser_urlencoded.c?view=3Ddiff&r1=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/parser_urlencoded.c (or= iginal) +++ httpd/apreq/branches/multi-env-unstable/library/parser_urlencoded.c Mon= Feb 28 17:20:13 2005 @@ -119,12 +119,13 @@ return s; =20 v->name =3D v->data + vlen + 1; + v->dlen =3D vlen; =20 s =3D apreq_decodev(v->name, &nlen, (struct iovec *)arr.elts, mark); if (s !=3D APR_SUCCESS) return s; =20 - v->size =3D nlen + vlen + 1; + v->nlen =3D nlen; =20 while ((f =3D APR_BRIGADE_FIRST(bb)) !=3D e) apr_bucket_delete(f); Modified: httpd/apreq/branches/multi-env-unstable/library/t/params.c URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= library/t/params.c?view=3Ddiff&r1=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/t/params.c (original) +++ httpd/apreq/branches/multi-env-unstable/library/t/params.c Mon Feb 28 1= 7:20:13 2005 @@ -49,7 +49,7 @@ val =3D apr_table_get(args,"quux"); AT_str_eq(val, "foo bar"); param =3D apreq_value_to_param(val); - AT_int_eq(apreq_param_vlen(param), 7); + AT_int_eq(param->v.dlen, 7); =20 AT_str_eq(apr_table_get(args,"plus"), "+"); AT_str_eq(apr_table_get(args,"uplus"), "+"); @@ -146,7 +146,7 @@ =20 param =3D apreq_param_make(p, name, nlen, val, vlen); AT_str_eq(param->v.name, name); - AT_int_eq(apreq_param_vlen(param), vlen); + AT_int_eq(param->v.dlen, vlen); AT_str_eq(param->v.data, val); =20 encode =3D apreq_param_encode(p, param); @@ -155,7 +155,7 @@ s =3D apreq_param_decode(&decode, p, encode, nlen, vlen+2); AT_int_eq(s, APR_SUCCESS); AT_str_eq(decode->v.name, name); - AT_int_eq(apreq_param_vlen(decode), vlen); + AT_int_eq(decode->v.dlen, vlen); AT_str_eq(decode->v.data, val); } =20 Modified: httpd/apreq/branches/multi-env-unstable/library/util.c URL: http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/= library/util.c?view=3Ddiff&r1=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/util.c (original) +++ httpd/apreq/branches/multi-env-unstable/library/util.c Mon Feb 28 17:20= :13 2005 @@ -392,10 +392,6 @@ return d - dest; } =20 - -#define apreq_value_nlen(v) (v->size - (v->name - v->data)) -#define apreq_value_vlen(v) ((v->name - v->data) - 1) - APREQ_DECLARE(char *) apreq_join(apr_pool_t *p,=20 const char *sep,=20 const apr_array_header_t *arr, @@ -414,7 +410,7 @@ return NULL; =20 for (j=3D0, len=3D0; j < n; ++j) - len +=3D apreq_value_vlen(a[j]) + slen; + len +=3D a[j]->dlen + slen + 1; =20 /* Allocated the required space */ =20 @@ -442,17 +438,17 @@ switch (mode) { =20 case APREQ_JOIN_ENCODE: - d +=3D apreq_encode(d, a[0]->data, apreq_value_vlen(a[0])); + d +=3D apreq_encode(d, a[0]->data, a[0]->dlen); =20 for (j =3D 1; j < n; ++j) { memcpy(d, sep, slen); d +=3D slen; - d +=3D apreq_encode(d, a[j]->data, apreq_value_vlen(a[j])); + d +=3D apreq_encode(d, a[j]->data, a[j]->dlen); } break; =20 case APREQ_JOIN_DECODE: - if (apreq_decode(d, &len, a[0]->data, apreq_value_vlen(a[0]))) + if (apreq_decode(d, &len, a[0]->data, a[0]->dlen)) return NULL; else d +=3D len; @@ -461,7 +457,7 @@ memcpy(d, sep, slen); d +=3D slen; =20 - if (apreq_decode(d, &len, a[j]->data, apreq_value_vlen(a[j]))) + if (apreq_decode(d, &len, a[j]->data, a[j]->dlen)) return NULL; else d +=3D len; @@ -471,25 +467,25 @@ =20 case APREQ_JOIN_QUOTE: =20 - d +=3D apreq_quote_once(d, a[0]->data, apreq_value_vlen(a[0])); + d +=3D apreq_quote_once(d, a[0]->data, a[0]->dlen); =20 for (j =3D 1; j < n; ++j) { memcpy(d, sep, slen); d +=3D slen; - d +=3D apreq_quote_once(d, a[j]->data, apreq_value_vlen(a[j])); + d +=3D apreq_quote_once(d, a[j]->data, a[j]->dlen); } break; =20 =20 case APREQ_JOIN_AS_IS: - memcpy(d,a[0]->data,apreq_value_vlen(a[0])); - d +=3D apreq_value_vlen(a[0]); + memcpy(d,a[0]->data, a[0]->dlen); + d +=3D a[0]->dlen; =20 for (j =3D 1; j < n ; ++j) { memcpy(d, sep, slen); d +=3D slen; - memcpy(d, a[j]->data, apreq_value_vlen(a[j])); - d +=3D apreq_value_vlen(a[j]); + memcpy(d, a[j]->data, a[j]->dlen); + d +=3D a[j]->dlen; } break; =20 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=3D155724&r2=3D155725 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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 28 17= :20:13 2005 @@ -104,9 +104,9 @@ } =20 apr_file_printf(out, "%s", "Content-Type: text/plain\n\n"); - dest =3D apr_pcalloc(pool, cookie->v.size + 1); + dest =3D apr_pcalloc(pool, cookie->v.dlen + 1); if (apreq_decode(dest, &dlen, cookie->v.data,=20 - apreq_cookie_vlen(cookie)) =3D=3D APR_SUCCESS) + cookie->v.dlen) =3D=3D APR_SUCCESS) apr_file_printf(out, "%s", dest); else { // apreq_log(APREQ_ERROR APR_EGENERAL, env,