日期:2014-05-16 浏览次数:21158 次
static int recvpost_handler(request_rec *req)
{
if (strcmp(req->handler, "recvpost"))
{
return DECLINED;
}
if((req->method_number != M_GET) && (req->method_number != M_POST))
{
return HTTP_METHOD_NOT_ALLOWED;
}
apr_status_t rv;
apr_xml_doc *doc = NULL;
rv = ap_xml_parse_input(req, &doc);//调用这个函数会返回400
char errbuf[255];
if(rv != APR_SUCCESS)
{
ap_rprintf(req,"parse the xml failed :%s\n",apr_strerror(rv,errbuf,255));
return OK;
}
...................
}
AP_DECLARE(int) ap_xml_parse_input(request_rec * r, apr_xml_doc **pdoc)
{
apr_xml_parser *parser;
apr_bucket_brigade *brigade;
int seen_eos;
apr_status_t status;
char errbuf[200];
apr_size_t total_read = 0;
apr_size_t limit_xml_body = ap_get_limit_xml_body(r);
int result = HTTP_BAD_REQUEST;
parser = apr_xml_parser_create(r->