@amadio commented on this pull request.


In src/XrdHttp/XrdHttpReq.cc:

> +    if(xrderrcode != kXR_NotFound) {
+      prot->SendSimpleResp(500, NULL, NULL, "Underlying filesystem failed to calculate checksum.", 0, false);
+    } else {
+      // This is a result of the "Ugly" hack put in place to prevent a failing stat() on a
+      // non-manager server to fail a transfer.
+      // In the case a user issues a GET with a 'Want-Digest' header on a non-existing file, the non-failing
+      // stat() will result in a failed checksum query giving a 500 error back to the user.
+      // Here we just return a 404 instead. httpStatusCode and httpStatusText contain the right reason why the request failed.
+      prot->SendSimpleResp(httpStatusCode, NULL, NULL, httpStatusText.c_str(), httpStatusText.length(), false);
+    }
⬇️ Suggested change
-    if(xrderrcode != kXR_NotFound) {
-      prot->SendSimpleResp(500, NULL, NULL, "Underlying filesystem failed to calculate checksum.", 0, false);
-    } else {
-      // This is a result of the "Ugly" hack put in place to prevent a failing stat() on a
-      // non-manager server to fail a transfer.
-      // In the case a user issues a GET with a 'Want-Digest' header on a non-existing file, the non-failing
-      // stat() will result in a failed checksum query giving a 500 error back to the user.
-      // Here we just return a 404 instead. httpStatusCode and httpStatusText contain the right reason why the request failed.
-      prot->SendSimpleResp(httpStatusCode, NULL, NULL, httpStatusText.c_str(), httpStatusText.length(), false);
-    }
+    // This is a result of the "Ugly" hack put in place to prevent a failing stat() on a
+    // non-manager server to fail a transfer.
+    // In the case a user issues a GET with a 'Want-Digest' header on a non-existing file, the non-failing
+    // stat() will result in a failed checksum query giving a 500 error back to the user.
+    // Here we just return a 404 instead. httpStatusCode and httpStatusText contain the right reason why the request failed.
+    if(xrderrcode != kXR_NotFound) {
+      httpStatusCode = 500;
+      httpStatusText = "Underlying filesystem failed to calculate checksum.";
+    }
+        
+    prot->SendSimpleResp(httpStatusCode, NULL, NULL, httpStatusText.c_str(), httpStatusText.length(), false);
+    }


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <xrootd/xrootd/pull/2019/review/1451187414@github.com>

[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/xrootd/xrootd/pull/2019#pullrequestreview-1451187414", "url": "https://github.com/xrootd/xrootd/pull/2019#pullrequestreview-1451187414", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1