Style police come before the code police.

(No functional changes.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95481 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Justin Erenkrantz
2002-06-03 07:53:42 +00:00
parent 3e61aa4e95
commit 383cd946c9

View File

@ -62,7 +62,8 @@
#include "util_xml.h"
#define READ_BLOCKSIZE 2048 /* used for reading input blocks */
/* used for reading input blocks */
#define READ_BLOCKSIZE 2048
AP_DECLARE(int) ap_xml_parse_input(request_rec * r, apr_xml_doc **pdoc)
@ -73,42 +74,42 @@ AP_DECLARE(int) ap_xml_parse_input(request_rec * r, apr_xml_doc **pdoc)
char errbuf[200];
if ((result = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)) != OK)
return result;
return result;
if (r->remaining == 0) {
*pdoc = NULL;
return OK;
*pdoc = NULL;
return OK;
}
parser = apr_xml_parser_create(r->pool);
if (ap_should_client_block(r)) {
long len;
char *buffer;
apr_size_t total_read = 0;
apr_size_t limit_xml_body = ap_get_limit_xml_body(r);
long len;
char *buffer;
apr_size_t total_read = 0;
apr_size_t limit_xml_body = ap_get_limit_xml_body(r);
/* allocate our working buffer */
buffer = apr_palloc(r->pool, READ_BLOCKSIZE);
/* allocate our working buffer */
buffer = apr_palloc(r->pool, READ_BLOCKSIZE);
/* read the body, stuffing it into the parser */
while ((len = ap_get_client_block(r, buffer, READ_BLOCKSIZE)) > 0) {
total_read += len;
if (limit_xml_body && total_read > limit_xml_body) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"XML request body is larger than the configured "
"limit of %lu", (unsigned long)limit_xml_body);
goto read_error;
}
/* read the body, stuffing it into the parser */
while ((len = ap_get_client_block(r, buffer, READ_BLOCKSIZE)) > 0) {
total_read += len;
if (limit_xml_body && total_read > limit_xml_body) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"XML request body is larger than the configured "
"limit of %lu", (unsigned long)limit_xml_body);
goto read_error;
}
status = apr_xml_parser_feed(parser, buffer, len);
if (status)
goto parser_error;
}
if (len == -1) {
/* ap_get_client_block() has logged an error */
goto read_error;
}
if (status)
goto parser_error;
}
if (len == -1) {
/* ap_get_client_block() has logged an error */
goto read_error;
}
}
/* tell the parser that we're done */