httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1199444 - /httpd/httpd/trunk/modules/dav/main/mod_dav.c
Date Tue, 08 Nov 2011 20:36:03 GMT
Author: sf
Date: Tue Nov  8 20:36:03 2011
New Revision: 1199444

URL: http://svn.apache.org/viewvc?rev=1199444&view=rev
Log:
Don't send a 500 if there is a timeout

Modified:
    httpd/httpd/trunk/modules/dav/main/mod_dav.c

Modified: httpd/httpd/trunk/modules/dav/main/mod_dav.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/main/mod_dav.c?rev=1199444&r1=1199443&r2=1199444&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/dav/main/mod_dav.c (original)
+++ httpd/httpd/trunk/modules/dav/main/mod_dav.c Tue Nov  8 20:36:03 2011
@@ -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;
             }
 



Mime
View raw message