From: Stefan Fritsch Date: Tue, 8 Nov 2011 20:36:03 +0000 (+0000) Subject: Don't send a 500 if there is a timeout X-Git-Tag: 2.3.15~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebfb6ac9c9ae5d363ecec5d3240743f73b3faf88;p=thirdparty%2Fapache%2Fhttpd.git Don't send a 500 if there is a timeout git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199444 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index bc170bd9992..3de070195e8 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -987,11 +987,20 @@ static int dav_method_put(request_rec *r) APR_BLOCK_READ, DAV_READ_BLOCKSIZE); if (rc != APR_SUCCESS) { - err = dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR, 0, rc, - apr_psprintf(r->pool, - "Could not get next bucket " - "brigade (URI: %s)", - ap_escape_html(r->pool, r->uri))); + int http_err; + char *msg = ap_escape_html(r->pool, r->uri); + if (APR_STATUS_IS_TIMEUP(rc)) { + http_err = HTTP_REQUEST_TIME_OUT; + msg = apr_psprintf(r->pool, "Timeout reading the body " + "(URI: %s)", msg); + } + else { + /* XXX: should this actually be HTTP_BAD_REQUEST? */ + http_err = HTTP_INTERNAL_SERVER_ERROR; + msg = apr_psprintf(r->pool, "Could not get next bucket " + "brigade (URI: %s)", msg); + } + err = dav_new_error(r->pool, http_err, 0, rc, msg); break; }