ucb/source/ucp/webdav-curl/CurlSession.cxx  |   24 ------------------------
 ucb/source/ucp/webdav-curl/DAVException.hxx |    1 -
 2 files changed, 25 deletions(-)

New commits:
commit f087b00efcba218c5f287e6148bb5f5352edb7e6
Author:     Thorsten Behrens <thorsten.behr...@allotropia.de>
AuthorDate: Sat Apr 1 10:12:44 2023 +0200
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Sat Apr 1 10:12:44 2023 +0200

    Revert "tdf#152493 ucb WebDAV: fix upload using HTTP 1.0 fallback"
    
    This reverts commit 7dc3d1b88f368d40552531c1f9999ed67826fb9d.

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index f05797b7628a..9b66ff0d0f9b 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -952,8 +952,6 @@ auto CurlProcessor::ProcessRequestImpl(
                  "curl_easy_perform failed: " << GetErrorString(rc, 
rSession.m_ErrorBuffer));
         switch (rc)
         {
-            case CURLE_UNSUPPORTED_PROTOCOL:
-                throw DAVException(DAVException::DAV_UNSUPPORTED);
             case CURLE_COULDNT_RESOLVE_PROXY:
                 throw DAVException(
                     DAVException::DAV_HTTP_LOOKUP,
@@ -1241,7 +1239,6 @@ auto CurlProcessor::ProcessRequest(
         }
     }
     bool isRetry(false);
-    bool isFallbackHTTP10(false);
     int nAuthRequests(0);
     int nAuthRequestsProxy(0);
 
@@ -1465,27 +1462,6 @@ auto CurlProcessor::ProcessRequest(
                     }
                 }
             }
-            else if (rException.getError() == DAVException::DAV_UNSUPPORTED)
-            {
-                // tdf#152493 libcurl can't handle "Transfer-Encoding: chunked"
-                // in HTTP/1.1 100 Continue response.
-                // workaround: if HTTP/1.1 didn't work, try HTTP/1.0
-                // (but fallback only once - to prevent infinite loop)
-                if (isFallbackHTTP10)
-                {
-                    throw DAVException(DAVException::DAV_HTTP_ERROR);
-                }
-                isFallbackHTTP10 = true;
-                // note: this is not reset - future requests to this URI use 
it!
-                auto rc = curl_easy_setopt(rSession.m_pCurl.get(), 
CURLOPT_HTTP_VERSION,
-                                           CURL_HTTP_VERSION_1_0);
-                if (rc != CURLE_OK)
-                {
-                    throw DAVException(DAVException::DAV_HTTP_ERROR);
-                }
-                SAL_INFO("ucb.ucp.webdav.curl", "attempting fallback to 
HTTP/1.0");
-                isRetry = true;
-            }
             if (!isRetry)
             {
                 throw; // everything else: re-throw
diff --git a/ucb/source/ucp/webdav-curl/DAVException.hxx 
b/ucb/source/ucp/webdav-curl/DAVException.hxx
index 24f8349d3a31..537b5a82fa2b 100644
--- a/ucb/source/ucp/webdav-curl/DAVException.hxx
+++ b/ucb/source/ucp/webdav-curl/DAVException.hxx
@@ -129,7 +129,6 @@ class DAVException : public std::exception
             DAV_SESSION_CREATE, // session creation error,
                                 // mData = server[:port]
             DAV_INVALID_ARG,    // invalid argument
-            DAV_UNSUPPORTED,    // internal to CurlSession
 
             DAV_LOCK_EXPIRED,   // DAV lock expired
 

Reply via email to