From 93d1c30d4d1ae44d915ed7b8c874497172453d38 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Fri, 14 Jan 2022 16:10:22 +0900 Subject: [PATCH] Use XML parsing with PUT HTTP 200 responses (#1858) This works around the missing strcasestr on win32. References #728. --- src/curl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/curl.cpp b/src/curl.cpp index 2b590ee..cdca1a4 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -1280,9 +1280,9 @@ int S3fsCurl::MapPutErrorResponse(int result) // // const char* pstrbody = bodydata.str(); - if(!pstrbody || NULL != strcasestr(pstrbody, "")){ - S3FS_PRN_ERR("Put request get 200 status response, but it included error body(or NULL). The request failed during copying the object in S3."); - S3FS_PRN_DBG("Put request Response Body : %s", (pstrbody ? pstrbody : "(null)")); + std::string code; + if(!pstrbody || simple_parse_xml(pstrbody, bodydata.size(), "Code", code)){ + S3FS_PRN_ERR("Put request get 200 status response, but it included error body(or NULL). The request failed during copying the object in S3. Code: %s", code.c_str()); // TODO: parse more specific error from result = -EIO; }