You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Craig McLane <cc...@yahoo.com> on 2002/03/16 19:04:31 UTC
apache_request.c: ApacheRequest___parse
I may be missing something, but the second call to
ApacheRequest_parse_urlencoded within ApacheRequest___parse seems to be
unnecessary. The same behavior could be achieved by either setting
result = OK by default and scrapping the final else block. Currently a
function call is made which simply returns OK for non POST requests and
that condition is already being check in ApacheRequest___parse. I have
attached a patch which may explain my explanation ;-)
I'm not subscribed to the list, so please reply directly if you need
to.
Craig
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/
Re: apache_request.c: ApacheRequest___parse
Posted by Craig McLane <cc...@yahoo.com>.
Joe,
Thanks for the quick reply. To be honest, I noticed the possible
duplication and whipped up a quick patch, but I haven't tested it.
Craig
--- Joe Schaefer <jo...@sunstarsys.com> wrote:
> Craig McLane <cc...@yahoo.com> writes:
>
> > --- libapreq-1.0/c/apache_request.c Mon Feb 18 08:48:27 2002
> > +++ libapreq-1.0-ccm/c/apache_request.c Sat Mar 16 09:54:19 2002
> > @@ -270,7 +270,7 @@
> > int ApacheRequest___parse(ApacheRequest *req)
> > {
> > request_rec *r = req->r;
> > - int result;
> > + int result = OK;
> >
> > if (r->args) {
> > split_to_parms(req, r->args);
> > @@ -289,9 +289,6 @@
> > "[libapreq] unknown content-type: `%s'", ct);
> > result = HTTP_INTERNAL_SERVER_ERROR;
> > }
> > - }
> > - else {
> > - result = ApacheRequest_parse_urlencoded(req);
> > }
> >
> > req->parsed = 1;
>
> Your patch looks OK to me. Have you tested it?
>
> --
> Joe Schaefer
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/
Re: apache_request.c: ApacheRequest___parse
Posted by Joe Schaefer <jo...@sunstarsys.com>.
Craig McLane <cc...@yahoo.com> writes:
> --- libapreq-1.0/c/apache_request.c Mon Feb 18 08:48:27 2002
> +++ libapreq-1.0-ccm/c/apache_request.c Sat Mar 16 09:54:19 2002
> @@ -270,7 +270,7 @@
> int ApacheRequest___parse(ApacheRequest *req)
> {
> request_rec *r = req->r;
> - int result;
> + int result = OK;
>
> if (r->args) {
> split_to_parms(req, r->args);
> @@ -289,9 +289,6 @@
> "[libapreq] unknown content-type: `%s'", ct);
> result = HTTP_INTERNAL_SERVER_ERROR;
> }
> - }
> - else {
> - result = ApacheRequest_parse_urlencoded(req);
> }
>
> req->parsed = 1;
Your patch looks OK to me. Have you tested it?
--
Joe Schaefer