You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2004/03/14 21:53:58 UTC

cvs commit: httpd-2.0/server util_xml.c

jorton      2004/03/14 12:53:58

  Modified:    server   util_xml.c
  Log:
  Forward-port from mod_dav 1.0:
  
  * server/util_xml.c (ap_xml_parse_input): Give a 413 (Request Entity
  Too Large) not a 400 if the client exceeds the configured XML request
  body limit.
  
  Revision  Changes    Path
  1.29      +3 -1      httpd-2.0/server/util_xml.c
  
  Index: util_xml.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/util_xml.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -w -d -u -r1.28 -r1.29
  --- util_xml.c	9 Feb 2004 20:40:49 -0000	1.28
  +++ util_xml.c	14 Mar 2004 20:53:58 -0000	1.29
  @@ -36,6 +36,7 @@
       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->pool);
       brigade = apr_brigade_create(r->pool, r->connection->bucket_alloc);
  @@ -81,6 +82,7 @@
                   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);
  +                result = HTTP_REQUEST_ENTITY_TOO_LARGE;
                   goto read_error;
               }
   
  @@ -124,5 +126,5 @@
       apr_brigade_destroy(brigade);
   
       /* Apache will supply a default error, plus the error log above. */
  -    return HTTP_BAD_REQUEST;
  +    return result;
   }