]> granicus.if.org Git - apache/commitdiff
Don't emit an error when there is no body.
authorJustin Erenkrantz <jerenkrantz@apache.org>
Mon, 17 Feb 2003 18:49:45 +0000 (18:49 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Mon, 17 Feb 2003 18:49:45 +0000 (18:49 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98695 13f79535-47bb-0310-9956-ffa450edef68

server/util_xml.c

index 4e3bef25d4daab1a20c83df49c1d62f707cb5991..108471b867f7e1fb53a4a9459f271b75264445bf 100644 (file)
@@ -134,6 +134,11 @@ AP_DECLARE(int) ap_xml_parse_input(request_rec * r, apr_xml_doc **pdoc)
     /* tell the parser that we're done */
     status = apr_xml_parser_done(parser, pdoc);
     if (status) {
+        /* Some parsers are stupid and return an error on blank documents. */
+        if (!total_read) {
+            *pdoc = NULL;
+            return OK;
+        }
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                       "XML parser error (at end). status=%d", status);
         return HTTP_BAD_REQUEST;