ucb: webdav-curl: tdf#101094 (6) OPTIONS: Do not retry on HTTP error 501

HTTP error 501 the server tells us the used method is not
implemented, non need to retry.

[ port of commit 6dcd231892d80d2f130d1b9ebb9cf7dfa1115df1 ]

Change-Id: I5325f6527c7bb5c8f87d4301fd13eb6c71a318f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123288
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx
index 8787250..c81d326 100644
--- a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx
@@ -1139,8 +1139,12 @@ bool DAVResourceAccess::handleException(DAVException const& e, int const errorCo
    // if we have a bad connection try again. Up to three times.
    case DAVException::DAV_HTTP_ERROR:
        // retry up to three times, if not a client-side error.
        // exception: error 501, server side error that
        // tells us the used method is not implemented
        // on the server, it's nonsense to insist...
        if ( ( e.getStatus() < 400 || e.getStatus() >= 500 ||
               e.getStatus() == 413 ) &&
             ( e.getStatus() != 501 ) &&
             errorCount < 3 )
        {
            return true;