joes 2004/07/01 11:18:26
Modified: src apreq_parsers.c
Log:
Fix error reporting from urlencoded parser. Wicked cool that you can run
Apache::Request from the command line now!
Revision Changes Path
1.54 +7 -5 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.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- apreq_parsers.c 1 Jul 2004 14:39:30 -0000 1.53
+++ apreq_parsers.c 1 Jul 2004 18:18:26 -0000 1.54
@@ -237,15 +237,15 @@
if (APR_BUCKET_IS_EOS(e)) {
s = (ctx->status == URL_NAME) ? APR_SUCCESS :
split_urlword(t, ctx->bb, nlen+1, vlen);
-
APR_BRIGADE_CONCAT(bb, ctx->bb);
- ctx->status = URL_COMPLETE;
+ ctx->status = (s == APR_SUCCESS) ? URL_COMPLETE : URL_ERROR;
return s;
}
s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
- if ( s != APR_SUCCESS )
+ if ( s != APR_SUCCESS ) {
+ ctx->status = URL_ERROR;
return s;
-
+ }
parse_url_bucket:
switch (ctx->status) {
@@ -268,8 +268,10 @@
case '&':
case ';':
s = split_urlword(t, ctx->bb, nlen+1, vlen+1);
- if (s != APR_SUCCESS)
+ if (s != APR_SUCCESS) {
+ ctx->status = URL_ERROR;
return s;
+ }
goto parse_url_brigade;
default:
++vlen;