From 36a49038439a51d5344d18f20096d9e35b3b5cae Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Sun, 20 Jan 2019 07:17:40 +0000 Subject: [PATCH] Added an error message when HTTP 301 status --- src/curl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/curl.cpp b/src/curl.cpp index ac43e61..7c7a294 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -2082,8 +2082,12 @@ int S3fsCurl::RequestPerform(void) break; } - // Service response codes which are >= 400 && < 500 + // Service response codes which are >= 300 && < 500 switch(LastResponseCode){ + case 301: + S3FS_PRN_ERR("HTTP response code 301(Moved Permanently: also happens when bucket's region is incorrect), returning EIO. Body Text: %s", (bodydata ? bodydata->str() : "")); + return -EIO; + case 400: S3FS_PRN_ERR("HTTP response code %ld, returning EIO. Body Text: %s", LastResponseCode, (bodydata ? bodydata->str() : "")); return -EIO;