You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2024/04/27 16:32:06 UTC

(openoffice) branch AOO42X updated (4513b4beb4 -> 0ec0f74310)

This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a change to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git


    from 4513b4beb4 Get redland building with Clang >= 15, libxml2 >= 2.11.0, and/or FreeBSD >= 14.
     new 9646dec509 Port our WebDAV content provider from serf/apr/apr-util, to curl.
     new b28b64c25e Include string.h too, for memcpy().
     new 41606ed734 Fix including OpenSSL dynamic libraries on Unix (#147)
     new cfbfe4277d Link to bundled OpenSSL if requested
     new 5f005af509 Decode Curl errors
     new f7ba5d5a70 In the WebDAV content provider, allow the user to permit any TLS certificate in the chain that's invalid, not just the first.
     new e8e5910fd8 Allow our WebDAV content provider to connect when the TLS certificate name doesn't match the server's host name.
     new 979772527e Upgrade OpenSSL to version 3.0.13.
     new e350def35c Build OpenSSL as a dynamic link library, instead of a static library.
     new 25788ab291 Fix a regression in 8eb9a7e66a3128669216ddb884f844d50ac59fb9, which broke delivering libcrypto.lib and libssl.lib on Windows.
     new 4db815500a Upgrade Curl to version 8.7.1.
     new 0ec0f74310 Override OpenSSL's certificate verification with our own, instead of using its verification and selectively overriding the result. - A nonsense self-signed expired certificate is fed into Curl to get it   to initialize even when the certificates in its expected system path   are missing or elsewhere. - In Curl's CURLOPT_SSL_CTX_FUNCTION, our Curl_SSLContextCallback, we   then completely override OpenSSL's verification process with ours,   using SSL_CTX_set_cert_verify_ [...]

The 12 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch |   13 -
 ext_libraries/apr-util/apr-util-1.6.1.expat.patch  |   17 -
 .../apr-util/apr-util-1.6.1.makewin32.patch        |  199 --
 ext_libraries/apr-util/aprutil_version.mk          |   24 -
 ext_libraries/apr-util/makefile.mk                 |  139 --
 ext_libraries/apr-util/prj/build.lst               |    5 -
 ext_libraries/apr-util/prj/d.lst                   |   15 -
 ext_libraries/apr/apr-1.6.5-no-devenv.patch        |   16 -
 ext_libraries/apr/apr-1.6.5-windows.patch          |   11 -
 ext_libraries/apr/apr_version.mk                   |   24 -
 ext_libraries/apr/makefile.mk                      |  128 --
 ext_libraries/apr/prj/build.lst                    |    3 -
 ext_libraries/apr/prj/d.lst                        |   24 -
 ext_libraries/serf/NULbytes.patch                  |  313 ---
 ext_libraries/serf/makefile.mk                     |  134 --
 ext_libraries/serf/prj/build.lst                   |    3 -
 ext_libraries/serf/prj/d.lst                       |   12 -
 ext_libraries/serf/serf-1.2.1.ldl.patch            |   11 -
 ext_libraries/serf/serf-1.2.1.libs.patch           |   11 -
 ext_libraries/serf/serf-1.2.1.logging.patch        |   27 -
 ext_libraries/serf/serf_version.mk                 |   24 -
 ext_libraries/serf/win/Library_serf.mk             |   89 -
 ext_libraries/serf/win/Makefile                    |   30 -
 ext_libraries/serf/win/Module_serf.mk              |   27 -
 ext_libraries/serf/win/Package_inc.mk              |   27 -
 main/LICENSE                                       |  125 --
 main/NOTICE                                        |   14 +-
 main/RepositoryExternal.mk                         |  123 +-
 main/RepositoryFixes.mk                            |    4 +-
 main/configure.ac                                  |   82 +-
 main/curl/curl-bundled_openssl.patch               |   29 +
 main/curl/curl-wnt.patch                           |   20 +
 main/curl/makefile.mk                              |   44 +-
 main/curl/prj/build.lst                            |    2 +-
 main/curl/prj/d.lst                                |   10 +-
 main/external_deps.lst                             |   33 +-
 main/openssl/makefile.mk                           |   94 +-
 main/openssl/openssl.patch                         |  214 +--
 main/openssl/openssllnx.patch                      |   25 -
 main/openssl/opensslunx.patch                      |   17 +
 main/openssl/prj/d.lst                             |   13 +-
 main/python/python-2.7.18-msvs9.patch              |  579 +++---
 main/scp2/prj/build.lst                            |    2 +-
 main/scp2/source/ooo/file_library_ooo.scp          |   74 +-
 main/scp2/source/ooo/makefile.mk                   |   25 +-
 main/scp2/source/ooo/shortcut_ooo.scp              |   47 -
 main/set_soenv.in                                  |    9 -
 main/ucb/Library_ucpdav1.mk                        |   34 +-
 main/ucb/prj/build.lst                             |    2 +-
 main/ucb/source/ucp/webdav/ContentProperties.cxx   |    4 +-
 .../{SerfInputStream.cxx => CurlInputStream.cxx}   |   40 +-
 .../{SerfInputStream.hxx => CurlInputStream.hxx}   |   15 +-
 .../{SerfLockStore.cxx => CurlLockStore.cxx}       |   50 +-
 .../{SerfLockStore.hxx => CurlLockStore.hxx}       |   38 +-
 main/ucb/source/ucp/webdav/CurlRequest.cxx         |  393 ++++
 main/ucb/source/ucp/webdav/CurlRequest.hxx         |  130 ++
 main/ucb/source/ucp/webdav/CurlSession.cxx         | 1989 ++++++++++++++++++++
 .../webdav/{SerfSession.hxx => CurlSession.hxx}    |  150 +-
 .../ucp/webdav/{SerfTypes.hxx => CurlTypes.hxx}    |   15 +-
 .../source/ucp/webdav/{SerfUri.cxx => CurlUri.cxx} |  174 +-
 .../source/ucp/webdav/{SerfUri.hxx => CurlUri.hxx} |   42 +-
 main/ucb/source/ucp/webdav/DAVProperties.cxx       |    6 +-
 main/ucb/source/ucp/webdav/DAVProperties.hxx       |    8 +-
 main/ucb/source/ucp/webdav/DAVResourceAccess.cxx   |   12 +-
 main/ucb/source/ucp/webdav/DAVResourceAccess.hxx   |    4 +-
 main/ucb/source/ucp/webdav/DAVSessionFactory.cxx   |   12 +-
 main/ucb/source/ucp/webdav/LockRequest.cxx         |   61 +
 .../ucp/webdav/{AprEnv.cxx => LockRequest.hxx}     |   42 +-
 main/ucb/source/ucp/webdav/PropfindRequest.cxx     |   81 +
 ...erfMkColReqProcImpl.hxx => PropfindRequest.hxx} |   43 +-
 main/ucb/source/ucp/webdav/ProppatchRequest.cxx    |  126 ++
 .../webdav/{AprEnv.hxx => ProppatchRequest.hxx}    |   35 +-
 main/ucb/source/ucp/webdav/SerfCallbacks.cxx       |  121 --
 main/ucb/source/ucp/webdav/SerfCallbacks.hxx       |   69 -
 main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx |   91 -
 main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx |   59 -
 .../source/ucp/webdav/SerfDeleteReqProcImpl.cxx    |   77 -
 .../source/ucp/webdav/SerfDeleteReqProcImpl.hxx    |   55 -
 main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx  |  187 --
 main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx  |   84 -
 main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx |  141 --
 main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx |   67 -
 .../source/ucp/webdav/SerfLockRefreshProcImpl.cxx  |   80 -
 .../source/ucp/webdav/SerfLockRefreshProcImpl.hxx  |   51 -
 main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx |  155 --
 main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx |   74 -
 .../ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx |   72 -
 main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx |   91 -
 main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx |   59 -
 main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx |  136 --
 main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx |   79 -
 .../source/ucp/webdav/SerfPropFindReqProcImpl.cxx  |  202 --
 .../source/ucp/webdav/SerfPropFindReqProcImpl.hxx  |   77 -
 .../source/ucp/webdav/SerfPropPatchReqProcImpl.cxx |  200 --
 .../source/ucp/webdav/SerfPropPatchReqProcImpl.hxx |   60 -
 main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx  |   93 -
 main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx  |   61 -
 .../ucb/source/ucp/webdav/SerfRequestProcessor.cxx |  721 -------
 .../ucb/source/ucp/webdav/SerfRequestProcessor.hxx |  208 --
 .../source/ucp/webdav/SerfRequestProcessorImpl.cxx |  164 --
 .../source/ucp/webdav/SerfRequestProcessorImpl.hxx |   79 -
 .../ucp/webdav/SerfRequestProcessorImplFac.cxx     |  286 ---
 .../ucp/webdav/SerfRequestProcessorImplFac.hxx     |  142 --
 main/ucb/source/ucp/webdav/SerfSession.cxx         | 1708 -----------------
 main/ucb/source/ucp/webdav/SerfUnlockProcImpl.cxx  |   92 -
 main/ucb/source/ucp/webdav/SerfUnlockProcImpl.hxx  |   69 -
 main/ucb/source/ucp/webdav/webdavcontent.cxx       |   26 +-
 main/ucb/source/ucp/webdav/webdavdatasupplier.cxx  |   10 +-
 main/ucb/source/ucp/webdav/webdavprovider.cxx      |   21 +-
 109 files changed, 3719 insertions(+), 8665 deletions(-)
 delete mode 100644 ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch
 delete mode 100644 ext_libraries/apr-util/apr-util-1.6.1.expat.patch
 delete mode 100644 ext_libraries/apr-util/apr-util-1.6.1.makewin32.patch
 delete mode 100644 ext_libraries/apr-util/aprutil_version.mk
 delete mode 100644 ext_libraries/apr-util/makefile.mk
 delete mode 100644 ext_libraries/apr-util/prj/build.lst
 delete mode 100644 ext_libraries/apr-util/prj/d.lst
 delete mode 100644 ext_libraries/apr/apr-1.6.5-no-devenv.patch
 delete mode 100644 ext_libraries/apr/apr-1.6.5-windows.patch
 delete mode 100644 ext_libraries/apr/apr_version.mk
 delete mode 100644 ext_libraries/apr/makefile.mk
 delete mode 100644 ext_libraries/apr/prj/build.lst
 delete mode 100644 ext_libraries/apr/prj/d.lst
 delete mode 100644 ext_libraries/serf/NULbytes.patch
 delete mode 100644 ext_libraries/serf/makefile.mk
 delete mode 100644 ext_libraries/serf/prj/build.lst
 delete mode 100644 ext_libraries/serf/prj/d.lst
 delete mode 100644 ext_libraries/serf/serf-1.2.1.ldl.patch
 delete mode 100644 ext_libraries/serf/serf-1.2.1.libs.patch
 delete mode 100644 ext_libraries/serf/serf-1.2.1.logging.patch
 delete mode 100644 ext_libraries/serf/serf_version.mk
 delete mode 100755 ext_libraries/serf/win/Library_serf.mk
 delete mode 100755 ext_libraries/serf/win/Makefile
 delete mode 100755 ext_libraries/serf/win/Module_serf.mk
 delete mode 100755 ext_libraries/serf/win/Package_inc.mk
 create mode 100644 main/curl/curl-bundled_openssl.patch
 create mode 100644 main/curl/curl-wnt.patch
 delete mode 100644 main/openssl/openssllnx.patch
 create mode 100644 main/openssl/opensslunx.patch
 rename main/ucb/source/ucp/webdav/{SerfInputStream.cxx => CurlInputStream.cxx} (86%)
 rename main/ucb/source/ucp/webdav/{SerfInputStream.hxx => CurlInputStream.hxx} (93%)
 rename main/ucb/source/ucp/webdav/{SerfLockStore.cxx => CurlLockStore.cxx} (86%)
 rename main/ucb/source/ucp/webdav/{SerfLockStore.hxx => CurlLockStore.hxx} (71%)
 create mode 100644 main/ucb/source/ucp/webdav/CurlRequest.cxx
 create mode 100644 main/ucb/source/ucp/webdav/CurlRequest.hxx
 create mode 100644 main/ucb/source/ucp/webdav/CurlSession.cxx
 rename main/ucb/source/ucp/webdav/{SerfSession.hxx => CurlSession.hxx} (68%)
 rename main/ucb/source/ucp/webdav/{SerfTypes.hxx => CurlTypes.hxx} (86%)
 rename main/ucb/source/ucp/webdav/{SerfUri.cxx => CurlUri.cxx} (54%)
 rename main/ucb/source/ucp/webdav/{SerfUri.hxx => CurlUri.hxx} (76%)
 create mode 100644 main/ucb/source/ucp/webdav/LockRequest.cxx
 rename main/ucb/source/ucp/webdav/{AprEnv.cxx => LockRequest.hxx} (64%)
 create mode 100644 main/ucb/source/ucp/webdav/PropfindRequest.cxx
 rename main/ucb/source/ucp/webdav/{SerfMkColReqProcImpl.hxx => PropfindRequest.hxx} (55%)
 create mode 100644 main/ucb/source/ucp/webdav/ProppatchRequest.cxx
 rename main/ucb/source/ucp/webdav/{AprEnv.hxx => ProppatchRequest.hxx} (70%)
 delete mode 100644 main/ucb/source/ucp/webdav/SerfCallbacks.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfCallbacks.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessorImplFac.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessorImplFac.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfSession.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfUnlockProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfUnlockProcImpl.hxx


(openoffice) 03/12: Fix including OpenSSL dynamic libraries on Unix (#147)

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 41606ed7346160b3ca64565cb72ca5409c4bef18
Author: Arrigo Marchiori <ar...@yahoo.it>
AuthorDate: Fri May 6 21:16:33 2022 +0200

    Fix including OpenSSL dynamic libraries on Unix (#147)
    
    (cherry picked from commit 0ca5b4b7b8e66fbc937f89173ce45fcc179e72b3)
---
 main/openssl/prj/d.lst                    |  4 ++--
 main/scp2/source/ooo/file_library_ooo.scp | 11 +++++++----
 main/scp2/source/ooo/makefile.mk          |  2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/main/openssl/prj/d.lst b/main/openssl/prj/d.lst
index 6b67f0fefc..bfd80e44f8 100644
--- a/main/openssl/prj/d.lst
+++ b/main/openssl/prj/d.lst
@@ -5,6 +5,6 @@ mkdir: %_DEST%\inc%_EXT%\external\openssl
 ..\%__SRC%\bin\ssleay32.dll %_DEST%\bin%_EXT%\ssleay32.dll
 ..\%__SRC%\lib\libeay32.lib %_DEST%\lib%_EXT%\libeay32.lib
 ..\%__SRC%\bin\libeay32.dll %_DEST%\bin%_EXT%\libeay32.dll
-..\%__SRC%\lib\libcrypto.a %_DEST%\lib%_EXT%\libcrypto.a
-..\%__SRC%\lib\libssl.a %_DEST%\lib%_EXT%\libssl.a
+..\%__SRC%\lib\libcrypto.* %_DEST%\lib%_EXT%\libcrypto.*
+..\%__SRC%\lib\libssl.* %_DEST%\lib%_EXT%\libssl.*
  
diff --git a/main/scp2/source/ooo/file_library_ooo.scp b/main/scp2/source/ooo/file_library_ooo.scp
index 7e7c39d7ba..ae84b0d958 100644
--- a/main/scp2/source/ooo/file_library_ooo.scp
+++ b/main/scp2/source/ooo/file_library_ooo.scp
@@ -1776,6 +1776,8 @@ File gid_File_Lib_Openssl
     Dir = SCP2_OOO_BIN_DIR;
   #ifdef WNT
     Name = "ssleay32.dll";
+  #else
+    Name = "libssl.so";
   #endif
 End
 #endif
@@ -1785,10 +1787,11 @@ File gid_File_Lib_Crypto
     TXT_FILE_BODY;
     Styles = (PACKED);
     Dir = SCP2_OOO_BIN_DIR;
-
-	#ifdef WNT
-	  Name = "libeay32.dll";
-	#endif
+  #ifdef WNT
+    Name = "libeay32.dll";
+  #else
+    Name = "libcrypto.so";
+  #endif
 End
 #endif
 
diff --git a/main/scp2/source/ooo/makefile.mk b/main/scp2/source/ooo/makefile.mk
index f5ce610c4a..7fdbc1cb7d 100644
--- a/main/scp2/source/ooo/makefile.mk
+++ b/main/scp2/source/ooo/makefile.mk
@@ -223,7 +223,7 @@ SCPDEFS+=-DSYSTEM_NEON
 .ENDIF
 
 # if yes or unset (neon not used) -> do not install openssl library!
-.IF $(SYSTEM_OPENSSL) != "YES"
+.IF "$(SYSTEM_OPENSSL)" != "YES"
 SCPDEFS+=-DOPENSSL
 .ENDIF
 


(openoffice) 05/12: Decode Curl errors

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 5f005af5090fe5fc933b857d234b9efe666f8f21
Author: Arrigo Marchiori <ar...@yahoo.it>
AuthorDate: Sun May 22 14:34:04 2022 +0200

    Decode Curl errors
    
    (cherry picked from commit b9e06544f399447a1a5df77229f012135bc131a9)
---
 main/ucb/source/ucp/webdav/CurlSession.cxx | 37 +++++++++++++++++++++++++++---
 1 file changed, 34 insertions(+), 3 deletions(-)

diff --git a/main/ucb/source/ucp/webdav/CurlSession.cxx b/main/ucb/source/ucp/webdav/CurlSession.cxx
index 5ca143273e..721f1aa4cb 100644
--- a/main/ucb/source/ucp/webdav/CurlSession.cxx
+++ b/main/ucb/source/ucp/webdav/CurlSession.cxx
@@ -770,9 +770,40 @@ void CurlSession::processResponse( CurlRequest &curlRequest, CURLcode curlCode )
     if ( curlCode != 0 )
     {
         m_aLogger.log( LogLevel::WARNING, "Curl request failed with CURLcode $1$", (sal_Int64)curlCode );
-        throw DAVException( DAVException::DAV_HTTP_LOOKUP,
-                            CurlUri::makeConnectionEndPointString( getHostName(),
-                                                                   getPort() ) );
+        DAVException::ExceptionCode exCode = DAVException::DAV_HTTP_ERROR;
+        rtl::OUString exData;
+        switch (curlCode) {
+        case CURLE_COULDNT_RESOLVE_HOST:
+            exCode = DAVException::DAV_HTTP_LOOKUP;
+            exData = CurlUri::makeConnectionEndPointString( getHostName(),
+                                                            getPort() );
+            break;
+        case CURLE_COULDNT_CONNECT:
+            exCode = DAVException::DAV_HTTP_CONNECT;
+            exData = CurlUri::makeConnectionEndPointString( getHostName(),
+                                                            getPort() );
+            break;
+        case CURLE_OPERATION_TIMEDOUT:
+            exCode = DAVException::DAV_HTTP_TIMEOUT;
+            exData = CurlUri::makeConnectionEndPointString( getHostName(),
+                                                            getPort() );
+            break;
+        case CURLE_LOGIN_DENIED:
+        case CURLE_AUTH_ERROR:
+            exCode = DAVException::DAV_HTTP_AUTH;
+            exData = CurlUri::makeConnectionEndPointString( getHostName(),
+                                                            getPort() );
+            break;
+        default:
+            {
+                const char *s = curl_easy_strerror(curlCode);
+                exCode = DAVException::DAV_HTTP_ERROR;
+                exData = ::rtl::OUString(s, strlen(s),
+                                         RTL_TEXTENCODING_UTF8);
+                break;
+            }
+        }
+        throw DAVException( exCode, exData );
     }
     
     rtl::OUString reasonPhrase = rtl::OStringToOUString( curlRequest.getReasonPhrase(), RTL_TEXTENCODING_UTF8 );


(openoffice) 10/12: Fix a regression in 8eb9a7e66a3128669216ddb884f844d50ac59fb9, which broke delivering libcrypto.lib and libssl.lib on Windows.

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 25788ab2917a5eb9b75429f07f6d97c60783ed6e
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Thu Apr 18 03:38:14 2024 +0200

    Fix a regression in 8eb9a7e66a3128669216ddb884f844d50ac59fb9, which broke
    delivering libcrypto.lib and libssl.lib on Windows.
    
    Patch by: me
    
    (cherry picked from commit 9b51720274ee0b7c1ade0e9b4cd4b8417efd1b6c)
---
 main/openssl/prj/d.lst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/main/openssl/prj/d.lst b/main/openssl/prj/d.lst
index cac50416cf..f6a43b0e90 100644
--- a/main/openssl/prj/d.lst
+++ b/main/openssl/prj/d.lst
@@ -1,8 +1,8 @@
 mkdir: %_DEST%\inc%_EXT%\external
 mkdir: %_DEST%\inc%_EXT%\external\openssl
 ..\%__SRC%\inc\*.h %_DEST%\inc%_EXT%\external\openssl
-..\%__SRC%\lib\libcrypto.*.* %_DEST%\lib%_EXT%\*
-..\%__SRC%\lib\libssl.*.* %_DEST%\lib%_EXT%\*
+..\%__SRC%\lib\libcrypto.* %_DEST%\lib%_EXT%\*
+..\%__SRC%\lib\libssl.* %_DEST%\lib%_EXT%\*
 ..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
 
 linklib: libcrypto.*.*


Re: (openoffice) 01/12: Port our WebDAV content provider from serf/apr/apr-util, to curl.

Posted by Arrigo Marchiori <ar...@apache.org>.
Hello Dave,

On Sat, Apr 27, 2024 at 09:45:46AM -0700, Dave Fisher wrote:

> Hi Arrigo,
> 
> With this change do we eliminate all dependencies on Apache APR?

Yes, for AOO42X.

This is a cherry-pick of Damjan's work on trunk, so he may elaborate
further.

Apache APR and Serf remain a requirement of our AOO41X branch.

> > On Apr 27, 2024, at 9:32 AM, ardovm@apache.org wrote:
> > 
> > This is an automated email from the ASF dual-hosted git repository.
> > 
> > ardovm pushed a commit to branch AOO42X
> > in repository https://gitbox.apache.org/repos/asf/openoffice.git
> > 
> > commit 9646dec509b481cb88dbe1130c2f325ed13af748
> > Author: Damjan Jovanovic <da...@apache.org>
> > AuthorDate: Mon Apr 4 03:06:47 2022 +0200
> > 
> >    Port our WebDAV content provider from serf/apr/apr-util, to curl.
> > 
> >    Patch by: me
> > 
> >    (adapted from commit 51ba086bf122dbb5b50fd813e5b9a81c051aa16b by Arrigo
> >    Marchiori)
> > ---
> > ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch |   13 -
> > ext_libraries/apr-util/apr-util-1.6.1.expat.patch  |   17 -
> > .../apr-util/apr-util-1.6.1.makewin32.patch        |  199 --
> > ext_libraries/apr-util/aprutil_version.mk          |   24 -
> > ext_libraries/apr-util/makefile.mk                 |  139 --
> > ext_libraries/apr-util/prj/build.lst               |    5 -
> > ext_libraries/apr-util/prj/d.lst                   |   15 -
> > ext_libraries/apr/apr-1.6.5-no-devenv.patch        |   16 -
> > ext_libraries/apr/apr-1.6.5-windows.patch          |   11 -
> > ext_libraries/apr/apr_version.mk                   |   24 -
> > ext_libraries/apr/makefile.mk                      |  128 --
> > ext_libraries/apr/prj/build.lst                    |    3 -
> > ext_libraries/apr/prj/d.lst                        |   24 -
> > ext_libraries/serf/NULbytes.patch                  |  313 ----
> > ext_libraries/serf/makefile.mk                     |  134 --
> > ext_libraries/serf/prj/build.lst                   |    3 -
> > ext_libraries/serf/prj/d.lst                       |   12 -
> > ext_libraries/serf/serf-1.2.1.ldl.patch            |   11 -
> > ext_libraries/serf/serf-1.2.1.libs.patch           |   11 -
> > ext_libraries/serf/serf-1.2.1.logging.patch        |   27 -
> > ext_libraries/serf/serf_version.mk                 |   24 -
> > ext_libraries/serf/win/Library_serf.mk             |   89 -
> > ext_libraries/serf/win/Makefile                    |   30 -
> > ext_libraries/serf/win/Module_serf.mk              |   27 -
> > ext_libraries/serf/win/Package_inc.mk              |   27 -
[...]

-- 
Arrigo

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: (openoffice) 01/12: Port our WebDAV content provider from serf/apr/apr-util, to curl.

Posted by Damjan Jovanovic <da...@apache.org>.
On Sat, Apr 27, 2024 at 4:46 PM Dave Fisher <wa...@apache.org> wrote:

> Hi Arrigo,
>
> With this change do we eliminate all dependencies on Apache APR?
>
> Best,
> Dave
>
>
Yes. The ucb WebDAV module was their only user, so using Curl as the
HTTP(S) library, allowed apr, apr-util and serf to be removed as
dependencies. The total size of the AOO binaries decreased by about 0.5%.

Curl has also turned out to be a lovely library, permissively licensed,
easy to build, exceptionally well documented, integrates well with OpenSSL,
and easy to upgrade. In cases where we needed to understand some internal
details, the Curl code was well structured and easy to understand.

Regards
Damjan

Re: (openoffice) 01/12: Port our WebDAV content provider from serf/apr/apr-util, to curl.

Posted by Dave Fisher <wa...@apache.org>.
Hi Arrigo,

With this change do we eliminate all dependencies on Apache APR?

Best,
Dave

> On Apr 27, 2024, at 9:32 AM, ardovm@apache.org wrote:
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> ardovm pushed a commit to branch AOO42X
> in repository https://gitbox.apache.org/repos/asf/openoffice.git
> 
> commit 9646dec509b481cb88dbe1130c2f325ed13af748
> Author: Damjan Jovanovic <da...@apache.org>
> AuthorDate: Mon Apr 4 03:06:47 2022 +0200
> 
>    Port our WebDAV content provider from serf/apr/apr-util, to curl.
> 
>    Patch by: me
> 
>    (adapted from commit 51ba086bf122dbb5b50fd813e5b9a81c051aa16b by Arrigo
>    Marchiori)
> ---
> ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch |   13 -
> ext_libraries/apr-util/apr-util-1.6.1.expat.patch  |   17 -
> .../apr-util/apr-util-1.6.1.makewin32.patch        |  199 --
> ext_libraries/apr-util/aprutil_version.mk          |   24 -
> ext_libraries/apr-util/makefile.mk                 |  139 --
> ext_libraries/apr-util/prj/build.lst               |    5 -
> ext_libraries/apr-util/prj/d.lst                   |   15 -
> ext_libraries/apr/apr-1.6.5-no-devenv.patch        |   16 -
> ext_libraries/apr/apr-1.6.5-windows.patch          |   11 -
> ext_libraries/apr/apr_version.mk                   |   24 -
> ext_libraries/apr/makefile.mk                      |  128 --
> ext_libraries/apr/prj/build.lst                    |    3 -
> ext_libraries/apr/prj/d.lst                        |   24 -
> ext_libraries/serf/NULbytes.patch                  |  313 ----
> ext_libraries/serf/makefile.mk                     |  134 --
> ext_libraries/serf/prj/build.lst                   |    3 -
> ext_libraries/serf/prj/d.lst                       |   12 -
> ext_libraries/serf/serf-1.2.1.ldl.patch            |   11 -
> ext_libraries/serf/serf-1.2.1.libs.patch           |   11 -
> ext_libraries/serf/serf-1.2.1.logging.patch        |   27 -
> ext_libraries/serf/serf_version.mk                 |   24 -
> ext_libraries/serf/win/Library_serf.mk             |   89 -
> ext_libraries/serf/win/Makefile                    |   30 -
> ext_libraries/serf/win/Module_serf.mk              |   27 -
> ext_libraries/serf/win/Package_inc.mk              |   27 -
> main/NOTICE                                        |    6 -
> main/RepositoryExternal.mk                         |  106 --
> main/configure.ac                                  |   82 +-
> main/curl/curl-wnt.patch                           |   38 +
> main/curl/makefile.mk                              |   18 +-
> main/curl/prj/build.lst                            |    2 +-
> main/external_deps.lst                             |   18 -
> main/scp2/prj/build.lst                            |    2 +-
> main/scp2/source/ooo/file_library_ooo.scp          |   61 -
> main/scp2/source/ooo/makefile.mk                   |   23 -
> main/scp2/source/ooo/shortcut_ooo.scp              |   47 -
> main/set_soenv.in                                  |    9 -
> main/ucb/Library_ucpdav1.mk                        |   34 +-
> main/ucb/prj/build.lst                             |    2 +-
> main/ucb/source/ucp/webdav/ContentProperties.cxx   |    4 +-
> .../{SerfInputStream.cxx => CurlInputStream.cxx}   |   40 +-
> .../{SerfInputStream.hxx => CurlInputStream.hxx}   |   15 +-
> .../{SerfLockStore.cxx => CurlLockStore.cxx}       |   50 +-
> .../{SerfLockStore.hxx => CurlLockStore.hxx}       |   38 +-
> main/ucb/source/ucp/webdav/CurlRequest.cxx         |  391 ++++
> main/ucb/source/ucp/webdav/CurlRequest.hxx         |  130 ++
> main/ucb/source/ucp/webdav/CurlSession.cxx         | 1959 ++++++++++++++++++++
> .../webdav/{SerfSession.hxx => CurlSession.hxx}    |  144 +-
> .../ucp/webdav/{SerfTypes.hxx => CurlTypes.hxx}    |   15 +-
> .../source/ucp/webdav/{SerfUri.cxx => CurlUri.cxx} |  174 +-
> .../source/ucp/webdav/{SerfUri.hxx => CurlUri.hxx} |   42 +-
> main/ucb/source/ucp/webdav/DAVProperties.cxx       |    6 +-
> main/ucb/source/ucp/webdav/DAVProperties.hxx       |    8 +-
> main/ucb/source/ucp/webdav/DAVResourceAccess.cxx   |   12 +-
> main/ucb/source/ucp/webdav/DAVResourceAccess.hxx   |    4 +-
> main/ucb/source/ucp/webdav/DAVSessionFactory.cxx   |   12 +-
> main/ucb/source/ucp/webdav/LockRequest.cxx         |   61 +
> .../ucp/webdav/{AprEnv.cxx => LockRequest.hxx}     |   42 +-
> main/ucb/source/ucp/webdav/PropfindRequest.cxx     |   81 +
> ...erfMkColReqProcImpl.hxx => PropfindRequest.hxx} |   43 +-
> main/ucb/source/ucp/webdav/ProppatchRequest.cxx    |  126 ++
> .../webdav/{AprEnv.hxx => ProppatchRequest.hxx}    |   35 +-
> main/ucb/source/ucp/webdav/SerfCallbacks.cxx       |  121 --
> main/ucb/source/ucp/webdav/SerfCallbacks.hxx       |   69 -
> main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx |   91 -
> main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx |   59 -
> .../source/ucp/webdav/SerfDeleteReqProcImpl.cxx    |   77 -
> .../source/ucp/webdav/SerfDeleteReqProcImpl.hxx    |   55 -
> main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx  |  187 --
> main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx  |   84 -
> main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx |  141 --
> main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx |   67 -
> .../source/ucp/webdav/SerfLockRefreshProcImpl.cxx  |   80 -
> .../source/ucp/webdav/SerfLockRefreshProcImpl.hxx  |   51 -
> main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx |  155 --
> main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx |   74 -
> .../ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx |   72 -
> main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx |   91 -
> main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx |   59 -
> main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx |  136 --
> main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx |   79 -
> .../source/ucp/webdav/SerfPropFindReqProcImpl.cxx  |  202 --
> .../source/ucp/webdav/SerfPropFindReqProcImpl.hxx  |   77 -
> .../source/ucp/webdav/SerfPropPatchReqProcImpl.cxx |  200 --
> .../source/ucp/webdav/SerfPropPatchReqProcImpl.hxx |   60 -
> main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx  |   93 -
> main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx  |   61 -
> .../ucb/source/ucp/webdav/SerfRequestProcessor.cxx |  721 -------
> .../ucb/source/ucp/webdav/SerfRequestProcessor.hxx |  208 ---
> .../source/ucp/webdav/SerfRequestProcessorImpl.cxx |  164 --
> .../source/ucp/webdav/SerfRequestProcessorImpl.hxx |   79 -
> .../ucp/webdav/SerfRequestProcessorImplFac.cxx     |  286 ---
> .../ucp/webdav/SerfRequestProcessorImplFac.hxx     |  142 --
> main/ucb/source/ucp/webdav/SerfSession.cxx         | 1708 -----------------
> main/ucb/source/ucp/webdav/SerfUnlockProcImpl.cxx  |   92 -
> main/ucb/source/ucp/webdav/SerfUnlockProcImpl.hxx  |   69 -
> main/ucb/source/ucp/webdav/webdavcontent.cxx       |   26 +-
> main/ucb/source/ucp/webdav/webdavdatasupplier.cxx  |   10 +-
> main/ucb/source/ucp/webdav/webdavprovider.cxx      |   21 +-
> 99 files changed, 3201 insertions(+), 7972 deletions(-)
> 
> diff --git a/ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch b/ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch
> deleted file mode 100644
> index bdd636214b..0000000000
> --- a/ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch
> +++ /dev/null
> @@ -1,13 +0,0 @@
> ---- misc/apr-util-1.6.1/include/apu.hw	2008-11-21 07:18:37.000000000 +0100
> -+++ misc/build/apr-util-1.6.1/include/apu.hw	2012-01-03 13:37:20.042007300 +0100
> -@@ -132,8 +132,8 @@
> - #define APU_HAVE_NSS            0
> - #endif
> - 
> --#define APU_HAVE_APR_ICONV      1
> --#define APU_HAVE_ICONV          0
> -+#undef APU_HAVE_APR_ICONV
> -+#undef APU_HAVE_ICONV
> - #define APR_HAS_XLATE           (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
> - 
> - #endif /* APU_H */
> diff --git a/ext_libraries/apr-util/apr-util-1.6.1.expat.patch b/ext_libraries/apr-util/apr-util-1.6.1.expat.patch
> deleted file mode 100644
> index 3a84a6a3a6..0000000000
> --- a/ext_libraries/apr-util/apr-util-1.6.1.expat.patch
> +++ /dev/null
> @@ -1,17 +0,0 @@
> ---- misc/apr-util-1.6.1/build/apu-conf.m4	2011-08-08 06:32:27.000000000 -0300
> -+++ misc/build/apr-util-1.6.1/build/apu-conf.m4	2013-06-12 20:09:05.877947541 -0300
> -@@ -87,8 +87,14 @@ dnl be dropped later.
> - dnl
> - AC_DEFUN([APU_SYSTEM_EXPAT], [
> -  
> -+  APU_TRY_EXPAT_LINK([OpenOffice expat], apu_cv_expat_openoffice,
> -+     [expat.h], [-L"$SOLARLIBDIR" -lexpat_xmlparse -lexpat_xmltok],
> -+     [APR_ADDTO(APRUTIL_INCLUDES, [-I"$SOLARINCDIR"/external])] )
> -+
> -+  if test $apu_has_expat = 0; then
> -   APU_TRY_EXPAT_LINK([Expat 1.95.x], apu_cv_expat_system, 
> -     [expat.h], [-lexpat])
> -+  fi
> - 
> -   if test $apu_has_expat = 0; then
> -     APU_TRY_EXPAT_LINK([old Debian-packaged expat], apu_cv_expat_debian,
> diff --git a/ext_libraries/apr-util/apr-util-1.6.1.makewin32.patch b/ext_libraries/apr-util/apr-util-1.6.1.makewin32.patch
> deleted file mode 100644
> index f986fde96d..0000000000
> --- a/ext_libraries/apr-util/apr-util-1.6.1.makewin32.patch
> +++ /dev/null
> @@ -1,199 +0,0 @@
> ---- misc/apr-util-1.6.1/Library_apr-util.mk	2012-01-05 14:49:40.529219100 +0100
> -+++ misc/build/apr-util-1.6.1/Library_apr-util.mk	2012-01-05 14:47:18.621102400 +0100
> -@@ -1 +1,89 @@
> --dummy
> -+#/**************************************************************
> -+# * 
> -+# * Licensed to the Apache Software Foundation (ASF) under one
> -+# * or more contributor license agreements.  See the NOTICE file
> -+# * distributed with this work for additional information
> -+# * regarding copyright ownership.  The ASF licenses this file
> -+# * to you under the Apache License, Version 2.0 (the
> -+# * "License"); you may not use this file except in compliance
> -+# * with the License.  You may obtain a copy of the License at
> -+# * 
> -+# *   http://www.apache.org/licenses/LICENSE-2.0
> -+# * 
> -+# * Unless required by applicable law or agreed to in writing,
> -+# * software distributed under the License is distributed on an
> -+# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -+# * KIND, either express or implied.  See the License for the
> -+# * specific language governing permissions and limitations
> -+# * under the License.
> -+# * 
> -+# *************************************************************/
> -+
> -+$(eval $(call gb_Library_Library,apr-util))
> -+
> -+$(eval $(call gb_Library_add_package_headers,apr-util,apr-util_inc))
> -+
> -+$(eval $(call gb_Library_set_include,apr-util,\
> -+	$$(INCLUDE) \
> -+	-I./include \
> -+	-I./include/private \
> -+	-I$(OUTDIR)/inc/apr \
> -+))
> -+
> -+$(eval $(call gb_Library_add_defs,apr-util,\
> -+	-DAPU_DECLARE_EXPORT -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DWIN32_EXPORTS \
> -+))
> -+
> -+$(eval $(call gb_Library_add_linked_libs,apr-util,\
> -+	apr \
> -+	expat_xmltok \
> -+	expat_xmlparse \
> -+    $(gb_STDLIBS) \
> -+))
> -+
> -+$(eval $(call gb_Library_add_cobjects,apr-util,\
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_brigade \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_alloc \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_eos \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_file \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_flush \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_heap \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_mmap \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_pipe \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_pool \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_refcount \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_simple \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_socket \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/apr_crypto \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/apr_md4 \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/apr_md5 \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/apr_sha1 \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/getuuid \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/uuid \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbd/apr_dbd \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/apr_dbm \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/apr_dbm_sdbm \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/sdbm/sdbm \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/sdbm/sdbm_hash \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/sdbm/sdbm_lock \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/sdbm/sdbm_pair \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/encoding/apr_base64 \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/hooks/apr_hooks \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/ldap/apr_ldap_stub \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/ldap/apr_ldap_url \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/memcache/apr_memcache \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apr_date \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apr_queue \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apr_reslist \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apr_rmm \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apr_thread_pool \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apu_dso \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apu_version \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/strmatch/apr_strmatch \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/uri/apr_uri \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/xlate/xlate \
> -+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/xml/apr_xml \
> -+))
> -+
> -+# vim: set noet sw=4 ts=4:
> ---- misc/apr-util-1.6.1/Makefile	2012-01-05 14:49:40.420212900 +0100
> -+++ misc/build/apr-util-1.6.1/Makefile	2012-01-05 14:47:07.827485100 +0100
> -@@ -1 +1,32 @@
> --dummy
> -+#/**************************************************************
> -+# * 
> -+# * Licensed to the Apache Software Foundation (ASF) under one
> -+# * or more contributor license agreements.  See the NOTICE file
> -+# * distributed with this work for additional information
> -+# * regarding copyright ownership.  The ASF licenses this file
> -+# * to you under the Apache License, Version 2.0 (the
> -+# * "License"); you may not use this file except in compliance
> -+# * with the License.  You may obtain a copy of the License at
> -+# * 
> -+# *   http://www.apache.org/licenses/LICENSE-2.0
> -+# * 
> -+# * Unless required by applicable law or agreed to in writing,
> -+# * software distributed under the License is distributed on an
> -+# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -+# * KIND, either express or implied.  See the License for the
> -+# * specific language governing permissions and limitations
> -+# * under the License.
> -+# * 
> -+# *************************************************************/
> -+
> -+ifeq ($(strip $(SOLARENV)),)
> -+$(error No environment set!)
> -+endif
> -+
> -+gb_PARTIALBUILD := T
> -+GBUILDDIR := $(SOLARENV)/gbuild
> -+include $(GBUILDDIR)/gbuild.mk
> -+
> -+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
> -+
> -+# vim: set noet sw=4 ts=4:
> ---- misc/apr-util-1.6.1/Module_apr-util.mk	2012-01-05 14:49:40.476216100 +0100
> -+++ misc/build/apr-util-1.6.1/Module_apr-util.mk	2012-01-05 14:47:42.567472100 +0100
> -@@ -1 +1,29 @@
> --dummy
> -+#/**************************************************************
> -+# * 
> -+# * Licensed to the Apache Software Foundation (ASF) under one
> -+# * or more contributor license agreements.  See the NOTICE file
> -+# * distributed with this work for additional information
> -+# * regarding copyright ownership.  The ASF licenses this file
> -+# * to you under the Apache License, Version 2.0 (the
> -+# * "License"); you may not use this file except in compliance
> -+# * with the License.  You may obtain a copy of the License at
> -+# * 
> -+# *   http://www.apache.org/licenses/LICENSE-2.0
> -+# * 
> -+# * Unless required by applicable law or agreed to in writing,
> -+# * software distributed under the License is distributed on an
> -+# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -+# * KIND, either express or implied.  See the License for the
> -+# * specific language governing permissions and limitations
> -+# * under the License.
> -+# * 
> -+# *************************************************************/
> -+
> -+$(eval $(call gb_Module_Module,apr-util))
> -+
> -+$(eval $(call gb_Module_add_targets,apr-util,\
> -+	Library_apr-util \
> -+	Package_inc \
> -+))
> -+
> -+# vim: set noet ts=4 sw=4:
> ---- misc/apr-util-1.6.1/Package_inc.mk	2012-01-05 14:49:40.585222300 +0100
> -+++ misc/build/apr-util-1.6.1/Package_inc.mk	2012-01-05 14:47:51.616989700 +0100
> -@@ -1 +1,33 @@
> --dummy
> -+#/**************************************************************
> -+# * 
> -+# * Licensed to the Apache Software Foundation (ASF) under one
> -+# * or more contributor license agreements.  See the NOTICE file
> -+# * distributed with this work for additional information
> -+# * regarding copyright ownership.  The ASF licenses this file
> -+# * to you under the Apache License, Version 2.0 (the
> -+# * "License"); you may not use this file except in compliance
> -+# * with the License.  You may obtain a copy of the License at
> -+# * 
> -+# *   http://www.apache.org/licenses/LICENSE-2.0
> -+# * 
> -+# * Unless required by applicable law or agreed to in writing,
> -+# * software distributed under the License is distributed on an
> -+# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -+# * KIND, either express or implied.  See the License for the
> -+# * specific language governing permissions and limitations
> -+# * under the License.
> -+# * 
> -+# *************************************************************/
> -+
> -+$(eval $(call gb_Package_Package,apr-util_inc,$(EXT_LIBRARIES)/apr-util/$(INPATH)/misc/build/apr-util-1.6.1/include))
> -+$(eval $(call gb_Package_add_files, apr-util_inc, inc/apr-util,        \
> -+       apu.h                                                           \
> -+       apu_version.h                                                   \
> -+       apr_uri.h                                                       \
> -+       apr_date.h                                                      \
> -+       apr_uuid.h                                                      \
> -+       apr_md5.h                                                       \
> -+       apr_xlate.h                                                     \
> -+       apr_base64.h                                                    \
> -+))
> -+
> diff --git a/ext_libraries/apr-util/aprutil_version.mk b/ext_libraries/apr-util/aprutil_version.mk
> deleted file mode 100644
> index 6a4eabb335..0000000000
> --- a/ext_libraries/apr-util/aprutil_version.mk
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -#**************************************************************
> -#
> -#  Licensed to the Apache Software Foundation (ASF) under one
> -#  or more contributor license agreements.  See the NOTICE file
> -#  distributed with this work for additional information
> -#  regarding copyright ownership.  The ASF licenses this file
> -#  to you under the Apache License, Version 2.0 (the
> -#  "License"); you may not use this file except in compliance
> -#  with the License.  You may obtain a copy of the License at
> -#
> -#    http://www.apache.org/licenses/LICENSE-2.0
> -#
> -#  Unless required by applicable law or agreed to in writing,
> -#  software distributed under the License is distributed on an
> -#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -#  KIND, either express or implied.  See the License for the
> -#  specific language governing permissions and limitations
> -#  under the License.
> -#
> -#**************************************************************
> -
> -APR_UTIL_MAJOR=1
> -APR_UTIL_MINOR=6
> -APR_UTIL_MICRO=1
> diff --git a/ext_libraries/apr-util/makefile.mk b/ext_libraries/apr-util/makefile.mk
> deleted file mode 100644
> index c2ba7b5324..0000000000
> --- a/ext_libraries/apr-util/makefile.mk
> +++ /dev/null
> @@ -1,139 +0,0 @@
> -#**************************************************************
> -#
> -#  Licensed to the Apache Software Foundation (ASF) under one
> -#  or more contributor license agreements.  See the NOTICE file
> -#  distributed with this work for additional information
> -#  regarding copyright ownership.  The ASF licenses this file
> -#  to you under the Apache License, Version 2.0 (the
> -#  "License"); you may not use this file except in compliance
> -#  with the License.  You may obtain a copy of the License at
> -#
> -#    http://www.apache.org/licenses/LICENSE-2.0
> -#
> -#  Unless required by applicable law or agreed to in writing,
> -#  software distributed under the License is distributed on an
> -#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -#  KIND, either express or implied.  See the License for the
> -#  specific language governing permissions and limitations
> -#  under the License.
> -#
> -#**************************************************************
> -
> -PRJ=.
> -
> -PRJNAME=apr-util
> -TARGET=aprutil
> -
> -# --- Settings -----------------------------------------------------
> -
> -.INCLUDE :	settings.mk
> -.INCLUDE :	aprutil_version.mk
> -
> -# --- Files --------------------------------------------------------
> -
> -.IF "$(SYSTEM_APR_UTIL)"=="YES"
> -
> -all:
> -	@echo "Using system apr-util.  Does not have to be built."
> -
> -.ELSE
> -
> -# Assemble the full version number from the parts defined in aprutil_version.mk
> -APR_UTIL_VERSION=$(APR_UTIL_MAJOR).$(APR_UTIL_MINOR).$(APR_UTIL_MICRO)
> -
> -
> -TARFILE_NAME=$(PRJNAME)-$(APR_UTIL_VERSION)
> -TARFILE_MD5=bd502b9a8670a8012c4d90c31a84955f
> -
> -.IF "$(OS)"=="WNT"
> -
> -ADDITIONAL_FILES=Makefile Module_apr-util.mk Library_apr-util.mk Package_inc.mk
> -
> -PATCH_FILES= \
> -    $(TARFILE_NAME).apu.hw.patch \
> -    $(TARFILE_NAME).makewin32.patch
> -
> -CONFIGURE_DIR=
> -CONFIGURE_ACTION=cp include/apu.hw include/apu.h;							\
> -	cp include/apr_ldap.hw include/apr_ldap.h;								\
> -	cp include/private/apu_config.hw include/private/apu_config.h;			\
> -	cp include/private/apu_select_dbm.hw include/private/apu_select_dbm.h
> -CONFIGURE_FLAGS=
> -
> -BUILD_DIR=$(CONFIGURE_DIR)
> -BUILD_ACTION=$(GNUMAKE)
> -#BUILD_FLAGS+= -j$(EXTMAXPROCESS)
> -
> -.ELIF "$(GUI)" == "OS2"
> -
> -@all:
> -	@echo "using system apr-util. nothing do do."
> -
> -
> -.ELSE
> -
> -
> -
> -CONFIGURE_DIR=
> -CONFIGURE_ACTION=autoconf && .$/configure
> -CONFIGURE_FLAGS=								\
> -	--with-apr=$(OUTDIR)/bin/apr-1-config		\
> -	--prefix=$(OUTDIR)							\
> -	--includedir=$(OUTDIR)$/inc$/apr-util		\
> -	--with-iconv="no"				
> -
> -
> -# Use our own expat on the Mac.  Maybe we should do this on Linux, too? Yes!
> -.IF "$(OS)" == "MACOSX" || ("$(OS)" == "LINUX" && "$(SYSTEM_EXPAT)"!="YES")
> -
> -# Recent versions of clang on macOS break some tests in APR 1.6 (and older)
> -# configure (mostly around testing sizeof) due to errors now being fatal.
> -# Work around this by ignoring all errors
> -.IF "$(OS)"=="MACOSX"
> -XCPPFLAGS=-Wno-error=all
> -.ENDIF
> -
> -expat_CPPFLAGS=-I$(SOLARINCDIR)$/external
> -expat_LDFLAGS+=-L$(SOLARLIBDIR)
> -XCPPFLAGS+=$(expat_CPPFLAGS)
> -CONFIGURE_FLAGS+= SOLARINCDIR=$(SOLARINCDIR) SOLARLIBDIR=$(SOLARLIBDIR) \
> -	CPPFLAGS="$(XCPPFLAGS)" LDFLAGS=$(expat_LDFLAGS)
> -
> -# The non-standard names of our expat libraries (yes, plural) make 
> -# a special handling in apr-utils configure necessary.
> -PATCH_FILES+= $(TARFILE_NAME).expat.patch
> -
> -.ENDIF
> -
> -
> -BUILD_DIR=$(CONFIGURE_DIR)
> -BUILD_ACTION=$(GNUMAKE)
> -BUILD_FLAGS+= -j$(EXTMAXPROCESS)
> -
> -# Make apu-1-config believe that apr-util has been installed.
> -INSTALL_ACTION=if [ -f apu-1-config.orig ]; then mv -f apu-1-config.orig apu-1-config; fi;	\
> -	cp apu-1-config apu-1-config.orig;							\
> -	sed -e "s/^location=source/location=installed/;s/^\(installbuilddir=.*\)\/.*/\\1\/lib\/apr-util\"/" apu-1-config > apu-1-config.installed;								\
> -	mv -f apu-1-config.installed apu-1-config;	\
> -	chmod +x apu-1-config
> -
> -OUT2INC+=include$/apr*.h
> -OUT2INC+=include$/apu*.h
> -OUT2INC_SUBDIR=apr-util
> -
> -.IF "$(OS)"=="MACOSX"
> -OUT2LIB+=.libs/libaprutil-1.*dylib
> -.ELSE
> -OUT2LIB=.libs/libaprutil-1.so*
> -.ENDIF
> -OUT2BIN=apu-1-config
> -
> -.ENDIF
> -
> -# --- Targets ------------------------------------------------------
> -
> -.INCLUDE : set_ext.mk
> -.INCLUDE : target.mk
> -.INCLUDE : tg_ext.mk
> -
> -.ENDIF
> diff --git a/ext_libraries/apr-util/prj/build.lst b/ext_libraries/apr-util/prj/build.lst
> deleted file mode 100644
> index d205e1992e..0000000000
> --- a/ext_libraries/apr-util/prj/build.lst
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# adding dependence on sal due to used $gb_STDLIBS which contain uwinapi for Windows
> -# here a corresponding cleanup is needed as apr-util should not have a dependence on uwinapi
> -apru     apr-util :  sal APR:apr EXPAT:expat NULL
> -apru     apr-util usr1    -	all	apru_mkout NULL
> -apru     apr-util nmake	-	all	apru_apr-util NULL
> diff --git a/ext_libraries/apr-util/prj/d.lst b/ext_libraries/apr-util/prj/d.lst
> deleted file mode 100644
> index 5c67d11cf0..0000000000
> --- a/ext_libraries/apr-util/prj/d.lst
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -mkdir: %_DEST%\inc%_EXT%\apr-util
> -..\%__SRC%\inc\apr-util\apr*.h %_DEST%\inc%_EXT%\apr-util
> -..\%__SRC%\inc\apr-util\apu*.h %_DEST%\inc%_EXT%\apr-util
> -..\aprutil_version.mk %_DEST%\inc%_EXT%
> -
> -# Unixes
> -..\%__SRC%\bin\apu-1-config %_DEST%\bin%_EXT%
> -
> -# Linux
> -..\%__SRC%\lib\libaprutil-1.so.*.* %_DEST%\lib%_EXT%
> -..\%__SRC%\lib\libaprutil-1.so.* %_DEST%\lib%_EXT%
> -linklib: libaprutil-1.so.*
> -
> -# Mac
> -..\%__SRC%\lib\libaprutil-1.*dylib %_DEST%\lib%_EXT%
> diff --git a/ext_libraries/apr/apr-1.6.5-no-devenv.patch b/ext_libraries/apr/apr-1.6.5-no-devenv.patch
> deleted file mode 100644
> index 1f79190c41..0000000000
> --- a/ext_libraries/apr/apr-1.6.5-no-devenv.patch
> +++ /dev/null
> @@ -1,16 +0,0 @@
> ---- misc/build/apr-1.6.5/Makefile.win	2013-10-03 12:58:21.000000000 +0200
> -+++ misc/build/apr-1.6.5/Makefile.win	2016-07-26 12:59:58.183576182 +0200
> -@@ -26,12 +26,7 @@
> - #   nmake -f Makefile.win PREFIX=C:\APR buildall checkall install clean
> - #
> - 
> --!IF EXIST("apr.sln") && ([devenv /help > NUL 2>&1] == 0) \
> --    && !defined(USEMAK) && !defined(USEDSW)
> --USESLN=1
> --USEMAK=0
> --USEDSW=0
> --!ELSEIF EXIST("apr.mak") && !defined(USEDSW)
> -+!IF EXIST("apr.mak") && !defined(USEDSW)
> - USESLN=0
> - USEMAK=1
> - USEDSW=0
> diff --git a/ext_libraries/apr/apr-1.6.5-windows.patch b/ext_libraries/apr/apr-1.6.5-windows.patch
> deleted file mode 100644
> index 917573a934..0000000000
> --- a/ext_libraries/apr/apr-1.6.5-windows.patch
> +++ /dev/null
> @@ -1,11 +0,0 @@
> ---- misc/build/apr-1.6.5/Makefile.win	2018-03-05 05:48:04.021330400 +0200
> -+++ misc/build/apr-1.6.5/Makefile.win	2018-03-05 05:58:03.647346500 +0200
> -@@ -39,7 +39,7 @@
> - PREFIX=..\apr-dist
> - 
> - !IF [$(COMSPEC) /c cl /nologo /? \
> --	| $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0
> -+	| findstr.exe "x64" >NUL ] == 0
> - ARCH=x64 Release
> - !ELSE
> - ARCH=Win32 Release
> diff --git a/ext_libraries/apr/apr_version.mk b/ext_libraries/apr/apr_version.mk
> deleted file mode 100644
> index 3c924440f3..0000000000
> --- a/ext_libraries/apr/apr_version.mk
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -#**************************************************************
> -#
> -#  Licensed to the Apache Software Foundation (ASF) under one
> -#  or more contributor license agreements.  See the NOTICE file
> -#  distributed with this work for additional information
> -#  regarding copyright ownership.  The ASF licenses this file
> -#  to you under the Apache License, Version 2.0 (the
> -#  "License"); you may not use this file except in compliance
> -#  with the License.  You may obtain a copy of the License at
> -#
> -#    http://www.apache.org/licenses/LICENSE-2.0
> -#
> -#  Unless required by applicable law or agreed to in writing,
> -#  software distributed under the License is distributed on an
> -#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -#  KIND, either express or implied.  See the License for the
> -#  specific language governing permissions and limitations
> -#  under the License.
> -#
> -#**************************************************************
> -
> -APR_MAJOR=1
> -APR_MINOR=6
> -APR_MICRO=5
> diff --git a/ext_libraries/apr/makefile.mk b/ext_libraries/apr/makefile.mk
> deleted file mode 100644
> index ea007d9c23..0000000000
> --- a/ext_libraries/apr/makefile.mk
> +++ /dev/null
> @@ -1,128 +0,0 @@
> -#**************************************************************
> -#
> -#  Licensed to the Apache Software Foundation (ASF) under one
> -#  or more contributor license agreements.  See the NOTICE file
> -#  distributed with this work for additional information
> -#  regarding copyright ownership.  The ASF licenses this file
> -#  to you under the Apache License, Version 2.0 (the
> -#  "License"); you may not use this file except in compliance
> -#  with the License.  You may obtain a copy of the License at
> -#
> -#    http://www.apache.org/licenses/LICENSE-2.0
> -#
> -#  Unless required by applicable law or agreed to in writing,
> -#  software distributed under the License is distributed on an
> -#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -#  KIND, either express or implied.  See the License for the
> -#  specific language governing permissions and limitations
> -#  under the License.
> -#
> -#**************************************************************
> -
> -PRJ=.
> -
> -PRJNAME=apr
> -TARGET=apr
> -
> -# --- Settings -----------------------------------------------------
> -
> -.INCLUDE :	settings.mk
> -.INCLUDE :      apr_version.mk
> -
> -# --- Files --------------------------------------------------------
> -
> -.IF "$(SYSTEM_APR)"=="YES"
> -
> -all:
> -	@echo "Using system apr.  Does not have to be built."
> -
> -.ELSE
> -
> -# Assemble the full version number from the parts defined in apr_version.mk
> -APRVERSION=$(APR_MAJOR).$(APR_MINOR).$(APR_MICRO)
> -
> -TARFILE_NAME=$(PRJNAME)-$(APRVERSION)
> -TARFILE_MD5=0759294408daace192c935b7c9e76e04
> -
> -.IF "$(OS)"=="WNT"
> -
> -PATCH_FILES+= $(TARFILE_NAME)-no-devenv.patch
> -PATCH_FILES+= $(TARFILE_NAME)-windows.patch
> -CONFIGURE_ACTION=cp include/apr.hw include/apr.h
> -BUILD_DIR=
> -BUILD_ACTION=INCLUDE="$(INCLUDE);./include" USEMAK=1  nmake -f Makefile.win buildall
> -
> -.ELIF "$(GUI)" == "OS2"
> -
> -@all:
> -	@echo "using system apr. nothing do do."
> -
> -.ELSE
> -
> -CONFIGURE_DIR=
> -CONFIGURE_ACTION=.$/configure --prefix=$(OUTDIR) --includedir=$(OUTDIR)$/inc$/apr
> -
> -# Recent versions of clang (clang-12xxx) on macOS break some tests in APR 1.6 (and older)
> -# configure (mostly around testing sizeof) due to errors now being fatal.
> -# Work around this by ignoring all errors but only with the later versions of Xcode
> -.IF "$(OS)"=="MACOSX" && "$(COM)"=="CLANG" && "$(CCNUMVER)" > "001100000003"
> -CONFIGURE_FLAGS=CPPFLAGS="-Wno-error=all"
> -.ELSE
> -CONFIGURE_FLAGS=
> -.ENDIF
> -
> -BUILD_DIR=$(CONFIGURE_DIR)
> -BUILD_ACTION=$(GNUMAKE) --debug=b
> -#BUILD_FLAGS+= -j$(EXTMAXPROCESS)
> -
> -# Make apr-1-config believe that apr has been installed.
> -INSTALL_ACTION=if [ -f apr-1-config.orig ]; then mv -f apr-1-config.orig apr-1-config; fi;	\
> -	cp apr-1-config apr-1-config.orig;							\
> -	sed -e "s/^location=source/location=installed/;s/^\(installbuilddir=.*\)\/.*/\\1\/lib\/apr\"/" apr-1-config > apr-1-config.installed;								\
> -	mv -f apr-1-config.installed apr-1-config;	\
> -	chmod +x apr-1-config
> -
> -.ENDIF
> -
> -OUT2INC+=include$/apr*.h
> -OUT2INC_SUBDIR=apr
> -
> -.IF "$(OS)"=="WNT"
> -.IF "$(CPUNAME)"=="INTEL"
> -OUT2LIB+=LibR$/*.lib
> -OUT2LIB+=LibR$/*.pdb
> -OUT2LIB+=Release$/libaprapp-1.lib
> -OUT2LIB+=Release$/libaprapp-1.pdb
> -OUT2LIB+=Release$/libapr-1.lib
> -OUT2LIB+=Release$/libapr-1.exp
> -OUT2BIN+=Release$/libapr-1.dll
> -OUT2BIN+=Release$/libapr-1.pdb
> -.ELIF "$(CPUNAME)"=="X86_64"
> -OUT2LIB+=x64/LibR$/*.lib
> -OUT2LIB+=x64/LibR$/*.pdb
> -OUT2LIB+=x64/Release$/libaprapp-1.lib
> -OUT2LIB+=x64/Release$/libaprapp-1.pdb
> -OUT2LIB+=x64/Release$/libapr-1.lib
> -OUT2LIB+=x64/Release$/libapr-1.exp
> -OUT2BIN+=x64/Release$/libapr-1.dll
> -OUT2BIN+=x64/Release$/libapr-1.pdb
> -.ENDIF
> -.ELSE
> -.IF "$(OS)"=="MACOSX"
> -OUT2LIB+=.libs/libapr-1.*dylib
> -.ELSE
> -OUT2LIB+=.libs/libapr-1.so*
> -.ENDIF
> -OUT2BIN=build/apr_rules.mk
> -OUT2BIN+=libtool
> -OUT2BIN+=apr-1-config
> -.ENDIF
> -
> -
> -# --- Targets ------------------------------------------------------
> -
> -.INCLUDE : set_ext.mk
> -.INCLUDE : target.mk
> -.INCLUDE : tg_ext.mk
> -
> -.ENDIF
> diff --git a/ext_libraries/apr/prj/build.lst b/ext_libraries/apr/prj/build.lst
> deleted file mode 100644
> index 9393650666..0000000000
> --- a/ext_libraries/apr/prj/build.lst
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -apr     apr : solenv NULL	
> -apr     apr usr1    -	all	apr_mkout NULL
> -apr     apr nmake	-	all	apr_apr NULL
> diff --git a/ext_libraries/apr/prj/d.lst b/ext_libraries/apr/prj/d.lst
> deleted file mode 100644
> index 926421f9f7..0000000000
> --- a/ext_libraries/apr/prj/d.lst
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -mkdir: %_DEST%\inc%_EXT%\apr
> -mkdir: %_DEST%\lib%_EXT%\apr
> -
> -# Includes
> -..\%__SRC%\inc\apr\apr*.h %_DEST%\inc%_EXT%\apr
> -..\apr_version.mk %_DEST%\inc%_EXT%
> -
> -# Windows
> -..\%__SRC%\bin\libapr-1.dll %_DEST%\bin%_EXT%
> -..\%__SRC%\lib\libapr-1.lib %_DEST%\lib%_EXT%
> -
> -# Unixes
> -..\%__SRC%\bin\apr-1-config %_DEST%\bin%_EXT%
> -..\%__SRC%\bin\libtool %_DEST%\lib%_EXT%\apr
> -..\%__SRC%\bin\apr_rules.mk %_DEST%\lib%_EXT%\apr
> -
> -# Linux
> -..\%__SRC%\lib\libapr-1.so.*.* %_DEST%\lib%_EXT%
> -..\%__SRC%\lib\libapr-1.so.* %_DEST%\lib%_EXT%
> -linklib: libapr-1.so.*.*
> -linklib: libapr-1.so.*
> -
> -# Mac
> -..\%__SRC%\lib\libapr-1.*dylib %_DEST%\lib%_EXT%
> diff --git a/ext_libraries/serf/NULbytes.patch b/ext_libraries/serf/NULbytes.patch
> deleted file mode 100644
> index 12593d92e3..0000000000
> --- a/ext_libraries/serf/NULbytes.patch
> +++ /dev/null
> @@ -1,313 +0,0 @@
> -------------------------------------------------------------------------
> -r1699925 | breser | 2014-08-04 11:04:00 -0700 (Mon, 04 Aug 2014) | 5 lines
> -
> -On the 1.3.x branch: 
> -
> -Merge changes from trunk:
> -- r2392: Handle NUL bytes in fields of X.509 certs.
> -
> -------------------------------------------------------------------------
> -Index: misc/build/serf-1.2.1/buckets/ssl_buckets.c
> -===================================================================
> ---- misc/serf-1.2.1/buckets/ssl_buckets.c	(revision 1699924)
> -+++ misc/build/serf-1.2.1/buckets/ssl_buckets.c	(revision 1699925)
> -@@ -202,6 +202,8 @@
> - };
> - 
> - static void disable_compression(serf_ssl_context_t *ssl_ctx);
> -+static char *
> -+    pstrdup_escape_nul_bytes(const char *buf, int len, apr_pool_t *pool);
> - 
> - #if SSL_VERBOSE
> - /* Log all ssl alerts that we receive from the server. */
> -@@ -427,6 +429,81 @@
> - #endif
> - };
> - 
> -+typedef enum san_copy_t {
> -+    EscapeNulAndCopy = 0,
> -+    ErrorOnNul = 1,
> -+} san_copy_t;
> -+
> -+
> -+static apr_status_t
> -+get_subject_alt_names(apr_array_header_t **san_arr, X509 *ssl_cert,
> -+                      san_copy_t copy_action, apr_pool_t *pool)
> -+{
> -+    STACK_OF(GENERAL_NAME) *names;
> -+
> -+    /* assert: copy_action == ErrorOnNul || (san_arr && pool) */
> -+
> -+    /* Get subjectAltNames */
> -+    names = X509_get_ext_d2i(ssl_cert, NID_subject_alt_name, NULL, NULL);
> -+    if (names) {
> -+        int names_count = sk_GENERAL_NAME_num(names);
> -+        int name_idx;
> -+
> -+        if (san_arr)
> -+            *san_arr = apr_array_make(pool, names_count, sizeof(char*));
> -+        for (name_idx = 0; name_idx < names_count; name_idx++) {
> -+            char *p = NULL;
> -+            GENERAL_NAME *nm = sk_GENERAL_NAME_value(names, name_idx);
> -+
> -+            switch (nm->type) {
> -+                case GEN_DNS:
> -+                    if (copy_action == ErrorOnNul &&
> -+                        strlen(nm->d.ia5->data) != nm->d.ia5->length)
> -+                        return SERF_ERROR_SSL_CERT_FAILED;
> -+                    if (san_arr && *san_arr)
> -+                        p = pstrdup_escape_nul_bytes((const char *)nm->d.ia5->data,
> -+                                                     nm->d.ia5->length,
> -+                                                     pool);
> -+                    break;
> -+                default:
> -+                    /* Don't know what to do - skip. */
> -+                    break;
> -+            }
> -+
> -+            if (p) {
> -+                APR_ARRAY_PUSH(*san_arr, char*) = p;
> -+            }
> -+        }
> -+        sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free);
> -+    }
> -+    
> -+    return APR_SUCCESS;
> -+}
> -+
> -+static apr_status_t validate_cert_hostname(X509 *server_cert, apr_pool_t *pool)
> -+{
> -+    char buf[1024];
> -+    int length;
> -+    apr_status_t ret;
> -+
> -+    ret = get_subject_alt_names(NULL, server_cert, ErrorOnNul, NULL);
> -+    if (ret) {
> -+      return ret;
> -+    } else {
> -+        /* Fail if the subject's CN field contains \0 characters. */
> -+        X509_NAME *subject = X509_get_subject_name(server_cert);
> -+        if (!subject)
> -+            return SERF_ERROR_SSL_CERT_FAILED;
> -+
> -+        length = X509_NAME_get_text_by_NID(subject, NID_commonName, buf, 1024);
> -+        if (length != -1)
> -+            if (strlen(buf) != length)
> -+                return SERF_ERROR_SSL_CERT_FAILED;
> -+    }
> -+
> -+    return APR_SUCCESS;
> -+}
> -+
> - static int
> - validate_server_certificate(int cert_valid, X509_STORE_CTX *store_ctx)
> - {
> -@@ -435,6 +512,7 @@
> -     X509 *server_cert;
> -     int err, depth;
> -     int failures = 0;
> -+    apr_status_t status;
> - 
> -     ssl = X509_STORE_CTX_get_ex_data(store_ctx,
> -                                      SSL_get_ex_data_X509_STORE_CTX_idx());
> -@@ -475,6 +553,11 @@
> -         }
> -     }
> - 
> -+    /* Validate hostname */
> -+    status = validate_cert_hostname(server_cert, ctx->pool);
> -+    if (status)
> -+        failures |= SERF_SSL_CERT_UNKNOWN_FAILURE;
> -+
> -     /* Check certificate expiry dates. */
> -     if (X509_cmp_current_time(X509_get_notBefore(server_cert)) >= 0) {
> -         failures |= SERF_SSL_CERT_NOTYETVALID;
> -@@ -485,7 +568,6 @@
> - 
> -     if (ctx->server_cert_callback &&
> -         (depth == 0 || failures)) {
> --        apr_status_t status;
> -         serf_ssl_certificate_t *cert;
> -         apr_pool_t *subpool;
> - 
> -@@ -512,7 +594,6 @@
> - 
> -     if (ctx->server_cert_chain_callback
> -         && (depth == 0 || failures)) {
> --        apr_status_t status;
> -         STACK_OF(X509) *chain;
> -         const serf_ssl_certificate_t **certs;
> -         int certs_len;
> -@@ -1461,7 +1542,50 @@
> - 
> - /* Functions to read a serf_ssl_certificate structure. */
> - 
> --/* Creates a hash_table with keys (E, CN, OU, O, L, ST and C). */
> -+/* Takes a counted length string and escapes any NUL bytes so that
> -+ * it can be used as a C string.  NUL bytes are escaped as 3 characters
> -+ * "\00" (that's a literal backslash).
> -+ * The returned string is allocated in POOL.
> -+ */
> -+static char *
> -+pstrdup_escape_nul_bytes(const char *buf, int len, apr_pool_t *pool)
> -+{
> -+    int i, nul_count = 0;
> -+    char *ret;
> -+
> -+    /* First determine if there are any nul bytes in the string. */
> -+    for (i = 0; i < len; i++) {
> -+        if (buf[i] == '\0')
> -+            nul_count++;
> -+    }
> -+
> -+    if (nul_count == 0) {
> -+        /* There aren't so easy case to just copy the string */
> -+        ret = apr_pstrdup(pool, buf);
> -+    } else {
> -+        /* There are so we have to replace nul bytes with escape codes
> -+         * Proper length is the length of the original string, plus
> -+         * 2 times the number of nulls (for two digit hex code for
> -+         * the value) + the trailing null. */
> -+        char *pos;
> -+        ret = pos = apr_palloc(pool, len + 2 * nul_count + 1);
> -+        for (i = 0; i < len; i++) {
> -+            if (buf[i] != '\0') {
> -+                *(pos++) = buf[i];
> -+            } else {
> -+                *(pos++) = '\\';
> -+                *(pos++) = '0';
> -+                *(pos++) = '0';
> -+            }
> -+        }
> -+        *pos = '\0';
> -+    }
> -+
> -+    return ret;
> -+}
> -+
> -+/* Creates a hash_table with keys (E, CN, OU, O, L, ST and C). Any NUL bytes in
> -+   these fields in the certificate will be escaped as \00. */
> - static apr_hash_t *
> - convert_X509_NAME_to_table(X509_NAME *org, apr_pool_t *pool)
> - {
> -@@ -1474,37 +1598,44 @@
> -                                     NID_commonName,
> -                                     buf, 1024);
> -     if (ret != -1)
> --        apr_hash_set(tgt, "CN", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
> -+        apr_hash_set(tgt, "CN", APR_HASH_KEY_STRING,
> -+                     pstrdup_escape_nul_bytes(buf, ret, pool));
> -     ret = X509_NAME_get_text_by_NID(org,
> -                                     NID_pkcs9_emailAddress,
> -                                     buf, 1024);
> -     if (ret != -1)
> --        apr_hash_set(tgt, "E", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
> -+        apr_hash_set(tgt, "E", APR_HASH_KEY_STRING,
> -+                     pstrdup_escape_nul_bytes(buf, ret, pool));
> -     ret = X509_NAME_get_text_by_NID(org,
> -                                     NID_organizationalUnitName,
> -                                     buf, 1024);
> -     if (ret != -1)
> --        apr_hash_set(tgt, "OU", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
> -+        apr_hash_set(tgt, "OU", APR_HASH_KEY_STRING,
> -+                     pstrdup_escape_nul_bytes(buf, ret, pool));
> -     ret = X509_NAME_get_text_by_NID(org,
> -                                     NID_organizationName,
> -                                     buf, 1024);
> -     if (ret != -1)
> --        apr_hash_set(tgt, "O", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
> -+        apr_hash_set(tgt, "O", APR_HASH_KEY_STRING,
> -+                     pstrdup_escape_nul_bytes(buf, ret, pool));
> -     ret = X509_NAME_get_text_by_NID(org,
> -                                     NID_localityName,
> -                                     buf, 1024);
> -     if (ret != -1)
> --        apr_hash_set(tgt, "L", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
> -+        apr_hash_set(tgt, "L", APR_HASH_KEY_STRING,
> -+                     pstrdup_escape_nul_bytes(buf, ret, pool));
> -     ret = X509_NAME_get_text_by_NID(org,
> -                                     NID_stateOrProvinceName,
> -                                     buf, 1024);
> -     if (ret != -1)
> --        apr_hash_set(tgt, "ST", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
> -+        apr_hash_set(tgt, "ST", APR_HASH_KEY_STRING,
> -+                     pstrdup_escape_nul_bytes(buf, ret, pool));
> -     ret = X509_NAME_get_text_by_NID(org,
> -                                     NID_countryName,
> -                                     buf, 1024);
> -     if (ret != -1)
> --        apr_hash_set(tgt, "C", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
> -+        apr_hash_set(tgt, "C", APR_HASH_KEY_STRING,
> -+                     pstrdup_escape_nul_bytes(buf, ret, pool));
> - 
> -     return tgt;
> - }
> -@@ -1550,7 +1681,7 @@
> -     unsigned int md_size, i;
> -     unsigned char md[EVP_MAX_MD_SIZE];
> -     BIO *bio;
> --    STACK_OF(GENERAL_NAME) *names;
> -+    apr_array_header_t *san_arr;
> - 
> -     /* sha1 fingerprint */
> -     if (X509_digest(cert->ssl_cert, EVP_sha1(), md, &md_size)) {
> -@@ -1595,33 +1726,9 @@
> -     BIO_free(bio);
> - 
> -     /* Get subjectAltNames */
> --    names = X509_get_ext_d2i(cert->ssl_cert, NID_subject_alt_name, NULL, NULL);
> --    if (names) {
> --        int names_count = sk_GENERAL_NAME_num(names);
> --
> --        apr_array_header_t *san_arr = apr_array_make(pool, names_count,
> --                                                     sizeof(char*));
> -+    if (!get_subject_alt_names(&san_arr, cert->ssl_cert, EscapeNulAndCopy, pool))
> -         apr_hash_set(tgt, "subjectAltName", APR_HASH_KEY_STRING, san_arr);
> --        for (i = 0; i < names_count; i++) {
> --            char *p = NULL;
> --            GENERAL_NAME *nm = sk_GENERAL_NAME_value(names, i);
> - 
> --            switch (nm->type) {
> --            case GEN_DNS:
> --                p = apr_pstrmemdup(pool, (const char *)nm->d.ia5->data,
> --                                   nm->d.ia5->length);
> --                break;
> --            default:
> --                /* Don't know what to do - skip. */
> --                break;
> --            }
> --            if (p) {
> --                APR_ARRAY_PUSH(san_arr, char*) = p;
> --            }
> --        }
> --        sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free);
> --    }
> --
> -     return tgt;
> - }
> - 
> -------------------------------------------------------------------------
> -r1699931 | breser | 2014-08-05 19:24:00 -0700 (Tue, 05 Aug 2014) | 6 lines
> -
> -On the 1.3.x branch: 
> -
> -Merge changes from trunk:
> -- r2398: Initialize san_arr when we're expected to fill it.
> -
> -
> -------------------------------------------------------------------------
> -Index: misc/build/serf-1.2.1/buckets/ssl_buckets.c
> -===================================================================
> ---- misc/serf-1.2.1/buckets/ssl_buckets.c	(revision 1699930)
> -+++ misc/build/serf-1.2.1/buckets/ssl_buckets.c	(revision 1699931)
> -@@ -443,6 +443,10 @@
> - 
> -     /* assert: copy_action == ErrorOnNul || (san_arr && pool) */
> - 
> -+    if (san_arr) {
> -+        *san_arr = NULL;
> -+    }
> -+
> -     /* Get subjectAltNames */
> -     names = X509_get_ext_d2i(ssl_cert, NID_subject_alt_name, NULL, NULL);
> -     if (names) {
> diff --git a/ext_libraries/serf/makefile.mk b/ext_libraries/serf/makefile.mk
> deleted file mode 100644
> index d3f7c553ac..0000000000
> --- a/ext_libraries/serf/makefile.mk
> +++ /dev/null
> @@ -1,134 +0,0 @@
> -#**************************************************************
> -#
> -#  Licensed to the Apache Software Foundation (ASF) under one
> -#  or more contributor license agreements.  See the NOTICE file
> -#  distributed with this work for additional information
> -#  regarding copyright ownership.  The ASF licenses this file
> -#  to you under the Apache License, Version 2.0 (the
> -#  "License"); you may not use this file except in compliance
> -#  with the License.  You may obtain a copy of the License at
> -#
> -#    http://www.apache.org/licenses/LICENSE-2.0
> -#
> -#  Unless required by applicable law or agreed to in writing,
> -#  software distributed under the License is distributed on an
> -#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -#  KIND, either express or implied.  See the License for the
> -#  specific language governing permissions and limitations
> -#  under the License.
> -#
> -#**************************************************************
> -
> -PRJ=.
> -
> -PRJNAME=serf
> -TARGET=so_serf
> -
> -# --- Settings -----------------------------------------------------
> -
> -.INCLUDE :	settings.mk
> -.INCLUDE :	serf_version.mk
> -
> -# --- Files --------------------------------------------------------
> -
> -.IF "$(SYSTEM_SERF)"=="YES"
> -
> -all:
> -	@echo "Using system serf.  Does not have to be built."
> -
> -.ELSE
> -
> -# Assemble the full version number from the parts defined in serf_version.mk
> -LIBSERFVERSION=$(SERF_MAJOR).$(SERF_MINOR).$(SERF_MICRO)
> -
> -TARFILE_NAME=$(PRJNAME)-$(LIBSERFVERSION)
> -# This is the SHA1 checksum, not MD5 but tg_ext.mk does not now about this and,
> -# thankfully, does not care.
> -TARFILE_MD5=f65fbbd72926c8e7cf0dbd4ada03b0d226f461fd
> -
> -PATCH_FILES=NULbytes.patch
> -
> -.IF "$(OS)"=="WNT"
> -
> -CONFIGURE_DIR=
> -CONFIGURE_ACTION=
> -CONFIGURE_FLAGS=
> -
> -BUILD_DIR=
> -BUILD_ACTION=$(GNUMAKE)
> -BUILD_FLAGS+= -f ../../../../win/Makefile -j$(EXTMAXPROCESS)
> -
> -.ELIF "$(GUI)" == "OS2"
> -
> -@all:
> -	@echo "using system serf. nothing do do."
> -
> -.ELSE
> -
> -.IF "$(OS)"=="MACOSX" || "$(OS)"=="FREEBSD" || "$(OS)"=="LINUX"
> -# Do not link against expat.  It is not necessary (apr-util is already linked against it)
> -# and does not work (we use a different expat library schema.)
> -PATCH_FILES+=$(TARFILE_NAME).libs.patch
> -.ENDIF
> -
> -.IF "$(OS)"=="LINUX"
> -# Add -ldl as last library so that the linker has no trouble resolving dependencies.
> -PATCH_FILES+=$(TARFILE_NAME).ldl.patch
> -.ENDIF
> -
> -# Export ENABLE_SERF_LOGGING=YES to enable serf logging
> -.IF "$(ENABLE_SERF_LOGGING)" == "YES"
> -PATCH_FILES+=$(TARFILE_NAME).logging.patch
> -CDEFS+=-DENABLE_SERF_VERBOSE -DSERF_VERBOSE
> -.ENDIF
> -
> -CONFIGURE_DIR=
> -CONFIGURE_ACTION=autoconf && .$/configure
> -
> -.IF "$(OS)"=="LINUX"
> -.IF "$(SYSTEM_OPENSSL)"=="YES"
> -CDEFS+=$(OPENSSL_CFLAGS)
> -.ELSE
> -OPENSSLINCDIR=external
> -CDEFS+=-I$(SOLARINCDIR)$/$(OPENSSLINCDIR)
> -.ENDIF
> -.ENDIF
> -
> -# On Linux/Mac we need the content of CDEFS in CFLAGS so that the ssl headers are searched for
> -.IF "$(OS)"=="MACOSX" || "$(OS)"=="LINUX"
> -# in a directory that corresponds to the directory that is searched for the ssl library.
> -CONFIGURE_FLAGS='CFLAGS=$(CDEFS)'
> -.ENDIF
> -
> -BUILD_DIR=$(CONFIGURE_DIR)
> -BUILD_ACTION=$(GNUMAKE)
> -BUILD_FLAGS+= -j$(EXTMAXPROCESS)
> -
> -.IF "$(OS)"=="MACOSX"
> -# Serf names its library only with the major number.
> -# We are using minor and micro as well.  Fix that here
> -# by creating a copy with the right name.
> -SERF_ORIGINAL_LIB=.libs/libserf-$(SERF_MAJOR).0.dylib
> -SERF_FIXED_LIB=.libs/libserf-$(LIBSERFVERSION).0.dylib
> -INSTALL_ACTION=if [ -f "$(SERF_ORIGINAL_LIB)" -a ! -f "$(SERF_FIXED_LIB)" ]; then cp $(SERF_ORIGINAL_LIB) $(SERF_FIXED_LIB); fi	 
> -.ENDIF
> -
> -OUT2INC+=serf*.h
> -OUT2INC_SUBDIR=serf
> -
> -.IF "$(OS)"=="MACOSX"
> -OUT2LIB+=$(SERF_FIXED_LIB)
> -OUT2LIB+=.libs/libserf-1.*dylib
> -.ELSE
> -OUT2LIB=.libs/libserf-1.so*
> -.ENDIF
> -
> -.ENDIF
> -
> -# --- Targets ------------------------------------------------------
> -
> -.INCLUDE : set_ext.mk
> -.INCLUDE : target.mk
> -.INCLUDE : tg_ext.mk
> -
> -.ENDIF
> diff --git a/ext_libraries/serf/prj/build.lst b/ext_libraries/serf/prj/build.lst
> deleted file mode 100644
> index ccde897f4a..0000000000
> --- a/ext_libraries/serf/prj/build.lst
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -serf     serf :  APR_UTIL:apr-util OPENSSL:openssl NULL	
> -serf     serf usr1    -	all	serf_mkout NULL
> -serf     serf nmake	-	all	serf_serf NULL
> diff --git a/ext_libraries/serf/prj/d.lst b/ext_libraries/serf/prj/d.lst
> deleted file mode 100644
> index 29c8eb6c60..0000000000
> --- a/ext_libraries/serf/prj/d.lst
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -mkdir: %_DEST%\inc%_EXT%\serf
> -..\%__SRC%\inc\serf\serf*.h %_DEST%\inc%_EXT%\serf
> -..\serf_version.mk %_DEST%\inc%_EXT%
> -
> -# Mac
> -..\%__SRC%\lib\libserf-1.*dylib %_DEST%\lib%_EXT%
> -
> -# Linux, BSD, et al
> -..\%__SRC%\lib\libserf-1.so.*.* %_DEST%\lib%_EXT%
> -..\%__SRC%\lib\libserf-1.so.* %_DEST%\lib%_EXT%
> -linklib: libserf-1.so.*.*
> -linklib: libserf-1.so.*
> diff --git a/ext_libraries/serf/serf-1.2.1.ldl.patch b/ext_libraries/serf/serf-1.2.1.ldl.patch
> deleted file mode 100644
> index 9b2758d04c..0000000000
> --- a/ext_libraries/serf/serf-1.2.1.ldl.patch
> +++ /dev/null
> @@ -1,11 +0,0 @@
> ---- misc/serf-1.2.1/Makefile.in	2013-06-03 15:21:14.000000000 -0300
> -+++ misc/build/serf-1.2.1/Makefile.in	2013-06-07 12:31:04.416862903 -0300
> -@@ -56,7 +56,7 @@ MKDIR = @mkdir_p@
> - INSTALL = @INSTALL@
> - 
> - LDFLAGS = @EXTRA_LDFLAGS@ @LDFLAGS@
> --LIBS = @EXTRA_LIBS@  @SERF_LIBS@ -lz -lssl -lcrypto
> -+LIBS = @EXTRA_LIBS@  @SERF_LIBS@ -lz -lssl -lcrypto -ldl
> - 
> - all: $(TARGET_LIB) $(PROGRAMS)
> - 
> diff --git a/ext_libraries/serf/serf-1.2.1.libs.patch b/ext_libraries/serf/serf-1.2.1.libs.patch
> deleted file mode 100644
> index 8224203530..0000000000
> --- a/ext_libraries/serf/serf-1.2.1.libs.patch
> +++ /dev/null
> @@ -1,11 +0,0 @@
> ---- misc/serf-1.2.1/configure.in	2013-06-03 14:52:41.000000000 -0300
> -+++ misc/build/serf-1.2.1/configure.in	2013-06-07 12:27:36.914098933 -0300
> -@@ -257,7 +257,7 @@ AC_SEARCH_LIBS(fabs, m)
> - 
> - libs=""
> - if test -n "$apu_config"; then
> --  APR_ADDTO(libs, [`$apu_config --link-libtool --libs`])
> -+  APR_ADDTO(libs, [`$apu_config --link-libtool`])
> - fi
> - APR_ADDTO(libs, [`$apr_config --link-libtool --libs` $LIBS])
> - 
> diff --git a/ext_libraries/serf/serf-1.2.1.logging.patch b/ext_libraries/serf/serf-1.2.1.logging.patch
> deleted file mode 100644
> index a0714434d1..0000000000
> --- a/ext_libraries/serf/serf-1.2.1.logging.patch
> +++ /dev/null
> @@ -1,27 +0,0 @@
> ---- misc/serf-1.2.1/serf_private.h	2013-06-03 14:22:51.000000000 -0300
> -+++ misc/build/serf-1.2.1/serf_private.h	2013-06-07 12:33:34.432688365 -0300
> -@@ -32,12 +32,18 @@
> - 
> - /* Internal logging facilities, set flag to 1 to enable console logging for
> -    the selected component. */
> --#define SSL_VERBOSE 0
> --#define SSL_MSG_VERBOSE 0  /* logs decrypted requests and responses. */
> --#define SOCK_VERBOSE 0
> --#define SOCK_MSG_VERBOSE 0 /* logs bytes received from or written to a socket. */
> --#define CONN_VERBOSE 0
> --#define AUTH_VERBOSE 0
> -+#ifdef ENABLE_SERF_VERBOSE
> -+#define SERF_VERBOSE_FLAG 1
> -+#else
> -+#define SERF_VERBOSE_FLAG 0
> -+#endif
> -+
> -+#define SSL_VERBOSE         SERF_VERBOSE_FLAG
> -+#define SSL_MSG_VERBOSE     SERF_VERBOSE_FLAG  /* logs decrypted requests and responses. */
> -+#define SOCK_VERBOSE        SERF_VERBOSE_FLAG
> -+#define SOCK_MSG_VERBOSE    SERF_VERBOSE_FLAG /* logs bytes received from or written to a socket. */
> -+#define CONN_VERBOSE        SERF_VERBOSE_FLAG
> -+#define AUTH_VERBOSE        SERF_VERBOSE_FLAG
> - 
> - 
> - typedef struct serf__authn_scheme_t serf__authn_scheme_t;
> diff --git a/ext_libraries/serf/serf_version.mk b/ext_libraries/serf/serf_version.mk
> deleted file mode 100644
> index 4cf137984f..0000000000
> --- a/ext_libraries/serf/serf_version.mk
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -#**************************************************************
> -#
> -#  Licensed to the Apache Software Foundation (ASF) under one
> -#  or more contributor license agreements.  See the NOTICE file
> -#  distributed with this work for additional information
> -#  regarding copyright ownership.  The ASF licenses this file
> -#  to you under the Apache License, Version 2.0 (the
> -#  "License"); you may not use this file except in compliance
> -#  with the License.  You may obtain a copy of the License at
> -#
> -#    http://www.apache.org/licenses/LICENSE-2.0
> -#
> -#  Unless required by applicable law or agreed to in writing,
> -#  software distributed under the License is distributed on an
> -#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -#  KIND, either express or implied.  See the License for the
> -#  specific language governing permissions and limitations
> -#  under the License.
> -#
> -#**************************************************************
> -
> -SERF_MAJOR=1
> -SERF_MINOR=2
> -SERF_MICRO=1
> diff --git a/ext_libraries/serf/win/Library_serf.mk b/ext_libraries/serf/win/Library_serf.mk
> deleted file mode 100755
> index 64e0861e37..0000000000
> --- a/ext_libraries/serf/win/Library_serf.mk
> +++ /dev/null
> @@ -1,89 +0,0 @@
> -#/**************************************************************
> -# * 
> -# * Licensed to the Apache Software Foundation (ASF) under one
> -# * or more contributor license agreements.  See the NOTICE file
> -# * distributed with this work for additional information
> -# * regarding copyright ownership.  The ASF licenses this file
> -# * to you under the Apache License, Version 2.0 (the
> -# * "License"); you may not use this file except in compliance
> -# * with the License.  You may obtain a copy of the License at
> -# * 
> -# *   http://www.apache.org/licenses/LICENSE-2.0
> -# * 
> -# * Unless required by applicable law or agreed to in writing,
> -# * software distributed under the License is distributed on an
> -# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -# * KIND, either express or implied.  See the License for the
> -# * specific language governing permissions and limitations
> -# * under the License.
> -# * 
> -# *************************************************************/
> -
> -$(eval $(call gb_Library_Library,serf))
> -
> -$(eval $(call gb_Library_add_package_headers,serf,serf_inc))
> -
> -$(eval $(call gb_Library_set_include,serf,\
> -	$$(INCLUDE) \
> -	-I. \
> -	-I$(OUTDIR)/inc/apr \
> -	-I$(OUTDIR)/inc/apr-util \
> -	-I$(OUTDIR)/inc/external/zlib \
> -))
> -
> -$(eval $(call gb_Library_add_defs,serf,\
> -	-DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DWIN32_EXPORTS \
> -))
> -
> -ORIGINAL_DEF_FILE=build/serf.def
> -FIXED_DEF_FILE=build/fixed-serf.def
> -
> -$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,serf)) : $(FIXED_DEF_FILE)
> -$(FIXED_DEF_FILE) : $(ORIGINAL_DEF_FILE)
> -	cp $< $@
> -	echo serf_bucket_request_set_CL >> $@
> -
> -$(eval $(call gb_Library_add_ldflags,serf,\
> -	-DEF:$(FIXED_DEF_FILE)	\
> -))
> -
> -$(eval $(call gb_Library_add_linked_libs,serf,\
> -	apr \
> -	apr-util \
> -	libeay32 \
> -	ssleay32 \
> -	zlib \
> -    $(gb_STDLIBS) \
> -))
> -
> -$(eval $(call gb_Library_add_cobjects,serf,\
> -	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth_basic \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth_digest \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth_kerb \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth_kerb_gss \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth_kerb_sspi \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/aggregate_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/allocator \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/barrier_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/bwtp_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/chunk_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/dechunk_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/deflate_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/file_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/headers_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/iovec_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/limit_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/mmap_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/request_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/response_body_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/response_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/simple_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/socket_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/ssl_buckets \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/context \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/incoming \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/outgoing \
> -	serf/$(INPATH)/misc/build/serf-1.2.1/ssltunnel \
> -))
> diff --git a/ext_libraries/serf/win/Makefile b/ext_libraries/serf/win/Makefile
> deleted file mode 100755
> index 8dfd47b297..0000000000
> --- a/ext_libraries/serf/win/Makefile
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -#/**************************************************************
> -# * 
> -# * Licensed to the Apache Software Foundation (ASF) under one
> -# * or more contributor license agreements.  See the NOTICE file
> -# * distributed with this work for additional information
> -# * regarding copyright ownership.  The ASF licenses this file
> -# * to you under the Apache License, Version 2.0 (the
> -# * "License"); you may not use this file except in compliance
> -# * with the License.  You may obtain a copy of the License at
> -# * 
> -# *   http://www.apache.org/licenses/LICENSE-2.0
> -# * 
> -# * Unless required by applicable law or agreed to in writing,
> -# * software distributed under the License is distributed on an
> -# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -# * KIND, either express or implied.  See the License for the
> -# * specific language governing permissions and limitations
> -# * under the License.
> -# * 
> -# *************************************************************/
> -
> -ifeq ($(strip $(SOLARENV)),)
> -$(error No environment set!)
> -endif
> -
> -gb_PARTIALBUILD := T
> -GBUILDDIR := $(SOLARENV)/gbuild
> -include $(GBUILDDIR)/gbuild.mk
> -
> -$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))Module*.mk)))
> diff --git a/ext_libraries/serf/win/Module_serf.mk b/ext_libraries/serf/win/Module_serf.mk
> deleted file mode 100755
> index 2258d05e3f..0000000000
> --- a/ext_libraries/serf/win/Module_serf.mk
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -#/**************************************************************
> -# * 
> -# * Licensed to the Apache Software Foundation (ASF) under one
> -# * or more contributor license agreements.  See the NOTICE file
> -# * distributed with this work for additional information
> -# * regarding copyright ownership.  The ASF licenses this file
> -# * to you under the Apache License, Version 2.0 (the
> -# * "License"); you may not use this file except in compliance
> -# * with the License.  You may obtain a copy of the License at
> -# * 
> -# *   http://www.apache.org/licenses/LICENSE-2.0
> -# * 
> -# * Unless required by applicable law or agreed to in writing,
> -# * software distributed under the License is distributed on an
> -# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -# * KIND, either express or implied.  See the License for the
> -# * specific language governing permissions and limitations
> -# * under the License.
> -# * 
> -# *************************************************************/
> -
> -$(eval $(call gb_Module_Module,serf))
> -
> -$(eval $(call gb_Module_add_targets,serf,\
> -	Library_serf \
> -	Package_inc \
> -))
> diff --git a/ext_libraries/serf/win/Package_inc.mk b/ext_libraries/serf/win/Package_inc.mk
> deleted file mode 100755
> index 7d47447e57..0000000000
> --- a/ext_libraries/serf/win/Package_inc.mk
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -#/**************************************************************
> -# * 
> -# * Licensed to the Apache Software Foundation (ASF) under one
> -# * or more contributor license agreements.  See the NOTICE file
> -# * distributed with this work for additional information
> -# * regarding copyright ownership.  The ASF licenses this file
> -# * to you under the Apache License, Version 2.0 (the
> -# * "License"); you may not use this file except in compliance
> -# * with the License.  You may obtain a copy of the License at
> -# * 
> -# *   http://www.apache.org/licenses/LICENSE-2.0
> -# * 
> -# * Unless required by applicable law or agreed to in writing,
> -# * software distributed under the License is distributed on an
> -# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -# * KIND, either express or implied.  See the License for the
> -# * specific language governing permissions and limitations
> -# * under the License.
> -# * 
> -# *************************************************************/
> -
> -$(eval $(call gb_Package_Package,serf_inc,$(EXT_LIBRARIES)/serf/$(INPATH)/misc/build/serf-1.2.1))
> -$(eval $(call gb_Package_add_files, serf_inc, inc/serf,        \
> -       serf.h                                                  \
> -       serf_bucket_types.h                                     \
> -       serf_bucket_util.h                                      \
> -       ))
> diff --git a/main/NOTICE b/main/NOTICE
> index 0b8baa42fa..43d0de4cc7 100644
> --- a/main/NOTICE
> +++ b/main/NOTICE
> @@ -172,17 +172,11 @@ ____
> 
> As part of the base system this product also includes code from the following
> projects which are licensed under the Apache license:
> -- serf
> - redland
> - StAX
> 
> The notices from these projects are following:
> 
> -serf
> -This product includes software developed by
> -The Apache Software Foundation (https://www.apache.org/).
> -
> -
> redland
> This product includes Redland software (http://librdf.org/)
> developed at the Institute for Learning and Research Technology,
> diff --git a/main/RepositoryExternal.mk b/main/RepositoryExternal.mk
> index 44c91900e8..afc4420ba1 100644
> --- a/main/RepositoryExternal.mk
> +++ b/main/RepositoryExternal.mk
> @@ -396,112 +396,6 @@ endef
> endif # SYSTEM_OPENSSL
> 
> 
> -ifeq ($(SYSTEM_APR),YES)
> -
> -define gb_LinkTarget__use_apr
> -$(call gb_LinkTarget_add_defs,$(1),\
> -		-DSYSTEM_APR \
> -)
> -$(call gb_LinkTarget_set_include,$(1),\
> -	$$(INCLUDE) \
> -	$(APR_CFLAGS) \
> -)
> -$(call gb_LinkTarget_add_libs,$(1),$(APR_LIBS))
> -endef
> -
> -else # !SYSTEM_APR
> -
> -ifeq ($(OS),WNT)
> -$(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE,libapr-1))
> -else
> -$(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE,apr-1))
> -endif
> -
> -define gb_LinkTarget__use_apr
> -$(call gb_LinkTarget_set_include,$(1),\
> -	$$(INCLUDE) \
> -	-I$(OUTDIR)/inc/apr \
> -)
> -ifeq ($(OS),WNT)
> -$(call gb_LinkTarget_add_linked_libs,$(1),libapr-1)
> -else
> -$(call gb_LinkTarget_add_linked_libs,$(1),apr-1)
> -endif
> -endef
> -
> -endif # SYSTEM_APR
> -
> -
> -ifeq ($(SYSTEM_APR_UTIL),YES)
> -
> -define gb_LinkTarget__use_apr_util
> -$(call gb_LinkTarget_add_defs,$(1),\
> -	-DSYSTEM_APR_UTIL \
> -)
> -$(call gb_LinkTarget_set_include,$(1),\
> -	$$(INCLUDE) \
> -	$(APR_UTIL_CFLAGS) \
> -)
> -$(call gb_LinkTarget_add_libs,$(1),$(APR_UTIL_LIBS))
> -endef
> -
> -else # !SYSTEM_APR_UTIL
> -
> -# on Windows apr-util is registered by ext_libraries/Repository.mk
> -ifneq ($(OS),WNT)
> -$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,aprutil-1))
> -endif
> -
> -define gb_LinkTarget__use_apr_util
> -$(call gb_LinkTarget_set_include,$(1),\
> -	$$(INCLUDE) \
> -	-I$(OUTDIR)/inc/apr-util \
> -)
> -ifeq ($(OS),WNT)
> -$(call gb_LinkTarget_add_linked_libs,$(1),apr-util)
> -else
> -$(call gb_LinkTarget_add_linked_libs,$(1),aprutil-1)
> -endif
> -endef
> -
> -endif # SYSTEM_APR_UTIL
> -
> -
> -ifeq ($(SYSTEM_SERF),YES)
> -
> -define gb_LinkTarget__use_serf
> -$(call gb_LinkTarget_add_defs,$(1),\
> -	-DSYSTEM_SERF \
> -)
> -$(call gb_LinkTarget_set_include,$(1),\
> -	$$(INCLUDE) \
> -	$(SERF_CFLAGS) \
> -)
> -$(call gb_LinkTarget_add_libs,$(1),$(SERF_LIBS))
> -endef
> -
> -else # !SYSTEM_SERF
> -
> -# on Windows serf is registered by ext_libraries/Repository.mk
> -ifneq ($(OS),WNT)
> -$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,serf-1))
> -endif
> -
> -define gb_LinkTarget__use_serf
> -$(call gb_LinkTarget_set_include,$(1),\
> -	$$(INCLUDE) \
> -	-I$(OUTDIR)/inc/serf \
> -)
> -ifeq ($(OS),WNT)
> -$(call gb_LinkTarget_add_linked_libs,$(1),serf)
> -else
> -$(call gb_LinkTarget_add_linked_libs,$(1),serf-1)
> -endif
> -endef
> -
> -endif # SYSTEM_SERF
> -
> -
> ifeq ($(SYSTEM_CURL),YES)
> 
> define gb_LinkTarget__use_curl
> diff --git a/main/configure.ac b/main/configure.ac
> index e0ba7564f4..62cd7932f4 100644
> --- a/main/configure.ac
> +++ b/main/configure.ac
> @@ -772,15 +772,6 @@ AC_ARG_WITH(local-solver,
> AC_ARG_ENABLE(javascript,
> [  --disable-javascript    Disables support for JavaScript macros.
> ],,)
> -AC_ARG_WITH(system-apr,
> -[  --with-system-apr       Use apr library already installed on the system
> -],,)
> -AC_ARG_WITH(system-apr-util,
> -[  --with-system-apr-util  Use apr-util library already installed on the system
> -],,)
> -AC_ARG_WITH(system-serf,
> -[  --with-system-serf      Use serf library already installed on the system
> -],,)
> AC_ARG_WITH(system-coinmp,
> [  --with-system-coinmp    Use CoinMP library already installed on the system
> ],,)
> @@ -4437,70 +4428,6 @@ fi
> AC_SUBST(ENABLE_JAVASCRIPT)
> 
> 
> -dnl ===================================================================
> -dnl Check for system apr
> -dnl ===================================================================
> -SYSTEM_APR=NO
> -APR_CFLAGS=
> -APR_LIBS=
> -AC_MSG_CHECKING([which libapr to use])
> -if test "x$with_system_apr" = "xyes" -o -n "$with_system_libs"; then
> -    AC_MSG_RESULT([system])
> -    PKG_CHECK_MODULES([APR], [apr-1 >= 1.0])
> -    SYSTEM_APR=YES
> -else
> -    AC_MSG_RESULT([internal])
> -    SYSTEM_APR=NO
> -    BUILD_TYPE="$BUILD_TYPE APR"
> -fi
> -AC_SUBST(SYSTEM_APR)
> -AC_SUBST(APR_CFLAGS)
> -AC_SUBST(APR_LIBS)
> -
> -
> -dnl ===================================================================
> -dnl Check for system apr-util
> -dnl ===================================================================
> -SYSTEM_APR_UTIL=NO
> -APR_UTIL_CFLAGS=
> -APR_UTIL_LIBS=
> -AC_MSG_CHECKING([which libapr-util to use])
> -if test "x$with_system_apr_util" = "xyes" -o -n "$with_system_libs"; then
> -    AC_MSG_RESULT([system])
> -    PKG_CHECK_MODULES([APR_UTIL], [apr-util-1 >= 1.0])
> -    SYSTEM_APR_UTIL=YES
> -else
> -    AC_MSG_RESULT([internal])
> -    SYSTEM_APR_UTIL=NO
> -    BUILD_TYPE="$BUILD_TYPE APR_UTIL"
> -fi
> -AC_SUBST(SYSTEM_APR_UTIL)
> -AC_SUBST(APR_UTIL_CFLAGS)
> -AC_SUBST(APR_UTIL_LIBS)
> -
> -
> -dnl ===================================================================
> -dnl Check for system serf
> -dnl ===================================================================
> -SYSTEM_SERF=NO
> -SERF_CFLAGS=
> -SERF_LIBS=
> -AC_MSG_CHECKING([which libserf to use])
> -if test -n "$with_system_serf" -o -n "$with_system_libs" && \
> -  test "$with_system_serf" != "no"; then
> -    AC_MSG_RESULT([system])
> -    PKG_CHECK_MODULES([SERF], [serf-1 >= 1.1])
> -    SYSTEM_SERF=YES
> -else
> -    AC_MSG_RESULT([internal])
> -    SYSTEM_SERF=NO
> -    BUILD_TYPE="$BUILD_TYPE SERF"
> -fi
> -AC_SUBST(SYSTEM_SERF)
> -AC_SUBST(SERF_CFLAGS)
> -AC_SUBST(SERF_LIBS)
> -
> -
> dnl ===================================================================
> dnl Check for CoinMP
> dnl ===================================================================
> @@ -4564,6 +4491,15 @@ if test -n "$with_system_curl" -o -n "$with_system_libs" && \
>    else
>       AC_MSG_RESULT([yes])
>    fi
> +
> +   # Does curl use OpenSSL as its SSL implementation? Needed for ucb/source/ucp/webdav.
> +   AC_MSG_CHECKING([whether curl uses OpenSSL as its SSL backend])
> +   if $CURLCONFIG --ssl-backends | $GREP -q 'OpenSSL'; then
> +      AC_MSG_RESULT([yes])
> +   else
> +      AC_MSG_ERROR([no, cannot use system curl whose SSL backend isn't OpenSSL])
> +   fi
> +
>    CURL_LIBS=`$CURLCONFIG --libs`
>    CURL_CFLAGS=`$CURLCONFIG --cflags`
> else
> diff --git a/main/curl/curl-wnt.patch b/main/curl/curl-wnt.patch
> new file mode 100644
> index 0000000000..b38ad3c4c0
> --- /dev/null
> +++ b/main/curl/curl-wnt.patch
> @@ -0,0 +1,38 @@
> +--- misc/build/curl-7.72.0/winbuild/MakefileBuild.vc	2020-08-17 00:28:40.000000000 +0200
> ++++ misc/build/curl-7.72.0/winbuild/MakefileBuild.vc	2022-04-23 19:57:39.594763000 +0200
> +@@ -115,7 +115,7 @@
> + !IFNDEF WITH_DEVEL
> + WITH_DEVEL   = ../../deps
> + !ENDIF
> +-DEVEL_INCLUDE= $(WITH_DEVEL)/include
> ++DEVEL_INCLUDE= $(WITH_DEVEL)/inc/external
> + DEVEL_LIB    = $(WITH_DEVEL)/lib
> + 
> + !IF EXISTS("$(DEVEL_INCLUDE)")
> +@@ -233,7 +233,7 @@
> + ZLIB_LIB_DIR = $(ZLIB_PATH)\lib
> + ZLIB_LFLAGS  = $(ZLIB_LFLAGS) "/LIBPATH:$(ZLIB_LIB_DIR)"
> + !ELSE
> +-ZLIB_INC_DIR = $(DEVEL_INCLUDE)
> ++ZLIB_INC_DIR = $(DEVEL_INCLUDE)\zlib
> + ZLIB_LIB_DIR = $(DEVEL_LIB)
> + !ENDIF
> + 
> +@@ -568,6 +568,7 @@
> + 	@if not exist "$(LIB_DIROBJ)\vtls" mkdir $(LIB_DIROBJ)\vtls
> + 	@if not exist "$(LIB_DIROBJ)\vssh" mkdir $(LIB_DIROBJ)\vssh
> + 	@if not exist "$(LIB_DIROBJ)\vquic" mkdir $(LIB_DIROBJ)\vquic
> ++	@if not exist "$(LIB_DIROBJ)\vssh" mkdir $(LIB_DIROBJ)\vssh
> + 
> + $(CURL_DIROBJ):
> + 	@if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)
> +@@ -590,6 +591,9 @@
> + 	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
> + 
> + {$(LIBCURL_SRC_DIR)\vquic\}.c{$(LIB_DIROBJ)\vquic\}.obj:
> ++	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
> ++
> ++{$(LIBCURL_SRC_DIR)\vssh\}.c{$(LIB_DIROBJ)\vssh\}.obj:
> + 	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
> + 
> + $(LIB_DIROBJ)\libcurl.res: $(LIBCURL_SRC_DIR)\libcurl.rc
> diff --git a/main/curl/makefile.mk b/main/curl/makefile.mk
> index 533495b3a5..dafa4a6b30 100644
> --- a/main/curl/makefile.mk
> +++ b/main/curl/makefile.mk
> @@ -39,7 +39,7 @@ all:
> 
> TARFILE_NAME=curl-7.72.0
> TARFILE_MD5=7422feb126df677d2d33294a1fd079ea
> -PATCH_FILES=buildssh.patch
> +PATCH_FILES=curl-wnt.patch
> 
> #ADDITIONAL_FILES= lib$/config-os2.h lib$/Makefile.os2
> 
> @@ -58,7 +58,7 @@ curl_LDFLAGS+:=$(ARCH_FLAGS)
> CONFIGURE_DIR=.$/
> #relative to CONFIGURE_DIR
> CONFIGURE_ACTION=.$/configure
> -CONFIGURE_FLAGS= --without-ssl --without-libidn --enable-ftp --enable-ipv6 --enable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --disable-static CPPFLAGS="$(curl_CFLAGS)"  LDFLAGS="$(curl_LDFLAGS)"
> +CONFIGURE_FLAGS= --with-ssl --without-libidn --enable-ftp --enable-ipv6 --enable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --disable-static CPPFLAGS="$(curl_CFLAGS)"  LDFLAGS="$(curl_LDFLAGS)"
> 
> BUILD_DIR=$(CONFIGURE_DIR)$/lib
> BUILD_ACTION=$(GNUMAKE)
> @@ -81,7 +81,7 @@ curl_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
> CONFIGURE_DIR=.$/
> #relative to CONFIGURE_DIR
> CONFIGURE_ACTION=.$/configure
> -CONFIGURE_FLAGS= --without-ssl --enable-ftp --enable-ipv6 --disable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --build=i586-pc-mingw32 --host=i586-pc-mingw32 CC="$(curl_CC)" CPPFLAGS="$(INCLUDE)" OBJDUMP="objdump" LDFLAGS="-L$(ILIB:s/;/ -L/)" LIBS="$(curl_LIBS)"
> +CONFIGURE_FLAGS= --with-ssl --enable-ftp --enable-ipv6 --enable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --build=i586-pc-mingw32 --host=i586-pc-mingw32 CC="$(curl_CC)" CPPFLAGS="$(INCLUDE)" OBJDUMP="objdump" LDFLAGS="-L$(ILIB:s/;/ -L/)" LIBS="$(curl_LIBS)"
> BUILD_DIR=$(CONFIGURE_DIR)$/lib
> BUILD_ACTION=make
> OUT2BIN=$(BUILD_DIR)$/.libs$/libcurl*.dll
> @@ -104,17 +104,17 @@ curl_MACHINE:="X64"
> 
> BUILD_DIR=.$/winbuild
> .IF "$(debug)"==""
> -BUILD_ACTION=CC="cl.exe" nmake -f Makefile.vc mode=dll VC=9 EXCFLAGS=$(EXCFLAGS) MACHINE=$(curl_MACHINE)
> +BUILD_ACTION=CC="cl.exe" nmake -f Makefile.vc mode=dll VC=9 EXCFLAGS=$(EXCFLAGS) MACHINE=$(curl_MACHINE) RTLIBCFG=static WITH_DEVEL=$(OUTDIR) WITH_ZLIB=dll WITH_SSL=dll
> .ELSE
> -BUILD_ACTION=CC="cl.exe" nmake -f Makefile.vc mode=dll VC=9 DEBUG=yes EXCFLAGS=$(EXCFLAGS) MACHINE=$(curl_MACHINE)
> +BUILD_ACTION=CC="cl.exe" nmake -f Makefile.vc mode=dll VC=9 DEBUG=yes EXCFLAGS=$(EXCFLAGS) MACHINE=$(curl_MACHINE) RTLIBCFG=static WITH_DEVEL=$(OUTDIR) WITH_ZLIB=dll WITH_SSL=dll
> .ENDIF
> 
> .IF "$(CPUNAME)"=="INTEL"
> -OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-release-dll-ipv6-sspi-schannel/bin/libcurl.dll
> -OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-release-dll-ipv6-sspi-schannel/lib/libcurl.lib
> +OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-release-dll-ssl-dll-zlib-dll-ipv6-sspi/bin/libcurl.dll
> +OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-release-dll-ssl-dll-zlib-dll-ipv6-sspi/lib/libcurl.lib
> .ELIF "$(CPUNAME)"=="X86_64"
> -OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-release-dll-ipv6-sspi-schannel/bin/libcurl.dll
> -OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-release-dll-ipv6-sspi-schannel/lib/libcurl.lib
> +OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-release-dll-ssl-dll-zlib-dll-ipv6-sspi/bin/libcurl.dll
> +OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-release-dll-ssl-dll-zlib-dll-ipv6-sspi/lib/libcurl.lib
> .ENDIF
> 
> .ENDIF
> diff --git a/main/curl/prj/build.lst b/main/curl/prj/build.lst
> index d3aab47811..46a7d3b613 100644
> --- a/main/curl/prj/build.lst
> +++ b/main/curl/prj/build.lst
> @@ -1,3 +1,3 @@
> -xc	curl	:	stlport external NULL
> +xc	curl	:	stlport external OPENSSL:openssl ZLIB:zlib NULL
> xc	curl	usr1	-	all	xc_mkout NULL
> xc	curl	nmake	-	all	xc_curl NULL
> diff --git a/main/external_deps.lst b/main/external_deps.lst
> index 1ed310164e..072031667e 100644
> --- a/main/external_deps.lst
> +++ b/main/external_deps.lst
> @@ -126,12 +126,6 @@ if ( true )
>     URL1 = https://sourceforge.net/projects/icu/files/ICU4C/4.0.1/$(name)
>     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
> 
> -if ( true )
> -    SHA1 = f65fbbd72926c8e7cf0dbd4ada03b0d226f461fd
> -    name = serf-1.2.1.tar.bz2
> -    URL1 = https://archive.apache.org/dist/serf/serf-1.2.1.tar.bz2
> -    URL2 = $(OOO_EXTRAS)$(SHA1)-$(name)
> -
> if (SOLAR_JAVA==TRUE && (ENABLE_MEDIAWIKI==YES || ENABLE_REPORTBUILDER==YES))
>     MD5 = e8e197d628436490886d17cffa108fe3
>     name = commons-logging-1.1.3-src.tar.gz
> @@ -162,18 +156,6 @@ if (SYSTEM_OPENSSL!=YES && DISABLE_OPENSSL!=TRUE)
>     URL1 = https://www.openssl.org/source/old/1.0.2/$(name)
>     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
> 
> -if ( true )
> -    MD5 = 0759294408daace192c935b7c9e76e04
> -    name = apr-1.6.5.tar.gz
> -    URL1 = https://archive.apache.org/dist/apr/$(name)
> -    URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
> -
> -if ( true )
> -    MD5 = bd502b9a8670a8012c4d90c31a84955f
> -    name = apr-util-1.6.1.tar.gz
> -    URL1 = https://archive.apache.org/dist/apr/$(name)
> -    URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
> -
> if (SYSTEM_LIBXML != YES)
>     MD5 = 10942a1dc23137a8aa07f0639cbfece5
>     name = libxml2-2.9.10.tar.gz
> diff --git a/main/scp2/prj/build.lst b/main/scp2/prj/build.lst
> index 46b8008c6e..bc387ead46 100644
> --- a/main/scp2/prj/build.lst
> +++ b/main/scp2/prj/build.lst
> @@ -1,4 +1,4 @@
> -cp    scp2    :    L10N:l10n i18npool setup_native l10ntools PYTHON:python ICU:icu REDLAND:redland LIBXSLT:libxslt APR:apr apr-util SERF:serf NULL
> +cp    scp2    :    L10N:l10n i18npool setup_native l10ntools PYTHON:python ICU:icu REDLAND:redland LIBXSLT:libxslt NULL
> cp    scp2                        usr1     -    all    cp_mkout NULL
> cp    scp2\macros                 nmake    -    all    cp_langmacros NULL
> cp    scp2\source\templates       nmake    -    all    cp_langtemplates NULL
> diff --git a/main/scp2/source/ooo/file_library_ooo.scp b/main/scp2/source/ooo/file_library_ooo.scp
> index f3435a8b6a..7e7c39d7ba 100644
> --- a/main/scp2/source/ooo/file_library_ooo.scp
> +++ b/main/scp2/source/ooo/file_library_ooo.scp
> @@ -2010,64 +2010,3 @@ End
> #endif
> #endif
> 
> -// AF: is this still needed with explicit support for system apr,apr-util,serf ?
> -#if !defined(OS2) // using system libs
> -
> -#ifdef APR_MAJOR 
> -File gid_File_Lib_Apr
> -     #ifdef WNT
> -        Name = SPECIAL_NAME(libapr-1);
> -     #else
> -	// Looks like the major version number is part of the name, not
> -	// part of the suffix.  An error?
> -	#ifdef MACOSX
> -            Name = STRING(CONCAT2(libapr-1,UNXSUFFIX));
> -	#elif FREEBSD
> -            Name = STRING(CONCAT3(libapr-1,UNXSUFFIX,.5));
> -        #else
> -            Name = STRING(CONCAT6(libapr-1,UNXSUFFIX,.0.,APR_MINOR,.,APR_MICRO));
> -        #endif
> -     #endif
> -     PACKED_LIB_FILE_BODY;
> -End
> -#endif
> -
> -#ifdef APR_UTIL_MAJOR
> -File gid_File_Lib_AprUtil
> -    #ifdef WNT
> -        Name = SPECIAL_NAME(apr-util);
> -    #else
> -	// Looks like the major version number is part of the name, not
> -	// part of the suffix.  An error?
> -	#ifdef MACOSX
> -	    Name = STRING(CONCAT2(libaprutil-1,UNXSUFFIX));
> -	#elif FREEBSD
> -            Name = STRING(CONCAT3(libaprutil-1,UNXSUFFIX,.5));
> -	#else
> -            Name = STRING(CONCAT6(libaprutil-1,UNXSUFFIX,.0.,APR_UTIL_MINOR,.,APR_UTIL_MICRO));
> -	#endif
> -    #endif
> -    PACKED_LIB_FILE_BODY;
> -End
> -#endif
> -
> -#ifdef SERF_MAJOR
> -File gid_File_Lib_Serf
> -    #ifdef WNT
> -        Name = SPECIAL_NAME(serf);
> -    #else
> -	// Looks like the major version number is part of the name, not
> -	// part of the suffix.  An error?
> -	#ifdef MACOSX
> -            Name = STRING(CONCAT3(libserf-,SERF_MAJOR,UNXSUFFIX));
> -	#elif FREEBSD
> -            Name = STRING(CONCAT3(libserf-1,UNXSUFFIX,.0));
> -	#else
> -            Name = STRING(CONCAT3(libserf-1,UNXSUFFIX,.0.0.0));
> -	#endif
> -    #endif
> -    PACKED_LIB_FILE_BODY;
> -End
> -#endif
> -
> -#endif // !defined(OS2)
> diff --git a/main/scp2/source/ooo/makefile.mk b/main/scp2/source/ooo/makefile.mk
> index 10f4805b39..f5ce610c4a 100644
> --- a/main/scp2/source/ooo/makefile.mk
> +++ b/main/scp2/source/ooo/makefile.mk
> @@ -231,29 +231,6 @@ SCPDEFS+=-DOPENSSL
> SCPDEFS+=-DDISABLE_ATL
> .ENDIF
> 
> -# Detect version numbers for apr, apr-util, serf.
> -.IF "$(SYSTEM_APR)"!="YES"
> -.INCLUDE : apr_version.mk
> -SCPDEFS+=\
> -    -DAPR_MAJOR=$(APR_MAJOR)		\
> -    -DAPR_MINOR=$(APR_MINOR)		\
> -    -DAPR_MICRO=$(APR_MICRO)
> -.ENDIF
> -.IF "$(SYSTEM_APR_UTIL)"!="YES"
> -.INCLUDE : aprutil_version.mk
> -SCPDEFS+=\
> -    -DAPR_UTIL_MAJOR=$(APR_UTIL_MAJOR)	\
> -    -DAPR_UTIL_MINOR=$(APR_UTIL_MINOR)	\
> -    -DAPR_UTIL_MICRO=$(APR_UTIL_MICRO)
> -.ENDIF
> -.IF "$(SYSTEM_SERF)"!="YES"
> -.INCLUDE : serf_version.mk
> -SCPDEFS+=\
> -    -DSERF_MAJOR=$(SERF_MAJOR)		\
> -    -DSERF_MINOR=$(SERF_MINOR)		\
> -    -DSERF_MICRO=$(SERF_MICRO)
> -.ENDIF
> -
> .IF "$(SYSTEM_PYTHON)" == "YES"
> SCPDEFS+=-DSYSTEM_PYTHON
> .ENDIF
> diff --git a/main/scp2/source/ooo/shortcut_ooo.scp b/main/scp2/source/ooo/shortcut_ooo.scp
> index 9fbc33f7f7..80bc4224b8 100644
> --- a/main/scp2/source/ooo/shortcut_ooo.scp
> +++ b/main/scp2/source/ooo/shortcut_ooo.scp
> @@ -105,51 +105,4 @@ End
> 
> #endif
> 
> -#ifdef UNX
> -
> -// Create links to the fully quantified libraries apr, apr-util, and serf.
> -// The major version number is handled in a non-standard way (part of the name).
> -// Therefore the hard-coded .0 suffix.
> -
> -#ifdef APR_MAJOR 
> -Shortcut gid_Shortcut_Lib_Apr
> -    FileID = gid_File_Lib_Apr;
> -    Dir = SCP2_OOO_BIN_DIR;
> -    #ifdef MACOSX
> -        Name = STRING(CONCAT2(libapr-1.0,UNXSUFFIX));
> -    #else
> -        Name = STRING(CONCAT3(libapr-1,UNXSUFFIX,.0));
> -    #endif
> -    Styles = (NETWORK,RELATIVE,FORCE_INTO_UPDATE_PACKAGE);
> -End
> -#endif
> -
> -#ifdef APR_UTIL_MAJOR
> -Shortcut gid_Shortcut_Lib_AprUtil
> -    FileID = gid_File_Lib_AprUtil;
> -    Dir = SCP2_OOO_BIN_DIR;
> -    #ifdef MACOSX
> -        Name = STRING(CONCAT2(libaprutil-1.0,UNXSUFFIX));
> -    #else
> -        Name = STRING(CONCAT3(libaprutil-1,UNXSUFFIX,.0));
> -    #endif
> -    Styles = (NETWORK,RELATIVE,FORCE_INTO_UPDATE_PACKAGE);
> -End
> -#endif
> -
> -#ifdef SERF_MAJOR
> -Shortcut gid_Shortcut_Lib_Serf
> -    FileID = gid_File_Lib_Serf;
> -    Dir = SCP2_OOO_BIN_DIR;
> -    #ifdef MACOSX
> -        Name = STRING(CONCAT2(libserf-1.0,UNXSUFFIX));
> -    #else
> -        Name = STRING(CONCAT3(libserf-1,UNXSUFFIX,.0));
> -    #endif
> -    Styles = (NETWORK,RELATIVE,FORCE_INTO_UPDATE_PACKAGE);
> -End
> -#endif
> -
> -#endif
> -
> //i44154 -end-
> diff --git a/main/set_soenv.in b/main/set_soenv.in
> index b57d46cf41..0af5fa2423 100644
> --- a/main/set_soenv.in
> +++ b/main/set_soenv.in
> @@ -1983,15 +1983,6 @@ ToFile( "SYSTEM_SAXON",      "@SYSTEM_SAXON@",     "e" );
> ToFile( "SAXON_JAR",         "@SAXON_JAR@",        "e" );
> ToFile( "DISABLE_SAXON",     "@DISABLE_SAXON@",    "e" );
> ToFile( "ENABLE_JAVASCRIPT", "@ENABLE_JAVASCRIPT@","e" );
> -ToFile( "SYSTEM_APR",        "@SYSTEM_APR@",       "e" );
> -ToFile( "APR_CFLAGS",        "@APR_CFLAGS@",       "e" );
> -ToFile( "APR_LIBS",          "@APR_LIBS@",         "e" );
> -ToFile( "SYSTEM_APR_UTIL",   "@SYSTEM_APR_UTIL@",  "e" );
> -ToFile( "APR_UTIL_CFLAGS",   "@APR_UTIL_CFLAGS@",  "e" );
> -ToFile( "APR_UTIL_LIBS",     "@APR_UTIL_LIBS@",    "e" );
> -ToFile( "SYSTEM_SERF",       "@SYSTEM_SERF@",      "e" );
> -ToFile( "SERF_CFLAGS",       "@SERF_CFLAGS@",      "e" );
> -ToFile( "SERF_LIBS",         "@SERF_LIBS@",        "e" );
> ToFile( "SYSTEM_COINMP",     "@SYSTEM_COINMP@",    "e" );
> ToFile( "ENABLE_COINMP",     "@ENABLE_COINMP@",    "e" );
> ToFile( "COINMP_CFLAGS",     "@COINMP_CFLAGS@",    "e" );
> diff --git a/main/ucb/Library_ucpdav1.mk b/main/ucb/Library_ucpdav1.mk
> index 1e074b7e28..697662fe25 100644
> --- a/main/ucb/Library_ucpdav1.mk
> +++ b/main/ucb/Library_ucpdav1.mk
> @@ -65,11 +65,9 @@ $(eval $(call gb_Library_add_linked_libs,ucpdav1,\
> ))
> endif
> 
> -$(call gb_Library_use_external,ucpdav1,apr)
> -$(call gb_Library_use_external,ucpdav1,apr_util)
> +$(call gb_Library_use_external,ucpdav1,curl)
> $(call gb_Library_use_external,ucpdav1,libxml2)
> $(call gb_Library_use_external,ucpdav1,openssl)
> -$(call gb_Library_use_external,ucpdav1,serf)
> 
> $(eval $(call gb_Library_add_exception_objects,ucpdav1,\
> 	ucb/source/ucp/webdav/webdavservices \
> @@ -82,29 +80,15 @@ $(eval $(call gb_Library_add_exception_objects,ucpdav1,\
> 	ucb/source/ucp/webdav/DAVProperties \
> 	ucb/source/ucp/webdav/DAVSessionFactory \
> 	ucb/source/ucp/webdav/DAVResourceAccess \
> -	ucb/source/ucp/webdav/AprEnv \
> 	ucb/source/ucp/webdav/webdavresponseparser \
> -	ucb/source/ucp/webdav/SerfUri \
> -	ucb/source/ucp/webdav/SerfRequestProcessor \
> -	ucb/source/ucp/webdav/SerfRequestProcessorImpl \
> -	ucb/source/ucp/webdav/SerfRequestProcessorImplFac \
> -	ucb/source/ucp/webdav/SerfPropFindReqProcImpl \
> -	ucb/source/ucp/webdav/SerfPropPatchReqProcImpl \
> -	ucb/source/ucp/webdav/SerfGetReqProcImpl \
> -	ucb/source/ucp/webdav/SerfHeadReqProcImpl \
> -	ucb/source/ucp/webdav/SerfPutReqProcImpl \
> -	ucb/source/ucp/webdav/SerfPostReqProcImpl \
> -	ucb/source/ucp/webdav/SerfDeleteReqProcImpl \
> -	ucb/source/ucp/webdav/SerfMkColReqProcImpl \
> -	ucb/source/ucp/webdav/SerfCopyReqProcImpl \
> -	ucb/source/ucp/webdav/SerfMoveReqProcImpl \
> -	ucb/source/ucp/webdav/SerfLockReqProcImpl \
> -	ucb/source/ucp/webdav/SerfLockRefreshProcImpl \
> -	ucb/source/ucp/webdav/SerfUnlockProcImpl \
> -	ucb/source/ucp/webdav/SerfLockStore \
> -	ucb/source/ucp/webdav/SerfSession \
> -	ucb/source/ucp/webdav/SerfCallbacks \
> -	ucb/source/ucp/webdav/SerfInputStream \
> +	ucb/source/ucp/webdav/CurlSession \
> +	ucb/source/ucp/webdav/CurlRequest \
> +	ucb/source/ucp/webdav/CurlLockStore \
> +	ucb/source/ucp/webdav/LockRequest \
> +	ucb/source/ucp/webdav/PropfindRequest \
> +	ucb/source/ucp/webdav/ProppatchRequest \
> +	ucb/source/ucp/webdav/CurlUri \
> +	ucb/source/ucp/webdav/CurlInputStream \
> 	ucb/source/ucp/webdav/DateTimeHelper \
> 	ucb/source/ucp/webdav/UCBDeadPropertyValue \
> ))
> diff --git a/main/ucb/prj/build.lst b/main/ucb/prj/build.lst
> index 8272c9235c..3fba3fbe2a 100644
> --- a/main/ucb/prj/build.lst
> +++ b/main/ucb/prj/build.lst
> @@ -1,3 +1,3 @@
> -uc ucb : cppuhelper CURL:curl OPENSSL:openssl LIBXML2:libxml2 LIBXSLT:libxslt offapi sal salhelper ucbhelper udkapi comphelper SERF:serf tools NULL
> +uc ucb : cppuhelper CURL:curl OPENSSL:openssl LIBXML2:libxml2 LIBXSLT:libxslt offapi sal salhelper ucbhelper udkapi comphelper tools NULL
> uc	ucb							usr1	-	all	uc_mkout NULL
> uc	ucb\prj					    nmake	-	all	uc_prj NULL
> diff --git a/main/ucb/source/ucp/webdav/ContentProperties.cxx b/main/ucb/source/ucp/webdav/ContentProperties.cxx
> index 0e5f86de42..a0c04e6f3a 100644
> --- a/main/ucb/source/ucp/webdav/ContentProperties.cxx
> +++ b/main/ucb/source/ucp/webdav/ContentProperties.cxx
> @@ -31,7 +31,7 @@
>  *************************************************************************/
> #include <osl/diagnose.h>
> #include <com/sun/star/util/DateTime.hpp>
> -#include "SerfUri.hxx"
> +#include "CurlUri.hxx"
> #include "DAVResource.hxx"
> #include "DAVProperties.hxx"
> #include "DateTimeHelper.hxx"
> @@ -97,7 +97,7 @@ ContentProperties::ContentProperties( const DAVResource& rResource )
>     // Title
>     try
>     {
> -        SerfUri aURI( rResource.uri );
> +        CurlUri aURI( rResource.uri );
>         m_aEscapedTitle = aURI.GetPathBaseName();
> 
>         (*m_xProps)[ rtl::OUString::createFromAscii( "Title" ) ]
> diff --git a/main/ucb/source/ucp/webdav/SerfInputStream.cxx b/main/ucb/source/ucp/webdav/CurlInputStream.cxx
> similarity index 86%
> rename from main/ucb/source/ucp/webdav/SerfInputStream.cxx
> rename to main/ucb/source/ucp/webdav/CurlInputStream.cxx
> index 32b7df3923..2d72b6a201 100644
> --- a/main/ucb/source/ucp/webdav/SerfInputStream.cxx
> +++ b/main/ucb/source/ucp/webdav/CurlInputStream.cxx
> @@ -23,7 +23,7 @@
> 
> // MARKER(update_precomp.py): autogen include statement, do not remove
> #include "precompiled_webdav.hxx"
> -#include "SerfInputStream.hxx"
> +#include "CurlInputStream.hxx"
> #include <rtl/memory.h>
> 
> using namespace cppu;
> @@ -36,16 +36,17 @@ using namespace http_dav_ucp;
> // -------------------------------------------------------------------
> // Constructor
> // -------------------------------------------------------------------
> -SerfInputStream::SerfInputStream( void )
> +CurlInputStream::CurlInputStream( void )
> : mLen( 0 ),
> -  mPos( 0 )
> +  mPos( 0 ),
> +  mCapacity( 0 )
> {
> }
> 
> // -------------------------------------------------------------------
> // Destructor
> // -------------------------------------------------------------------
> -SerfInputStream::~SerfInputStream( void )
> +CurlInputStream::~CurlInputStream( void )
> {
> }
> 
> @@ -53,17 +54,24 @@ SerfInputStream::~SerfInputStream( void )
> // AddToStream
> // Allows the caller to add some data to the "end" of the stream
> // -------------------------------------------------------------------
> -void SerfInputStream::AddToStream( const char * inBuf, sal_Int32 inLen )
> +void CurlInputStream::AddToStream( const char * inBuf, sal_Int32 inLen )
> {
> -    mInputBuffer.realloc( sal::static_int_cast<sal_Int32>(mLen) + inLen );
> +    if ( mLen + inLen > mCapacity )
> +    {
> +        if ( 2*mCapacity >= ( mLen + inLen ) )
> +            mCapacity *= 2;
> +        else
> +            mCapacity = mLen + inLen;
> +        mInputBuffer.realloc( mCapacity );
> +    }
>     rtl_copyMemory( mInputBuffer.getArray() + mLen, inBuf, inLen );
> -	mLen += inLen;
> +    mLen += inLen;
> }
> 
> // -------------------------------------------------------------------
> // queryInterface
> // -------------------------------------------------------------------
> -Any SerfInputStream::queryInterface( const Type &type )
> +Any CurlInputStream::queryInterface( const Type &type )
> 						throw( RuntimeException )
> {
> 	Any aRet = ::cppu::queryInterface( type,
> @@ -76,7 +84,7 @@ Any SerfInputStream::queryInterface( const Type &type )
> // readBytes
> // "Reads" the specified number of bytes from the stream
> // -------------------------------------------------------------------
> -sal_Int32 SAL_CALL SerfInputStream::readBytes(
> +sal_Int32 SAL_CALL CurlInputStream::readBytes(
>   ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead )
> 		throw( ::com::sun::star::io::NotConnectedException,
> 			   ::com::sun::star::io::BufferSizeExceededException,
> @@ -105,7 +113,7 @@ sal_Int32 SAL_CALL SerfInputStream::readBytes(
> // -------------------------------------------------------------------
> // readSomeBytes
> // -------------------------------------------------------------------
> -sal_Int32 SAL_CALL SerfInputStream::readSomeBytes(
> +sal_Int32 SAL_CALL CurlInputStream::readSomeBytes(
>  ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead )
>         throw( ::com::sun::star::io::NotConnectedException,
>                ::com::sun::star::io::BufferSizeExceededException,
> @@ -120,7 +128,7 @@ sal_Int32 SAL_CALL SerfInputStream::readSomeBytes(
> // skipBytes
> // Moves the current stream position forward
> // -------------------------------------------------------------------
> -void SAL_CALL SerfInputStream::skipBytes( sal_Int32 nBytesToSkip )
> +void SAL_CALL CurlInputStream::skipBytes( sal_Int32 nBytesToSkip )
>         throw( ::com::sun::star::io::NotConnectedException,
>                ::com::sun::star::io::BufferSizeExceededException,
>                ::com::sun::star::io::IOException,
> @@ -135,7 +143,7 @@ void SAL_CALL SerfInputStream::skipBytes( sal_Int32 nBytesToSkip )
> // available
> // Returns the number of unread bytes currently remaining on the stream
> // -------------------------------------------------------------------
> -sal_Int32 SAL_CALL SerfInputStream::available(  )
> +sal_Int32 SAL_CALL CurlInputStream::available(  )
>         throw( ::com::sun::star::io::NotConnectedException,
>                ::com::sun::star::io::IOException,
>                ::com::sun::star::uno::RuntimeException )
> @@ -146,7 +154,7 @@ sal_Int32 SAL_CALL SerfInputStream::available(  )
> // -------------------------------------------------------------------
> // closeInput
> // -------------------------------------------------------------------
> -void SAL_CALL SerfInputStream::closeInput( void )
> +void SAL_CALL CurlInputStream::closeInput( void )
>  		throw( ::com::sun::star::io::NotConnectedException,
>        		   ::com::sun::star::io::IOException,
>        		   ::com::sun::star::uno::RuntimeException )
> @@ -156,7 +164,7 @@ void SAL_CALL SerfInputStream::closeInput( void )
> // -------------------------------------------------------------------
> // seek
> // -------------------------------------------------------------------
> -void SAL_CALL SerfInputStream::seek( sal_Int64 location )
> +void SAL_CALL CurlInputStream::seek( sal_Int64 location )
> 		throw( ::com::sun::star::lang::IllegalArgumentException,
> 			   ::com::sun::star::io::IOException,
> 			   ::com::sun::star::uno::RuntimeException )
> @@ -173,7 +181,7 @@ void SAL_CALL SerfInputStream::seek( sal_Int64 location )
> // -------------------------------------------------------------------
> // getPosition
> // -------------------------------------------------------------------
> -sal_Int64 SAL_CALL SerfInputStream::getPosition()
> +sal_Int64 SAL_CALL CurlInputStream::getPosition()
> 		throw( ::com::sun::star::io::IOException,
> 			   ::com::sun::star::uno::RuntimeException )
> {
> @@ -183,7 +191,7 @@ sal_Int64 SAL_CALL SerfInputStream::getPosition()
> // -------------------------------------------------------------------
> // getLength
> // -------------------------------------------------------------------
> -sal_Int64 SAL_CALL SerfInputStream::getLength()
> +sal_Int64 SAL_CALL CurlInputStream::getLength()
> 		throw( ::com::sun::star::io::IOException,
> 			   ::com::sun::star::uno::RuntimeException )
> {
> diff --git a/main/ucb/source/ucp/webdav/SerfInputStream.hxx b/main/ucb/source/ucp/webdav/CurlInputStream.hxx
> similarity index 93%
> rename from main/ucb/source/ucp/webdav/SerfInputStream.hxx
> rename to main/ucb/source/ucp/webdav/CurlInputStream.hxx
> index 1c38f2f4a9..24628ee14d 100644
> --- a/main/ucb/source/ucp/webdav/SerfInputStream.hxx
> +++ b/main/ucb/source/ucp/webdav/CurlInputStream.hxx
> @@ -20,8 +20,8 @@
>  *************************************************************/
> 
> 
> -#ifndef INCLUDED_NEONINPUTSTREAM_HXX
> -#define INCLUDED_NEONINPUTSTREAM_HXX
> +#ifndef INCLUDED_CURLINPUTSTREAM_HXX
> +#define INCLUDED_CURLINPUTSTREAM_HXX
> 
> #include <sal/types.h>
> #include <rtl/ustring.hxx>
> @@ -34,11 +34,11 @@ namespace http_dav_ucp
> {
> 
> // -------------------------------------------------------------------
> -// SerfInputStream
> +// CurlInputStream
> // A simple XInputStream implementation provided specifically for use
> // by the DAVSession::GET method.
> // -------------------------------------------------------------------
> -class SerfInputStream : public ::com::sun::star::io::XInputStream,
> +class CurlInputStream : public ::com::sun::star::io::XInputStream,
> 						public ::com::sun::star::io::XSeekable,
> 						public ::cppu::OWeakObject
> {
> @@ -46,10 +46,11 @@ class SerfInputStream : public ::com::sun::star::io::XInputStream,
> 		com::sun::star::uno::Sequence< sal_Int8 > mInputBuffer;
> 		sal_Int64 mLen;
> 		sal_Int64 mPos;
> +        sal_Int64 mCapacity;
> 
> 	public:
> -				 SerfInputStream( void );
> -		virtual ~SerfInputStream();
> +				 CurlInputStream( void );
> +		virtual ~CurlInputStream();
> 
> 		// Add some data to the end of the stream
> 		void AddToStream( const char * inBuf, sal_Int32 inLen );
> @@ -118,4 +119,4 @@ class SerfInputStream : public ::com::sun::star::io::XInputStream,
> 
> } // namespace http_dav_ucp
> 
> -#endif // INCLUDED_NEONINPUTSTREAM_HXX
> +#endif // INCLUDED_CURLINPUTSTREAM_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfLockStore.cxx b/main/ucb/source/ucp/webdav/CurlLockStore.cxx
> similarity index 86%
> rename from main/ucb/source/ucp/webdav/SerfLockStore.cxx
> rename to main/ucb/source/ucp/webdav/CurlLockStore.cxx
> index bbe409b685..a3f23a5626 100644
> --- a/main/ucb/source/ucp/webdav/SerfLockStore.cxx
> +++ b/main/ucb/source/ucp/webdav/CurlLockStore.cxx
> @@ -27,9 +27,9 @@
> #include <rtl/ustring.hxx>
> #include <osl/time.h>
> #include <osl/thread.hxx>
> -#include "SerfTypes.hxx"
> -#include "SerfSession.hxx"
> -#include "SerfLockStore.hxx"
> +#include "CurlTypes.hxx"
> +#include "CurlSession.hxx"
> +#include "CurlLockStore.hxx"
> 
> using namespace http_dav_ucp;
> 
> @@ -38,11 +38,11 @@ namespace http_dav_ucp {
> class TickerThread : public osl::Thread
> {
>     bool m_bFinish;
> -    SerfLockStore & m_rLockStore;
> +    CurlLockStore & m_rLockStore;
> 
> public:
> 
> -    TickerThread( SerfLockStore & rLockStore )
> +    TickerThread( CurlLockStore & rLockStore )
>     : osl::Thread(), m_bFinish( false ), m_rLockStore( rLockStore ) {}
> 
>     void finish() { m_bFinish = true; }
> @@ -81,25 +81,25 @@ void TickerThread::run()
> }
> 
> // -------------------------------------------------------------------
> -SerfLockStore::SerfLockStore()
> +CurlLockStore::CurlLockStore()
>     : m_pTickerThread( 0 )
> {
> }
> 
> // -------------------------------------------------------------------
> -SerfLockStore::~SerfLockStore()
> +CurlLockStore::~CurlLockStore()
> {
>     stopTicker();
> 
>     // release active locks, if any.
>     OSL_ENSURE( m_aLockInfoMap.size() == 0,
> -                "SerfLockStore::~SerfLockStore - Releasing active locks!" );
> +                "CurlLockStore::~CurlLockStore - Releasing active locks!" );
> 
>     LockInfoMap::const_iterator it( m_aLockInfoMap.begin() );
>     const LockInfoMap::const_iterator end( m_aLockInfoMap.end() );
>     while ( it != end )
>     {
> -        SerfLock * pLock = (*it).first;
> +        CurlLock * pLock = (*it).first;
>         try
>         {
>             (*it).second.xSession->UNLOCK( pLock );
> @@ -112,7 +112,7 @@ SerfLockStore::~SerfLockStore()
> }
> 
> // -------------------------------------------------------------------
> -void SerfLockStore::startTicker()
> +void CurlLockStore::startTicker()
> {
>     osl::MutexGuard aGuard( m_aMutex );
> 
> @@ -124,7 +124,7 @@ void SerfLockStore::startTicker()
> }
> 
> // -------------------------------------------------------------------
> -void SerfLockStore::stopTicker()
> +void CurlLockStore::stopTicker()
> {
>     osl::MutexGuard aGuard( m_aMutex );
> 
> @@ -139,7 +139,7 @@ void SerfLockStore::stopTicker()
> 
> #if 0       //not currently used
> // -------------------------------------------------------------------
> -void SerfLockStore::registerSession( SerfSession /* aSession */ )
> +void CurlLockStore::registerSession( CurlSession /* aSession */ )
> {
>     osl::MutexGuard aGuard( m_aMutex );
> 
> @@ -147,7 +147,7 @@ void SerfLockStore::registerSession( SerfSession /* aSession */ )
> #endif
> 
> // -------------------------------------------------------------------
> -SerfLock * SerfLockStore::findByUri( rtl::OUString const & rUri)
> +CurlLock * CurlLockStore::findByUri( rtl::OUString const & rUri)
> {
>     osl::MutexGuard aGuard( m_aMutex );
> 
> @@ -156,7 +156,7 @@ SerfLock * SerfLockStore::findByUri( rtl::OUString const & rUri)
> 
>     while ( it != end )
>     {
> -        SerfLock * pLock = (*it).first;
> +        CurlLock * pLock = (*it).first;
>         if( pLock->getResourceUri().equals( rUri ) )
>         {
>             return pLock;
> @@ -164,12 +164,12 @@ SerfLock * SerfLockStore::findByUri( rtl::OUString const & rUri)
>         ++it;
>     }
> 
> -    return static_cast<SerfLock*>(0);
> +    return static_cast<CurlLock*>(0);
> }
> 
> // -------------------------------------------------------------------
> -void SerfLockStore::addLock( SerfLock * pLock,
> -                             rtl::Reference< SerfSession > const & xSession,
> +void CurlLockStore::addLock( CurlLock * pLock,
> +                             rtl::Reference< CurlSession > const & xSession,
>                              sal_Int32 nLastChanceToSendRefreshRequest )
> {
>     osl::MutexGuard aGuard( m_aMutex );
> @@ -184,7 +184,7 @@ void SerfLockStore::addLock( SerfLock * pLock,
>     pLock->getLock().Owner >>= aOwner;
>     rtl::OUString   aToken;
>     aToken = pLock->getLock().LockTokens[0];
> -    OSL_TRACE("SerfLockStore::addLock: new lock added aOwner '%s', token '%s'",
> +    OSL_TRACE("CurlLockStore::addLock: new lock added aOwner '%s', token '%s'",
>               rtl::OUStringToOString(aOwner, RTL_TEXTENCODING_UTF8).getStr(),
>               rtl::OUStringToOString(aToken, RTL_TEXTENCODING_UTF8).getStr() );
> #endif
> @@ -193,14 +193,14 @@ void SerfLockStore::addLock( SerfLock * pLock,
> 
> #if 0       //not currently used
> // -------------------------------------------------------------------
> -void SerfLockStore::updateLock( SerfLock * pLock,
> +void CurlLockStore::updateLock( CurlLock * pLock,
>                                 sal_Int32 nLastChanceToSendRefreshRequest )
> {
>     osl::MutexGuard aGuard( m_aMutex );
> 
>     LockInfoMap::iterator it( m_aLockInfoMap.find( pLock ) );
>     OSL_ENSURE( it != m_aLockInfoMap.end(),
> -                "SerfLockStore::updateLock: lock not found!" );
> +                "CurlLockStore::updateLock: lock not found!" );
> 
>     if ( it != m_aLockInfoMap.end() )
>     {
> @@ -211,7 +211,7 @@ void SerfLockStore::updateLock( SerfLock * pLock,
> #endif
> 
> // -------------------------------------------------------------------
> -void SerfLockStore::removeLock( SerfLock * pLock )
> +void CurlLockStore::removeLock( CurlLock * pLock )
> {
>     osl::MutexGuard aGuard( m_aMutex );
> 
> @@ -221,14 +221,14 @@ void SerfLockStore::removeLock( SerfLock * pLock )
>         LockInfo & rInfo = (*it).second;
>         rInfo.xSession->release();
>         m_aLockInfoMap.erase( pLock );
> -        //the caller should deallocate SerfLock class after the call!
> +        //the caller should deallocate CurlLock class after the call!
>         if ( m_aLockInfoMap.size() == 0 )
>             stopTicker();
>     }
> }
> 
> // -------------------------------------------------------------------
> -void SerfLockStore::refreshLocks()
> +void CurlLockStore::refreshLocks()
> {
>     osl::MutexGuard aGuard( m_aMutex );
> 
> @@ -252,7 +252,7 @@ void SerfLockStore::refreshLocks()
>                 aLock.Owner >>= aOwner;
>                 rtl::OUString   aToken;
>                 aToken = aLock.LockTokens[0];
> -                OSL_TRACE( "SerfLockStore::refreshLocks: refresh started for lock: aOwner '%s', token '%s'",
> +                OSL_TRACE( "CurlLockStore::refreshLocks: refresh started for lock: aOwner '%s', token '%s'",
>                     rtl::OUStringToOString(aOwner, RTL_TEXTENCODING_UTF8).getStr(),
>                     rtl::OUStringToOString(aToken, RTL_TEXTENCODING_UTF8).getStr() );
> #endif
> @@ -276,7 +276,7 @@ void SerfLockStore::refreshLocks()
>                     // may be just ignore and go on, it's possible the net is temporary down?
>                     rInfo.nLastChanceToSendRefreshRequest = -1;
> #if OSL_DEBUG_LEVEL > 0
> -                    OSL_TRACE( "SerfLockStore::refreshLocks: Lock '%s' not refreshed! (error: DAVException.mStatusCode %d)",
> +                    OSL_TRACE( "CurlLockStore::refreshLocks: Lock '%s' not refreshed! (error: DAVException.mStatusCode %d)",
>                          rtl::OUStringToOString(aToken, RTL_TEXTENCODING_UTF8).getStr(), e.getStatus()  );
> #endif
>                 }
> diff --git a/main/ucb/source/ucp/webdav/SerfLockStore.hxx b/main/ucb/source/ucp/webdav/CurlLockStore.hxx
> similarity index 71%
> rename from main/ucb/source/ucp/webdav/SerfLockStore.hxx
> rename to main/ucb/source/ucp/webdav/CurlLockStore.hxx
> index 13ee204560..974d9c6597 100644
> --- a/main/ucb/source/ucp/webdav/SerfLockStore.hxx
> +++ b/main/ucb/source/ucp/webdav/CurlLockStore.hxx
> @@ -20,24 +20,24 @@
>  *************************************************************/
> 
> 
> -#ifndef INCLUDED_SERFLOCKSTORE_HXX
> -#define INCLUDED_SERFLOCKSTORE_HXX
> +#ifndef INCLUDED_CURLLOCKSTORE_HXX
> +#define INCLUDED_CURLLOCKSTORE_HXX
> 
> #include <map>
> #include <osl/mutex.hxx>
> #include <rtl/ref.hxx>
> -#include "SerfTypes.hxx"
> -#include "SerfSession.hxx"
> +#include "CurlTypes.hxx"
> +#include "CurlSession.hxx"
> 
> namespace http_dav_ucp
> {
> 
> class TickerThread;
> -class SerfSession;
> +class CurlSession;
> 
> struct ltptr
> {
> -    bool operator()( const SerfLock * p1, const SerfLock * p2 ) const
> +    bool operator()( const CurlLock * p1, const CurlLock * p2 ) const
>     {
>         return p1 < p2;
>     }
> @@ -45,45 +45,45 @@ struct ltptr
> 
> typedef struct _LockInfo
> {
> -    rtl::Reference< SerfSession > xSession;
> +    rtl::Reference< CurlSession > xSession;
>     sal_Int32 nLastChanceToSendRefreshRequest;
> 
>     _LockInfo()
>         : nLastChanceToSendRefreshRequest( -1 ) {}
> 
> -    _LockInfo( rtl::Reference< SerfSession > const & _xSession,
> +    _LockInfo( rtl::Reference< CurlSession > const & _xSession,
>               sal_Int32 _nLastChanceToSendRefreshRequest )
>         : xSession( _xSession )
>         , nLastChanceToSendRefreshRequest( _nLastChanceToSendRefreshRequest ) {}
> 
> } LockInfo;
> 
> -typedef std::map< SerfLock *, LockInfo, ltptr > LockInfoMap;
> +typedef std::map< CurlLock *, LockInfo, ltptr > LockInfoMap;
> 
> -class SerfLockStore
> +class CurlLockStore
> {
>     osl::Mutex         m_aMutex;
>     TickerThread     * m_pTickerThread;
>     LockInfoMap        m_aLockInfoMap;
> 
> public:
> -    SerfLockStore();
> -    ~SerfLockStore();
> +    CurlLockStore();
> +    ~CurlLockStore();
> 
> -    void registerSession( SerfSession aSession );
> +    void registerSession( CurlSession aSession );
> 
> -    SerfLock * findByUri( rtl::OUString const & rUri );
> +    CurlLock * findByUri( rtl::OUString const & rUri );
> 
> -    void addLock( SerfLock * pLock,
> -                  rtl::Reference< SerfSession > const & xSession,
> +    void addLock( CurlLock * pLock,
> +                  rtl::Reference< CurlSession > const & xSession,
>                   // time in seconds since Jan 1 1970
>                   // -1: infinite lock, no refresh
>                   sal_Int32 nLastChanceToSendRefreshRequest );
> 
> -    void updateLock( SerfLock * pLock,
> +    void updateLock( CurlLock * pLock,
>                      sal_Int32 nLastChanceToSendRefreshRequest );
> 
> -    void removeLock( SerfLock * pLock );
> +    void removeLock( CurlLock * pLock );
> 
>     void refreshLocks();
> 
> @@ -94,4 +94,4 @@ private:
> 
> } // namespace http_dav_ucp
> 
> -#endif // INCLUDED_SERFLOCKSTORE_HXX
> +#endif // INCLUDED_CURLLOCKSTORE_HXX
> diff --git a/main/ucb/source/ucp/webdav/CurlRequest.cxx b/main/ucb/source/ucp/webdav/CurlRequest.cxx
> new file mode 100644
> index 0000000000..ee6e906e99
> --- /dev/null
> +++ b/main/ucb/source/ucp/webdav/CurlRequest.cxx
> @@ -0,0 +1,391 @@
> +/**************************************************************
> + *
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + *
> + *   http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + *
> + *************************************************************/
> +
> +
> +
> +// MARKER(update_precomp.py): autogen include statement, do not remove
> +#include "precompiled_webdav.hxx"
> +
> +#include "CurlRequest.hxx"
> +
> +using namespace ::com::sun::star;
> +using namespace http_dav_ucp;
> +
> +CurlRequest::CurlRequest( CURL *curl )
> +    : curl( curl )
> +    , curlUrl( NULL )
> +    , requestHeaders( NULL )
> +    , requestBody( NULL )
> +    , requestBodyOffset( 0 )
> +    , requestBodySize( 0 )
> +    , useChunkedEncoding( false )
> +    , provideCredentialsCallback( NULL )
> +    , provideCredentialsUserdata( NULL )
> +    , statusCode( 0 )
> +    , responseBodyInputStream( new CurlInputStream() )
> +{
> +    curl_easy_setopt( curl, CURLOPT_HEADERFUNCTION, Curl_HeaderReceived );
> +    curl_easy_setopt( curl, CURLOPT_HEADERDATA, this );
> +    curl_easy_setopt( curl, CURLOPT_WRITEFUNCTION, Curl_MoreBodyReceived );
> +    curl_easy_setopt( curl, CURLOPT_WRITEDATA, this );
> +}
> +
> +CurlRequest::~CurlRequest()
> +{
> +    if ( curlUrl != NULL )
> +        curl_url_cleanup( curlUrl );
> +    curl_easy_setopt( curl, CURLOPT_CURLU, NULL );
> +    
> +    curl_easy_setopt( curl, CURLOPT_HTTPHEADER, NULL );
> +    if ( requestHeaders != NULL )
> +        curl_slist_free_all( requestHeaders );
> +    curl_easy_setopt( curl, CURLOPT_READFUNCTION, NULL );
> +    curl_easy_setopt( curl, CURLOPT_READDATA, NULL );
> +    curl_easy_setopt( curl, CURLOPT_INFILESIZE, -1 );
> +    curl_easy_setopt( curl, CURLOPT_SEEKFUNCTION, NULL );
> +    curl_easy_setopt( curl, CURLOPT_SEEKDATA, NULL );
> +    curl_easy_setopt( curl, CURLOPT_HEADERFUNCTION, NULL );
> +    curl_easy_setopt( curl, CURLOPT_HEADERDATA, NULL );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, NULL );
> +    curl_easy_setopt( curl, CURLOPT_WRITEFUNCTION, NULL );
> +    curl_easy_setopt( curl, CURLOPT_WRITEDATA, NULL );
> +}
> +
> +void CurlRequest::addHeader( const rtl::OString &name, const rtl::OString &value) throw (DAVException)
> +{
> +    rtl::OString line = name + ": " + value;
> +    struct curl_slist *appended = curl_slist_append( requestHeaders, line.getStr() );
> +    if ( appended != NULL )
> +    {
> +        requestHeaders = appended;
> +        curl_easy_setopt( curl, CURLOPT_HTTPHEADER, requestHeaders );
> +    }
> +    else
> +        throw DAVException( DAVException::DAV_SESSION_CREATE, rtl::OUString::createFromAscii( "Out of memory" ) );
> +}
> +
> +void CurlRequest::setRequestBody( const char *body, size_t size )
> +{
> +    requestBody = body;
> +    requestBodyOffset = 0;
> +    requestBodySize = size;
> +
> +    curl_easy_setopt( curl, CURLOPT_READFUNCTION, Curl_SendMoreBody );
> +    curl_easy_setopt( curl, CURLOPT_READDATA, this );
> +    curl_easy_setopt( curl, CURLOPT_SEEKFUNCTION, Curl_SeekCallback );
> +    curl_easy_setopt( curl, CURLOPT_SEEKDATA, this );
> +    if ( useChunkedEncoding )
> +        addHeader( "Transfer-Encoding", "chunked" );
> +    else
> +        curl_easy_setopt( curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)size );
> +}
> +
> +int CurlRequest::Curl_SeekCallback( void *userdata, curl_off_t offset, int origin )
> +{
> +    CurlRequest *request = static_cast< CurlRequest* >( userdata );
> +    if ( origin == SEEK_SET )
> +        request->requestBodyOffset = (size_t) offset;
> +    else if ( origin == SEEK_CUR )
> +        request->requestBodyOffset += (size_t) offset;
> +    else if ( origin == SEEK_END )
> +        request->requestBodyOffset += (size_t) ((curl_off_t)request->requestBodySize + offset);
> +    else
> +        return CURL_SEEKFUNC_CANTSEEK;
> +    if ( request->requestBodyOffset > request->requestBodySize )
> +        request->requestBodyOffset = request->requestBodySize;
> +    return CURL_SEEKFUNC_OK;
> +}
> +
> +size_t CurlRequest::Curl_SendMoreBody( char *buffer, size_t size, size_t nitems, void *userdata )
> +{
> +    CurlRequest *request = static_cast< CurlRequest* >( userdata );
> +    OSL_TRACE("Curl_SendMoreBody");
> +    return request->curlSendMoreBody( buffer, nitems );
> +}
> +
> +size_t CurlRequest::curlSendMoreBody( char *buffer, size_t len )
> +{
> +    size_t bytesToSend = requestBodySize - requestBodyOffset;
> +    if ( bytesToSend > len )
> +        bytesToSend = len;
> +    memcpy( buffer, requestBody, bytesToSend );
> +    requestBodyOffset += bytesToSend;
> +    return bytesToSend;
> +}
> +
> +void CurlRequest::setProvideCredentialsCallback( bool (*callback)(long statusCode, void *userdata) throw (DAVException), void *userdata )
> +{
> +    provideCredentialsCallback = callback;
> +    provideCredentialsUserdata = userdata;
> +}
> +
> +void CurlRequest::setURI( CurlUri uri, rtl::OUString path ) throw (DAVException)
> +{
> +    if ( curlUrl != NULL )
> +    {
> +        curl_url_cleanup( curlUrl );
> +        curlUrl = NULL;
> +    }
> +
> +    curlUrl = curl_url();
> +    if ( curlUrl == NULL )
> +        throw DAVException( DAVException::DAV_SESSION_CREATE, rtl::OUString::createFromAscii( "Out of memory" ) );
> +
> +    if ( CurlUri( path ).GetHost().isEmpty() )
> +    {
> +        // "path" is really a path, not a URI
> +        curl_url_set( curlUrl, CURLUPART_URL, rtl::OUStringToOString( uri.GetURI(), RTL_TEXTENCODING_UTF8 ).getStr(), 0 );
> +        curl_url_set( curlUrl, CURLUPART_PATH, rtl::OUStringToOString( path, RTL_TEXTENCODING_UTF8 ).getStr(), 0 );
> +    }
> +    else
> +    {
> +        // The "path" is a full URI
> +        curl_url_set( curlUrl, CURLUPART_URL, rtl::OUStringToOString( path, RTL_TEXTENCODING_UTF8 ).getStr(), 0 );
> +    }
> +    curl_easy_setopt( curl, CURLOPT_CURLU, curlUrl );
> +}
> +
> +CURLcode CurlRequest::copy( CurlUri uri, rtl::OUString path ) throw(DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "COPY" );
> +    return perform();
> +}
> +
> +CURLcode CurlRequest::delete_( CurlUri uri, rtl::OUString path ) throw (DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "DELETE" );
> +    return perform();    
> +}
> +
> +CURLcode CurlRequest::get( CurlUri uri, rtl::OUString path ) throw(DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "GET" );
> +    return perform();
> +}
> +
> +CURLcode CurlRequest::head( CurlUri uri, rtl::OUString path ) throw (DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_NOBODY, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "HEAD" );
> +    return perform();
> +}
> +
> +CURLcode CurlRequest::lock( CurlUri uri, rtl::OUString path ) throw (DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_UPLOAD, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "LOCK" );
> +    return perform();
> +}
> +
> +CURLcode CurlRequest::mkcol( CurlUri uri, rtl::OUString path ) throw (DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "MKCOL" );
> +    return perform();
> +}
> +
> +CURLcode CurlRequest::move( CurlUri uri, rtl::OUString path ) throw (DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "MOVE" );
> +    return perform();
> +}
> +
> +CURLcode CurlRequest::post( CurlUri uri, rtl::OUString path ) throw (DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_UPLOAD, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "POST" );
> +    return perform();
> +}
> +
> +CURLcode CurlRequest::propfind( CurlUri uri, rtl::OUString path ) throw (DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_UPLOAD, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "PROPFIND" );
> +    return perform();
> +}
> +
> +CURLcode CurlRequest::proppatch( CurlUri uri, rtl::OUString path ) throw (DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_UPLOAD, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "PROPPATCH" );
> +    return perform();
> +}
> +
> +CURLcode CurlRequest::put( CurlUri uri, rtl::OUString path ) throw (DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_UPLOAD, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "PUT" );
> +    return perform();
> +}
> +
> +CURLcode CurlRequest::unlock( CurlUri uri, rtl::OUString path ) throw (DAVException)
> +{
> +    setURI( uri, path );
> +    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
> +    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "UNLOCK" );
> +    return perform();
> +}
> +
> +CURLcode CurlRequest::perform() throw (DAVException)
> +{
> +    CURLcode rc = curl_easy_perform( curl );
> +    long statusCode = 0;
> +    curl_easy_getinfo( curl, CURLINFO_RESPONSE_CODE, &statusCode );
> +    if ( ( statusCode == 401 || statusCode == 407 ) && provideCredentialsCallback != NULL )
> +    {
> +        bool haveCredentials = provideCredentialsCallback( statusCode, provideCredentialsUserdata );
> +        if ( haveCredentials )
> +        {
> +            // rewind body:
> +            requestBodyOffset = 0;
> +            // retry with credentials:
> +            rc = curl_easy_perform( curl );
> +            // If this was to authenticate with the proxy, we may need to authenticate
> +            // with the destination host too:
> +            if ( statusCode == 407 )
> +            {
> +                curl_easy_getinfo( curl, CURLINFO_RESPONSE_CODE, &statusCode );
> +                if ( statusCode == 401 && provideCredentialsCallback != NULL )
> +                {
> +                    haveCredentials = provideCredentialsCallback( statusCode, provideCredentialsUserdata );
> +                    if ( haveCredentials )
> +                    {
> +                        // rewind body:
> +                        requestBodyOffset = 0;
> +                        // retry with credentials:
> +                        rc = curl_easy_perform( curl );
> +                    }
> +                }
> +            }
> +        }
> +    }
> +    return rc;
> +}
> +
> +size_t CurlRequest::Curl_HeaderReceived( char *buffer, size_t size, size_t nitems, void *userdata )
> +{
> +    CurlRequest *request = static_cast< CurlRequest* >( userdata );
> +    OSL_TRACE("Curl_HeaderReceived");
> +    request->curlHeaderReceived( buffer, nitems );
> +    return nitems;
> +}
> +
> +void CurlRequest::curlHeaderReceived( const char *buffer, size_t size )
> +{
> +    rtl::OString lineCrLf( buffer, size );
> +    sal_Int32 cr = lineCrLf.indexOf( "\r" );
> +    if ( cr < 0 )
> +        return;
> +
> +    rtl::OString line = lineCrLf.copy( 0, cr );
> +    if ( line.indexOf( "HTTP/" ) == 0 )
> +    {
> +        // Status line
> +        // Throw away any response headers from a prior response:
> +        responseHeaders.clear();
> +        sal_Int32 idxFirstSpace = line.indexOf( ' ' );
> +        if ( idxFirstSpace > 0 )
> +        {
> +            int idxSecondSpace = line.indexOf( ' ', idxFirstSpace + 1 );
> +            if ( idxSecondSpace > 0 )
> +            {
> +                reasonPhrase = line.copy( idxSecondSpace + 1 );
> +                statusCode = line.copy( idxFirstSpace + 1, idxSecondSpace - idxFirstSpace - 1 ).toInt32();
> +            }
> +            else
> +            {
> +                reasonPhrase = "";
> +                statusCode = line.copy( idxFirstSpace + 1 ).toInt32();
> +            }
> +        }
> +    }
> +    else
> +    {
> +        // Header line
> +        if ( line.getLength() == 0 )
> +        {
> +            // End of HTTP header
> +            // Discard any intermediate body from 100 Trying or 401 Authentication required:
> +            responseBodyInputStream = new CurlInputStream();
> +            return;
> +        }
> +        sal_Int32 colon = line.indexOf( ':' );
> +        if ( colon < 0 )
> +        {
> +            OSL_TRACE("Non-empty HTTP line without a ':'. Folded header deprecated by RFC 7230?");
> +            return;
> +        }
> +        Header header;
> +        header.name = line.copy( 0, colon ).toAsciiLowerCase();
> +        header.value = line.copy( colon + 1 ).trim();
> +        responseHeaders.push_back(header);
> +    }
> +}
> +
> +const CurlRequest::Header *CurlRequest::findResponseHeader( const rtl::OString &name )
> +{
> +    std::vector< CurlRequest::Header >::const_iterator it( responseHeaders.begin() );
> +    const std::vector< CurlRequest::Header >::const_iterator end( responseHeaders.end() );
> +    for ( ; it != end; it++ )
> +    {
> +        if ( name.equalsIgnoreAsciiCase( it->name ) )
> +            return &(*it);
> +    }
> +    return NULL;
> +}
> +
> +void CurlRequest::saveResponseBodyTo( const uno::Reference< io::XOutputStream > & xOutStream)
> +{
> +    xOutputStream = xOutStream;
> +}
> +
> +size_t CurlRequest::Curl_MoreBodyReceived( char *buffer, size_t size, size_t nitems, void *userdata )
> +{
> +    CurlRequest *request = static_cast< CurlRequest* >( userdata );
> +    request->curlMoreBodyReceived( buffer, nitems );
> +    return nitems;
> +}
> +
> +void CurlRequest::curlMoreBodyReceived( const char *buffer, size_t size )
> +{
> +    if ( xOutputStream.is() )
> +    {
> +        const uno::Sequence< sal_Int8 > aDataSeq( (sal_Int8 *)buffer, size );
> +        xOutputStream->writeBytes( aDataSeq );
> +    }
> +    else if ( responseBodyInputStream.is() )
> +        responseBodyInputStream->AddToStream( buffer, size );
> +}
> \ No newline at end of file
> diff --git a/main/ucb/source/ucp/webdav/CurlRequest.hxx b/main/ucb/source/ucp/webdav/CurlRequest.hxx
> new file mode 100644
> index 0000000000..3c7093e0c6
> --- /dev/null
> +++ b/main/ucb/source/ucp/webdav/CurlRequest.hxx
> @@ -0,0 +1,130 @@
> +/**************************************************************
> + *
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + *
> + *   http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + *
> + *************************************************************/
> +
> +#ifndef INCLUDED_CURLREQUEST_HXX
> +#define INCLUDED_CURLREQUEST_HXX
> +
> +#include <vector>
> +#include "DAVException.hxx"
> +#include <com/sun/star/io/XOutputStream.hpp>
> +#include "CurlInputStream.hxx"
> +#include "CurlTypes.hxx"
> +#include "CurlUri.hxx"
> +#include <curl/curl.h>
> +
> +namespace http_dav_ucp
> +{
> +
> +/* Since Curl persists all settings for the duration of
> + * the CURL* structure, and we need some of them to only last for
> + * the duration of a request, use this class to reset the short-lived
> + * settings at the end of each request using RAII, and to capture
> + * some results in a convenient format.
> + *
> + * Features are opt-in to their non-default values.
> + *
> + * External pointers (CURL*, request body, etc.) are only shared with us,
> + * never copied, temporarily used by us, and never belong to us.
> + */
> +class CurlRequest
> +{
> +public:
> +    class Header
> +    {
> +    public:
> +        rtl::OString name;
> +        rtl::OString value;
> +    };
> +    
> +    CurlRequest( CURL *curl );
> +    ~CurlRequest();
> +
> +    // Request setup methods:
> +    void addHeader( const rtl::OString &name, const rtl::OString &value ) throw (DAVException);
> +    void setRequestBody( const char *body, size_t size );
> +    bool isChunkedEncoding() { return useChunkedEncoding; }
> +    void setChunkedEncoding( bool isChunkedEncoding ) { useChunkedEncoding = isChunkedEncoding; }
> +    void saveResponseBodyTo( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xOutputStream );
> +    void setProvideCredentialsCallback(
> +        bool (*provideCredsCallback)(long statusCode, void *userdata) throw (DAVException),
> +        void *credsUserdata );
> +
> +    // Requests
> +    CURLcode copy( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +    CURLcode delete_( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +    CURLcode get( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +    CURLcode head( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +    CURLcode lock( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +    CURLcode mkcol( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +    CURLcode move( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +    CURLcode post( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +    CURLcode propfind( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +    CURLcode proppatch( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +    CURLcode put( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +    CURLcode unlock( CurlUri uri, rtl::OUString path ) throw(DAVException);
> +
> +    // Response methods:
> +    int getStatusCode() { return statusCode; }
> +    rtl::OString& getReasonPhrase() { return reasonPhrase; }
> +    // TODO: a multimap would be O(n * log(m)) instead of O(n * m)
> +    std::vector<Header>& getResponseHeaders() { return responseHeaders; }
> +    const Header *findResponseHeader( const rtl::OString &name );
> +    com::sun::star::uno::Reference < CurlInputStream > getResponseBody() { return responseBodyInputStream; }
> +    
> +private:
> +    CurlRequest( const CurlRequest &curlRequest ); // No copy constructor.
> +    void setURI( CurlUri uri, rtl::OUString path ) throw (DAVException);
> +    CURLcode perform() throw (DAVException);
> +    
> +    static int Curl_SeekCallback(void *userp, curl_off_t offset, int origin);
> +
> +    static size_t Curl_SendMoreBody( char *buffer, size_t size, size_t nitems, void *userdata );
> +    size_t curlSendMoreBody( char *buffer, size_t len );
> +
> +    static size_t Curl_HeaderReceived( char *buffer, size_t size, size_t nitems, void *userdata );
> +    void curlHeaderReceived( const char *buffer, size_t len );
> +
> +    static size_t Curl_MoreBodyReceived( char *buffer, size_t size, size_t nitems, void *userdata );
> +    void curlMoreBodyReceived( const char *buffer, size_t len );
> +
> +    CURL *curl;
> +    CURLU *curlUrl;
> +    
> +    // Request values:
> +    curl_slist *requestHeaders;
> +    const char *requestBody;
> +    size_t requestBodyOffset;
> +    size_t requestBodySize;
> +    bool useChunkedEncoding;
> +    bool (*provideCredentialsCallback)( long statusCode, void *userdata ) throw (DAVException);
> +    void *provideCredentialsUserdata;
> +    
> +    // Response values:
> +    rtl::OString reasonPhrase;
> +    int statusCode;
> +    std::vector<Header> responseHeaders;
> +    com::sun::star::uno::Reference < CurlInputStream > responseBodyInputStream;
> +    com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > xOutputStream;
> +};
> +
> +} // namespace http_dav_ucp
> +
> +#endif // INCLUDED_CURLREQUEST_HXX
> \ No newline at end of file
> diff --git a/main/ucb/source/ucp/webdav/CurlSession.cxx b/main/ucb/source/ucp/webdav/CurlSession.cxx
> new file mode 100644
> index 0000000000..5ca143273e
> --- /dev/null
> +++ b/main/ucb/source/ucp/webdav/CurlSession.cxx
> @@ -0,0 +1,1959 @@
> +/**************************************************************
> + *
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + *
> + *   http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + *
> + *************************************************************/
> +
> +
> +
> +// MARKER(update_precomp.py): autogen include statement, do not remove
> +#include "precompiled_webdav.hxx"
> +
> +#include <hash_map>
> +#include <vector>
> +#include <string.h>
> +#include <rtl/string.h>
> +#include <rtl/strbuf.hxx>
> +#include <rtl/ustrbuf.hxx>
> +#include <osl/time.h>
> +#include "comphelper/sequence.hxx"
> +#include "ucbhelper/simplecertificatevalidationrequest.hxx"
> +
> +#include "DAVAuthListener.hxx"
> +#include "CurlTypes.hxx"
> +#include "CurlSession.hxx"
> +#include "LockRequest.hxx"
> +#include "PropfindRequest.hxx"
> +#include "ProppatchRequest.hxx"
> +#include "CurlInputStream.hxx"
> +#include "UCBDeadPropertyValue.hxx"
> +#include "webdavuseragent.hxx"
> +#include "webdavresponseparser.hxx"
> +#include "webdavprovider.hxx"
> +
> +
> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
> +#include <com/sun/star/logging/LogLevel.hpp>
> +#include <com/sun/star/security/XCertificate.hpp>
> +#include <com/sun/star/security/CertificateValidity.hpp>
> +#include <com/sun/star/security/CertificateContainerStatus.hpp>
> +#include <com/sun/star/security/CertificateContainer.hpp>
> +#include <com/sun/star/security/XCertificateContainer.hpp>
> +#include <com/sun/star/security/CertAltNameEntry.hpp>
> +#include <com/sun/star/security/XSanExtension.hpp>
> +#include <com/sun/star/ucb/Lock.hpp>
> +#include <com/sun/star/xml/crypto/XSEInitializer.hpp>
> +
> +using namespace com::sun::star;
> +using namespace com::sun::star::logging;
> +using namespace http_dav_ucp;
> +
> +#define OID_SUBJECT_ALTERNATIVE_NAME "2.5.29.17"
> +
> +struct CredentialsData
> +{
> +    CredentialsData( CurlSession *curlSession, CurlRequest &curlRequest, const DAVRequestEnvironment &requestEnvironment )
> +    : session( curlSession)
> +    , request( curlRequest )
> +    , env( requestEnvironment )
> +    {}
> +
> +    CurlSession *session;
> +    CurlRequest &request;
> +    const DAVRequestEnvironment &env;
> +};
> +
> +// -------------------------------------------------------------------
> +// static members!
> +CurlLockStore CurlSession::m_aCurlLockStore;
> +
> +
> +// -------------------------------------------------------------------
> +// Constructor
> +// -------------------------------------------------------------------
> +CurlSession::CurlSession(
> +        const rtl::Reference< DAVSessionFactory > & rSessionFactory,
> +        const rtl::OUString& inUri,
> +        const ucbhelper::InternetProxyDecider & rProxyDecider )
> +    throw ( DAVException )
> +    : DAVSession( rSessionFactory )
> +    , m_aMutex()
> +    , m_aContext( m_xFactory->getServiceFactory() )
> +    , m_aLogger( m_aContext.getUNOContext(), WEBDAV_CONTENT_PROVIDER_SERVICE_NAME )
> +    , m_aUri( inUri )
> +    , m_aProxyName()
> +    , m_nProxyPort( 0 )
> +    , m_aServerHeaderField()
> +    , m_pCurl( 0 )
> +    , m_bUseChunkedEncoding( false )
> +    , m_bTransferEncodingSwitched( false )
> +    , m_rProxyDecider( rProxyDecider )
> +    , m_aEnv()
> +{
> +    m_pCurl = curl_easy_init();
> +    
> +    curl_easy_setopt( m_pCurl, CURLOPT_HTTPAUTH, CURLAUTH_ANY );
> +    curl_easy_setopt( m_pCurl, CURLOPT_PROXYAUTH, CURLAUTH_ANY );
> +    
> +    curl_easy_setopt( m_pCurl, CURLOPT_SSL_CTX_FUNCTION, Curl_SSLContextCallback );
> +    curl_easy_setopt( m_pCurl, CURLOPT_SSL_CTX_DATA, this );
> +
> +    if ( m_aLogger.getLogLevel() == LogLevel::FINEST )
> +    {
> +        curl_easy_setopt( m_pCurl, CURLOPT_DEBUGFUNCTION, Curl_DebugCallback );
> +        curl_easy_setopt( m_pCurl, CURLOPT_DEBUGDATA, this );
> +        curl_easy_setopt( m_pCurl, CURLOPT_VERBOSE, 1L);
> +    }
> +    m_aLogger.log( LogLevel::INFO, "CurlSession::CurlSession with URL $1$",
> +        rtl::OUStringToOString( inUri, RTL_TEXTENCODING_UTF8 ).getStr() );
> +}
> +
> +// -------------------------------------------------------------------
> +// Destructor
> +// -------------------------------------------------------------------
> +CurlSession::~CurlSession( )
> +{
> +    if ( m_pCurl )
> +    {
> +        curl_easy_cleanup( m_pCurl );
> +        m_pCurl = 0;
> +        m_aLogger.log( LogLevel::INFO, "CurlSession::~CurlSession: closed curl session");
> +    }
> +}
> +
> +// -------------------------------------------------------------------
> +void CurlSession::Init( const DAVRequestEnvironment & rEnv )
> +  throw ( DAVException )
> +{
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +    m_aEnv = rEnv;
> +    Init();
> +}
> +
> +// -------------------------------------------------------------------
> +void CurlSession::Init()
> +    throw ( DAVException )
> +{
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    const sal_Char *url = rtl::OUStringToOString( m_aUri.GetURI(), RTL_TEXTENCODING_UTF8 ).getStr();
> +    CURLcode rc;
> +    rc = curl_easy_setopt( m_pCurl, CURLOPT_URL, url );
> +    if ( rc != CURLE_OK  )
> +        throw DAVException( DAVException::DAV_SESSION_CREATE,
> +                            CurlUri::makeConnectionEndPointString( m_aUri.GetHost(), m_aUri.GetPort() ) );
> +
> +    const ucbhelper::InternetProxyServer & rProxyCfg = getProxySettings();
> +    if ( ( rProxyCfg.aName != m_aProxyName )
> +        || ( rProxyCfg.nPort != m_nProxyPort ) )
> +    {
> +        m_aProxyName = rProxyCfg.aName;
> +        m_nProxyPort = rProxyCfg.nPort;
> +        if ( !m_aProxyName.isEmpty() )
> +        {
> +            m_aLogger.log( LogLevel::INFO, "Using $1$ proxy server at $2$:$3$",
> +                m_aUri.GetScheme(), m_aProxyName, m_nProxyPort );
> +            curl_easy_setopt( m_pCurl, CURLOPT_PROXY, rtl::OUStringToOString( m_aProxyName, RTL_TEXTENCODING_UTF8 ).getStr() );
> +            curl_easy_setopt( m_pCurl, CURLOPT_PROXYPORT, (long)m_nProxyPort );
> +            if ( m_aUri.GetScheme().equalsAscii( "https" ) )
> +                curl_easy_setopt( m_pCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTPS );
> +            else
> +                curl_easy_setopt( m_pCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP );
> +            // no other proxy types are implemented by AOO
> +        }
> +        else
> +        {
> +            // Empty string as opposed to NULL, means don't use the default curl proxy.
> +            m_aLogger.log( LogLevel::INFO, "Not using a proxy server" );
> +            curl_easy_setopt( m_pCurl, CURLOPT_PROXY, "" );
> +        }
> +        // if we change the proxy settings, clear the credentials for the previous proxy too
> +        curl_easy_setopt( m_pCurl, CURLOPT_PROXYUSERNAME, "" );
> +        curl_easy_setopt( m_pCurl, CURLOPT_PROXYPASSWORD, "" );
> +    }
> +}
> +
> +bool CurlSession::isSSLNeeded()
> +{
> +    return m_aUri.GetScheme().equalsIgnoreAsciiCase( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "https" ) ) );
> +}
> +
> +// -------------------------------------------------------------------
> +// helper function
> +// it composes the uri for lockstore registration
> +rtl::OUString CurlSession::composeCurrentUri(const rtl::OUString & inPath)
> +{
> +    rtl::OUString aScheme( m_aUri.GetScheme() );
> +    rtl::OUStringBuffer aBuf( aScheme );
> +    aBuf.appendAscii( "://" );
> +    if ( m_aUri.GetUserName().getLength() > 0 )
> +    {
> +        aBuf.append( m_aUri.GetUserName() );
> +        if ( m_aUri.GetPassword().getLength() > 0 )
> +        {
> +            aBuf.appendAscii( ":" );
> +            aBuf.append( m_aUri.GetPassword() );
> +        }
> +        aBuf.appendAscii( "@" );
> +    }
> +    // Is host a numeric IPv6 address?
> +    if ( ( m_aUri.GetHost().indexOf( ':' ) != -1 ) &&
> +         ( m_aUri.GetHost()[ 0 ] != sal_Unicode( '[' ) ) )
> +    {
> +        aBuf.appendAscii( "[" );
> +        aBuf.append( m_aUri.GetHost() );
> +        aBuf.appendAscii( "]" );
> +    }
> +    else
> +    {
> +        aBuf.append( m_aUri.GetHost() );
> +    }
> +
> +    // append port, but only, if not default port.
> +    bool bAppendPort = true;
> +    sal_Int32 aPort = m_aUri.GetPort();
> +    switch ( aPort )
> +    {
> +    case DEFAULT_HTTP_PORT:
> +        bAppendPort = aScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "http" ) );
> +        break;
> +
> +    case DEFAULT_HTTPS_PORT:
> +        bAppendPort = !aScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) );
> +        break;
> +    }
> +    if ( bAppendPort )
> +    {
> +        aBuf.appendAscii( ":" );
> +        aBuf.append( rtl::OUString::valueOf( aPort ) );
> +    }
> +    aBuf.append( inPath );
> +
> +    rtl::OUString   aUri(aBuf.makeStringAndClear() );
> +    return aUri;
> +}
> +
> +// -------------------------------------------------------------------
> +// virtual
> +sal_Bool CurlSession::CanUse( const rtl::OUString & inUri )
> +{
> +    try
> +    {
> +        CurlUri theUri( inUri );
> +        if ( ( theUri.GetPort() == m_aUri.GetPort() ) &&
> +             ( theUri.GetHost() == m_aUri.GetHost() ) &&
> +             ( theUri.GetScheme() == m_aUri.GetScheme() ) )
> +        {
> +            return sal_True;
> +        }
> +    }
> +    catch ( DAVException const & )
> +    {
> +        return sal_False;
> +    }
> +    return sal_False;
> +}
> +
> +// -------------------------------------------------------------------
> +// virtual
> +sal_Bool CurlSession::UsesProxy()
> +{
> +    Init();
> +    return ( m_aProxyName.getLength() > 0 );
> +}
> +
> +int CurlSession::Curl_DebugCallback( CURL *, curl_infotype type, unsigned char *data, size_t size, void* userdata )
> +{
> +    CurlSession *session = static_cast< CurlSession* >( userdata );
> +    return session->curlDebugOutput( type, reinterpret_cast<char*>( data ), size );
> +}
> +
> +int CurlSession::curlDebugOutput( curl_infotype type, char *data, int size )
> +{
> +    const char *prefix;
> +    switch ( type )
> +    {
> +        case CURLINFO_TEXT:
> +            prefix = "[CurlINFO  ]";
> +            break;
> +        case CURLINFO_HEADER_IN:
> +            prefix = "[CurlHDR <-]";
> +            break;
> +        case CURLINFO_HEADER_OUT:
> +            prefix = "[CurlHDR ->]";
> +            break;
> +        case CURLINFO_DATA_IN:
> +            prefix = "[CurlData<-]";
> +            break;
> +        case CURLINFO_DATA_OUT:
> +            prefix = "[CurlData->]";
> +            break;
> +        default:
> +            return 0;
> +    }
> +
> +    // Trim the trailing \r\n
> +    if ( size >= 1 && ( data[size - 1] == '\r' || data[size - 1] == '\n' ) )
> +        --size;
> +    if ( size >= 1 && ( data[size - 1] == '\r' || data[size - 1] == '\n' ) )
> +        --size;
> +    rtl::OString message( data, size );
> +    m_aLogger.log( LogLevel::FINEST, "$1$ $2$", prefix, message );
> +    return 0;
> +}
> +
> +CURLcode CurlSession::Curl_SSLContextCallback( CURL *, void *ssl_ctx, void *userptr )
> +{
> +    CurlSession *session = static_cast<CurlSession*>( userptr );
> +    SSL_CTX *context = static_cast<SSL_CTX*>( ssl_ctx );
> +    SSL_CTX_set_app_data( context, session );
> +    SSL_CTX_set_verify( context, SSL_VERIFY_PEER, OPENSSL_ValidateServerCertificate );
> +    return CURLE_OK;
> +}
> +
> +int CurlSession::OPENSSL_ValidateServerCertificate( int preverify_ok, X509_STORE_CTX *x509_ctx )
> +{
> +    SSL *ssl = static_cast<SSL*> (
> +        X509_STORE_CTX_get_ex_data( x509_ctx, SSL_get_ex_data_X509_STORE_CTX_idx() ) );
> +    SSL_CTX *ssl_ctx = SSL_get_SSL_CTX( ssl );
> +    CurlSession *session = static_cast<CurlSession*>( SSL_CTX_get_app_data( ssl_ctx ) );
> +    int verifyOk = session->validateServerX509Certificate( x509_ctx, preverify_ok );
> +    // When a certificate's verification fails within OpenSSL, yet passes from the
> +    // SSL_CTX_set_verify() callback (ie. this function) (by returning 1),
> +    // OpenSSL allows the connection to proceed, yet stores that last verification
> +    // error and allows it to be retrieved using SSL_get_verify_result(3).
> +    //
> +    // Unfortunately, Curl calls SSL_get_verify_result(3) internally, and treats
> +    // errors as terminal, disconnecting with an error even when we return 1 here.
> +    // Therefore, to approve a certificate that OpenSSL would reject, we have to
> +    // both return 1, and overwrite the X509_STORE_CTX's last error with X509_V_OK:
> +    if ( verifyOk )
> +        X509_STORE_CTX_set_error( x509_ctx, X509_V_OK );
> +    return verifyOk;
> +}
> +
> +static uno::Sequence< sal_Int8 > convertCertificateToAsn1Der( X509 *certificate )
> +{
> +    uno::Sequence< sal_Int8 > asn1DerCertificate;
> +    int len = i2d_X509( certificate, NULL );
> +    if ( len < 0 )
> +        return asn1DerCertificate;
> +    asn1DerCertificate.realloc( len );
> +    unsigned char *end = reinterpret_cast< unsigned char *>( asn1DerCertificate.getArray() );
> +    len = i2d_X509( certificate, &end );
> +    if ( len >= 0 )
> +        return asn1DerCertificate;
> +    else
> +        return uno::Sequence< sal_Int8 >();
> +}
> +
> +int CurlSession::validateServerX509Certificate( X509_STORE_CTX *x509StoreContext, int verifyOk )
> +{
> +    X509 *serverCertificate = X509_STORE_CTX_get_current_cert( x509StoreContext );
> +    int depth = X509_STORE_CTX_get_error_depth( x509StoreContext );
> +    STACK_OF(X509) *chain =
> +#if OPENSSL_VERSION_NUMBER >= 0x10100000L
> +         X509_STORE_CTX_get0_chain( x509StoreContext );
> +#else
> +         X509_STORE_CTX_get_chain( x509StoreContext );
> +#endif
> +    
> +    if ( depth == 0 ) {
> +        std::vector< uno::Sequence< sal_Int8 > > asn1DerCertificates;
> +        if ( chain != NULL ) {
> +            int nCertificates = sk_X509_num( chain );
> +            for ( int i = 0; i < nCertificates; i++ ) {
> +                X509 *certificate = sk_X509_value( chain, i );
> +                uno::Sequence< sal_Int8 > asn1DerCertificate = convertCertificateToAsn1Der( certificate );
> +                if ( asn1DerCertificate.getLength() == 0 )
> +                    return 0;
> +                asn1DerCertificates.push_back( asn1DerCertificate );
> +            }
> +        } else {
> +            uno::Sequence< sal_Int8 > asn1DerCertificate = convertCertificateToAsn1Der( serverCertificate );
> +            if ( asn1DerCertificate.getLength() == 0 )
> +                return 0;
> +            asn1DerCertificates.push_back( asn1DerCertificate );
> +        }
> +        verifyOk = verifyCertificateChain( asn1DerCertificates );
> +    }
> +    m_aLogger.log( LogLevel::FINE, "validateServerX509Certificate() returning $1$ at depth $2$",
> +        (sal_Int32)verifyOk, (sal_Int32)depth );
> +    return verifyOk;
> +}
> +
> +int CurlSession::verifyCertificateChain (
> +    std::vector< uno::Sequence< sal_Int8 > > &asn1DerCertificates )
> +{
> +    // Check arguments.
> +    if (asn1DerCertificates.size()<=0)
> +    {
> +        OSL_ASSERT(asn1DerCertificates.size()>0);
> +        return 0;
> +    }
> +
> +    // Create some crypto objects to decode and handle the base64
> +    // encoded certificate chain.
> +    uno::Reference< xml::crypto::XSEInitializer > xSEInitializer;
> +    uno::Reference< security::XCertificateContainer > xCertificateContainer;
> +    uno::Reference< xml::crypto::XXMLSecurityContext > xSecurityContext;
> +    uno::Reference< xml::crypto::XSecurityEnvironment > xSecurityEnv;
> +    try
> +    {
> +        // Create a certificate container.
> +        xCertificateContainer = uno::Reference< security::XCertificateContainer >(
> +            getMSF()->createInstance(
> +                rtl::OUString::createFromAscii(
> +                    "com.sun.star.security.CertificateContainer" ) ),
> +            uno::UNO_QUERY_THROW);
> +
> +        xSEInitializer = uno::Reference< xml::crypto::XSEInitializer >(
> +            getMSF()->createInstance(
> +                rtl::OUString::createFromAscii( "com.sun.star.xml.crypto.SEInitializer" ) ),
> +            uno::UNO_QUERY_THROW);
> +
> +        xSecurityContext = xSEInitializer->createSecurityContext( rtl::OUString() );
> +        if (xSecurityContext.is())
> +            xSecurityEnv = xSecurityContext->getSecurityEnvironment();
> +
> +        if ( ! xSecurityContext.is() || ! xSecurityEnv.is())
> +        {
> +            // Do we have to dispose xSEInitializer or xCertificateContainer?
> +            m_aLogger.log( LogLevel::WARNING, "Failure creating security services for certificate verification" );
> +            return 0;
> +        }
> +    }
> +    catch ( uno::Exception const &e)
> +    {
> +        m_aLogger.log( LogLevel::WARNING, "Error creating security services: $1$", e.Message );
> +        return 0;
> +    }
> +
> +    // Decode the server certificate.
> +    uno::Reference< security::XCertificate > xServerCertificate(
> +        xSecurityEnv->createCertificateFromRaw( asn1DerCertificates[0] ) );
> +    if ( ! xServerCertificate.is())
> +    {
> +        m_aLogger.log( LogLevel::WARNING, "Failed to create XCertificate" );
> +        return 0;
> +    }
> +
> +    // Get the subject from the server certificate.
> +    ::rtl::OUString sServerCertificateSubject (xServerCertificate->getSubjectName());
> +    sal_Int32 nIndex = 0;
> +    while (nIndex >= 0)
> +    {
> +        const ::rtl::OUString sToken (sServerCertificateSubject.getToken(0, ',', nIndex));
> +        if (sToken.compareToAscii("CN=", 3) == 0)
> +        {
> +            sServerCertificateSubject = sToken.copy(3);
> +            break;
> +        }
> +        else if (sToken.compareToAscii(" CN=", 4) == 0)
> +        {
> +            sServerCertificateSubject = sToken.copy(4);
> +            break;
> +        }
> +    }
> +
> +    // When the certificate container already contains a (trusted)
> +    // entry for the server then we do not have to authenticate any
> +    // certificate.
> +    const security::CertificateContainerStatus eStatus (
> +        xCertificateContainer->hasCertificate(
> +            getHostName(), sServerCertificateSubject ) );
> +    if (eStatus != security::CertificateContainerStatus_NOCERT)
> +    {
> +        m_aLogger.log( LogLevel::FINER, "Cached certificate found with status=$1$",
> +                eStatus == security::CertificateContainerStatus_TRUSTED ? "trusted" : "untrusted" );
> +        return eStatus == security::CertificateContainerStatus_TRUSTED
> +               ? 1
> +               : 0;
> +    }
> +
> +    // The shortcut failed, so try to verify the whole chain. This is
> +    // done outside the isDomainMatch() block because the result is
> +    // used by the interaction handler.
> +    std::vector< uno::Reference< security::XCertificate > > aChain;
> +    for (nIndex=0; nIndex < asn1DerCertificates.size(); ++nIndex)
> +    {
> +        uno::Reference< security::XCertificate > xCertificate(
> +            xSecurityEnv->createCertificateFromRaw( asn1DerCertificates[ nIndex ] ) );
> +        if ( ! xCertificate.is())
> +        {
> +            m_aLogger.log( LogLevel::FINE, "Failed to create XCertificate $1$", nIndex );
> +            return 0;
> +        }
> +        aChain.push_back(xCertificate);
> +    }
> +    const sal_Int64 nVerificationResult (xSecurityEnv->verifyCertificate(
> +            xServerCertificate,
> +            ::comphelper::containerToSequence(aChain)));
> +
> +    // When the certificate matches the host name then we can use the
> +    // result of the verification.
> +    bool bHostnameMatchesCertHostnames = false;
> +    {
> +        uno::Sequence< uno::Reference< security::XCertificateExtension > > extensions = xServerCertificate->getExtensions();
> +        uno::Sequence< security::CertAltNameEntry > altNames;
> +        for (sal_Int32 i = 0 ; i < extensions.getLength(); ++i)
> +        {
> +            uno::Reference< security::XCertificateExtension >element = extensions[i];
> +
> +            const rtl::OString aId ( (const sal_Char *)element->getExtensionId().getArray(), element->getExtensionId().getLength());
> +            if ( aId.equals( OID_SUBJECT_ALTERNATIVE_NAME ) )
> +            {
> +                uno::Reference< security::XSanExtension > sanExtension ( element, uno::UNO_QUERY );
> +                altNames = sanExtension->getAlternativeNames();
> +                break;
> +            }
> +        }
> +
> +        uno::Sequence< ::rtl::OUString > certHostNames(altNames.getLength() + 1);
> +        certHostNames[0] = sServerCertificateSubject;
> +        for( int n = 0; n < altNames.getLength(); ++n )
> +        {
> +            if (altNames[n].Type == security::ExtAltNameType_DNS_NAME)
> +            {
> +                altNames[n].Value >>= certHostNames[n+1];
> +            }
> +        }
> +
> +        for ( int i = 0; i < certHostNames.getLength() && !bHostnameMatchesCertHostnames; ++i )
> +        {
> +            bHostnameMatchesCertHostnames = isDomainMatch( certHostNames[i] );
> +        }
> +
> +    }
> +    m_aLogger.log( LogLevel::FINE, "URL hostname $1$ certificate hostname",
> +        bHostnameMatchesCertHostnames ? "matches" : "DOESN'T MATCH" );
> +    if ( bHostnameMatchesCertHostnames )
> +    {
> +        if (nVerificationResult == 0)
> +        {
> +            m_aLogger.log( LogLevel::FINE, "Certificate (chain) is valid" );
> +            xCertificateContainer->addCertificate(getHostName(), sServerCertificateSubject, sal_True);
> +            return 1;
> +        }
> +        else if ((nVerificationResult & security::CertificateValidity::CHAIN_INCOMPLETE) != 0)
> +        {
> +            // We do not have enough information for verification,
> +            // neither automatically (as we just discovered) nor
> +            // manually (so there is no point in showing any dialog.)
> +            m_aLogger.log( LogLevel::WARNING, "Certificate (chain) is incomplete" );
> +            return 0;
> +        }
> +        else if ((nVerificationResult & security::CertificateValidity::REVOKED) != 0)
> +        {
> +            // Certificate (chain) is invalid.
> +            m_aLogger.log( LogLevel::WARNING, "Certificate (chain) is revoked" );
> +            xCertificateContainer->addCertificate(getHostName(), sServerCertificateSubject,  sal_False);
> +            return 0;
> +        }
> +        else
> +        {
> +            // For all other we have to ask the user.
> +            m_aLogger.log( LogLevel::FINE, "Promping user to validate the certificate" );
> +        }
> +    }
> +
> +    // We have not been able to automatically verify (or falsify) the
> +    // certificate chain. To resolve this we have to ask the user.
> +    const uno::Reference< ucb::XCommandEnvironment > xEnv( getRequestEnvironment().m_xEnv );
> +    if ( xEnv.is() )
> +    {
> +        uno::Reference< task::XInteractionHandler > xIH( xEnv->getInteractionHandler() );
> +        if ( xIH.is() )
> +        {
> +            rtl::Reference< ucbhelper::SimpleCertificateValidationRequest >
> +                xRequest( new ucbhelper::SimpleCertificateValidationRequest(
> +                        static_cast<sal_Int32>(nVerificationResult), xServerCertificate, getHostName() ) );
> +            xIH->handle( xRequest.get() );
> +
> +            rtl::Reference< ucbhelper::InteractionContinuation > xSelection
> +                = xRequest->getSelection();
> +
> +            if ( xSelection.is() )
> +            {
> +                uno::Reference< task::XInteractionApprove > xApprove( xSelection.get(), uno::UNO_QUERY );
> +                if ( xApprove.is() )
> +                {
> +                    m_aLogger.log( LogLevel::FINE, "The user approved the certificate" );
> +                    xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_True );
> +                    return 1;
> +                }
> +                else
> +                {
> +                    // Don't trust cert
> +                    m_aLogger.log( LogLevel::FINE, "The user REJECTED the certificate" );
> +                    xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_False );
> +                    return 0;
> +                }
> +            }
> +        }
> +        else
> +        {
> +            // Don't trust cert
> +            m_aLogger.log( LogLevel::WARNING, "Couldn't create the interaction handler for user feedback, rejecting the certificate" );
> +            xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_False );
> +            return 0;
> +        }
> +    }
> +    m_aLogger.log( LogLevel::WARNING, "No XCommandEnvironment, rejecting the certificate" );
> +
> +    return 0;
> +}
> +
> +bool CurlSession::Curl_ProvideCredentials( long statusCode, void *userdata ) throw (DAVException)
> +{
> +    CredentialsData *credentialsData = (CredentialsData*)userdata;
> +    return credentialsData->session->provideCredentials( credentialsData->env, credentialsData->request, statusCode );
> +}
> +
> +bool CurlSession::provideCredentials( const DAVRequestEnvironment &env, CurlRequest &request, long statusCode ) throw (DAVException)
> +{
> +    DAVAuthListener * pListener = env.m_xAuthListener.get();
> +    if ( !pListener )
> +    {
> +        // abort
> +        m_aLogger.log( LogLevel::FINE, "No DAVAuthListener found, failing credentials entry" );
> +        return false;
> +    }
> +
> +    rtl::OUString theUserName;
> +    rtl::OUString thePassWord;
> +    try
> +    {
> +        CurlUri uri( env.m_aRequestURI );
> +        theUserName = uri.GetUserName();
> +        thePassWord = uri.GetPassword();
> +    }
> +    catch ( DAVException const &e )
> +    {
> +        // abort
> +        m_aLogger.log(
> +            LogLevel::WARNING,
> +            "Error extracing userinfo from URI: exceptionCode=$1$, status=$2$, data=$3$, owner=$4$, extendedError=$5%",
> +            (sal_Int32)e.getError(), e.getStatus(), e.getData(), e.getOwner(), e.getExtendedError()
> +        );
> +        return false;
> +    }
> +    
> +    bool canUseSystemCreds = false;
> +    long authMethods = 0;
> +    CURLcode rc = CURLE_OK;
> +    if ( statusCode == 401 )
> +        rc = curl_easy_getinfo( m_pCurl, CURLINFO_HTTPAUTH_AVAIL, &authMethods );
> +    else if ( statusCode == 407 )
> +        rc = curl_easy_getinfo( m_pCurl, CURLINFO_PROXYAUTH_AVAIL, &authMethods );
> +    if ( rc == 0 )
> +        canUseSystemCreds = (authMethods & CURLAUTH_NEGOTIATE) || (authMethods & CURLAUTH_NTLM);
> +    m_aLogger.log( LogLevel::FINE, "authMethods=$1$, canUseSystemCreds=$2$",
> +        (sal_Int64)authMethods, (sal_Int32)canUseSystemCreds );
> +    
> +    const CurlRequest::Header *authHeader = NULL;
> +    if ( statusCode == 401 )
> +        authHeader = request.findResponseHeader( "WWW-Authenticate" );
> +    else if ( statusCode == 407 )
> +        authHeader = request.findResponseHeader( "Proxy-Authenticate" );
> +    rtl::OUString realm;
> +    if ( authHeader != NULL )
> +    {
> +        int realmStart = authHeader->value.indexOf( "realm=\"" );
> +        if ( realmStart >= 0 )
> +        {
> +            realmStart += 7;
> +            int realmEnd = authHeader->value.indexOf( "\"", realmStart );
> +            if ( realmEnd > 0 )
> +                realm = rtl::OStringToOUString( authHeader->value.copy( realmStart, realmEnd - realmStart ), RTL_TEXTENCODING_UTF8 );
> +        }
> +    }
> +    
> +    int theRetVal = pListener->authenticate( realm,
> +                                             getHostName(),
> +                                             theUserName,
> +                                             thePassWord,
> +                                             canUseSystemCreds,
> +                                             // Authenticating with both the proxy
> +                                             // and the destination server requires sal_True here,
> +                                             // and needs filling out 2 x password dialogs.
> +                                             sal_True );
> +
> +    if ( theRetVal == 0 )
> +    {
> +        m_aLogger.log( LogLevel::FINEST, "got credentials for user=$1$ on realm=$2$", theUserName, realm );
> +        // "System credentials" means username and password are empty
> +        const char *curlUsername = NULL;
> +        const char *curlPassword = NULL;
> +        if ( !theUserName.isEmpty() )
> +            curlUsername = rtl::OUStringToOString( theUserName, RTL_TEXTENCODING_UTF8 ).getStr();
> +        if ( !thePassWord.isEmpty() )
> +            curlPassword = rtl::OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ).getStr();
> +        if ( statusCode == 401 )
> +        {
> +            curl_easy_setopt( m_pCurl, CURLOPT_USERNAME, curlUsername );
> +            curl_easy_setopt( m_pCurl, CURLOPT_PASSWORD, curlPassword );
> +        }
> +        else
> +        {
> +            curl_easy_setopt( m_pCurl, CURLOPT_PROXYUSERNAME, curlUsername );
> +            curl_easy_setopt( m_pCurl, CURLOPT_PROXYPASSWORD, curlPassword );
> +        }
> +        return true;
> +    }
> +    m_aLogger.log( LogLevel::WARNING, "credentials entry cancelled or failed" );
> +
> +    return false;
> +}
> +
> +void CurlSession::addEnvironmentRequestHeaders( CurlRequest &curlRequest, const DAVRequestEnvironment &env )
> +    throw ( DAVException )
> +{
> +    bool bHasUserAgent( false );
> +    DAVRequestHeaders::const_iterator aHeaderIter( env.m_aRequestHeaders.begin() );
> +    const DAVRequestHeaders::const_iterator aEnd( env.m_aRequestHeaders.end() );
> +
> +    while ( aHeaderIter != aEnd )
> +    {
> +        const rtl::OString aHeader = rtl::OUStringToOString( aHeaderIter->first,
> +                                                             RTL_TEXTENCODING_UTF8 );
> +        const rtl::OString aValue = rtl::OUStringToOString( aHeaderIter->second,
> +                                                            RTL_TEXTENCODING_UTF8 );
> +
> +        if ( !bHasUserAgent )
> +            bHasUserAgent = aHeaderIter->first.equalsAsciiL(
> +                RTL_CONSTASCII_STRINGPARAM( "User-Agent" ) );
> +
> +        curlRequest.addHeader( aHeader, aValue );
> +        
> +        ++aHeaderIter;
> +    }
> +
> +    if ( !bHasUserAgent )
> +    {
> +        const rtl::OUString &rUserAgent = WebDAVUserAgent::get();
> +        curlRequest.addHeader( "User-Agent", rtl::OUStringToOString( rUserAgent, RTL_TEXTENCODING_UTF8 ) );
> +    }
> +}
> +
> +void CurlSession::processResponse( CurlRequest &curlRequest, CURLcode curlCode )
> +    throw( DAVException )
> +{
> +    long statusCode = 0;
> +    CURLcode curlRes;
> +    curlRes = curl_easy_getinfo( m_pCurl, CURLINFO_RESPONSE_CODE, &statusCode );
> +    if ( curlRes != 0 || statusCode == 0 )
> +        statusCode = curlRequest.getStatusCode();
> +
> +    // check header according:
> +    // http://tools.ietf.org/html/rfc7231#section-7.4.2
> +    // need to do this so we can adjust the protocol accordingly
> +    const CurlRequest::Header *server = curlRequest.findResponseHeader( "server" );
> +    if ( server != NULL )
> +        m_aServerHeaderField = server->value;
> +
> +    if ( curlCode != 0 )
> +    {
> +        m_aLogger.log( LogLevel::WARNING, "Curl request failed with CURLcode $1$", (sal_Int64)curlCode );
> +        throw DAVException( DAVException::DAV_HTTP_LOOKUP,
> +                            CurlUri::makeConnectionEndPointString( getHostName(),
> +                                                                   getPort() ) );
> +    }
> +    
> +    rtl::OUString reasonPhrase = rtl::OStringToOUString( curlRequest.getReasonPhrase(), RTL_TEXTENCODING_UTF8 );
> +    if ( statusCode != 0 && statusCode / 100 != 2 )
> +    {
> +        switch (statusCode)
> +        {
> +            case SC_MOVED_PERMANENTLY:             // 301
> +            case SC_MOVED_TEMPORARILY:             // 302
> +            case SC_SEE_OTHER:                     // 303
> +            case SC_TEMPORARY_REDIRECT:            // 307
> +            {
> +                // new location for certain redirections
> +                
> +                const CurlRequest::Header *location = curlRequest.findResponseHeader( "location" );
> +                if ( location != NULL )
> +                {
> +                    m_aLogger.log( LogLevel::FINE, "HTTP $1$ response with new location = $2$",
> +                        statusCode, location->value );
> +                    throw DAVException( DAVException::DAV_HTTP_REDIRECT,
> +                                        rtl::OStringToOUString( location->value, RTL_TEXTENCODING_UTF8 ) );
> +                }
> +                break;
> +            }
> +            case SC_UNAUTHORIZED:                  // 401
> +            case SC_PROXY_AUTHENTICATION_REQUIRED: // 407
> +            {
> +                throw DAVException( DAVException::DAV_HTTP_ERROR,
> +                                    reasonPhrase,
> +                                    statusCode );
> +                break;
> +            }
> +            case SC_REQUEST_ENTITY_TOO_LARGE:      // 413
> +            {
> +                if ( m_bTransferEncodingSwitched )
> +                    throw DAVException( DAVException::DAV_HTTP_ERROR,
> +                                        reasonPhrase,
> +                                        statusCode );
> +                m_bTransferEncodingSwitched = true;
> +                curlRequest.setChunkedEncoding( !curlRequest.isChunkedEncoding() );
> +                break;
> +            }
> +            case SC_LOCKED:                        // 423
> +                throw DAVException( DAVException::DAV_LOCKED,
> +                                    reasonPhrase,
> +                                    statusCode );
> +            default:
> +                throw DAVException( DAVException::DAV_HTTP_ERROR,
> +                                    reasonPhrase,
> +                                    statusCode );
> +        }
> +    }
> +}
> +
> +static void responseHeadersToDAVResource( const std::vector< CurlRequest::Header> &responseHeaders,
> +                                          const std::vector< ::rtl::OUString > &inHeaderNames,
> +                                          DAVResource &ioResource )
> +{
> +    std::vector< CurlRequest::Header >::const_iterator it( responseHeaders.begin() );
> +    const std::vector< CurlRequest::Header >::const_iterator end( responseHeaders.end() );
> +    while ( it != end )
> +    {
> +        bool storeHeader = false;
> +        if ( inHeaderNames.size() == 0 )
> +            storeHeader = true;
> +        else
> +        {
> +            std::vector< ::rtl::OUString >::const_iterator reqIt( inHeaderNames.begin() );
> +            const std::vector< ::rtl::OUString >::const_iterator reqEnd( inHeaderNames.end() );
> +            while ( reqIt != reqEnd )
> +            {
> +                // header names are case insensitive
> +                if ( (*reqIt).equalsIgnoreAsciiCase( rtl::OStringToOUString( (*it).name, RTL_TEXTENCODING_UTF8 ) ) )
> +                {
> +                    storeHeader = true;
> +                    break;
> +                }
> +                else
> +                {
> +                    ++reqIt;
> +                }
> +            }
> +        }
> +        
> +        if ( storeHeader )
> +        {
> +            DAVPropertyValue thePropertyValue;
> +            thePropertyValue.IsCaseSensitive = false;
> +            thePropertyValue.Name = rtl::OStringToOUString( (*it).name, RTL_TEXTENCODING_UTF8 );
> +            thePropertyValue.Value <<= rtl::OStringToOUString( (*it).value, RTL_TEXTENCODING_UTF8 );
> +            ioResource.properties.push_back( thePropertyValue );
> +        }
> +        
> +        it++;
> +    }
> +}
> +
> +// -------------------------------------------------------------------
> +// PROPFIND - allprop & named
> +// -------------------------------------------------------------------
> +
> +void CurlSession::propfind( CurlRequest &curlRequest,
> +                            const rtl::OUString &inPath,
> +                            const Depth inDepth,
> +                            const std::vector< ::rtl::OUString > * inPropNames,
> +                            const bool onlyPropertyNames,
> +                            const DAVRequestEnvironment & rEnv )
> +{
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +
> +    if ( inDepth == DAVZERO )
> +        curlRequest.addHeader( "Depth", "0" );
> +    else if ( inDepth == DAVONE )
> +        curlRequest.addHeader( "Depth", "1" );
> +    else if ( inDepth == DAVINFINITY )
> +        curlRequest.addHeader( "Depth", "infinity" );
> +
> +    rtl::OString xml = PropfindRequest::generatePROPFINDRequestBody( inPropNames, onlyPropertyNames );
> +    if ( xml.getLength() > 0 )
> +    {
> +        curlRequest.addHeader( "Content-Type", "application/xml" );
> +        curlRequest.setRequestBody( xml.getStr(), xml.getLength() );
> +    }
> +
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +    
> +    CURLcode rc = curlRequest.propfind( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +}
> +
> +void CurlSession::PROPFIND( const rtl::OUString & inPath,
> +                            const Depth inDepth,
> +                            const std::vector< rtl::OUString > & inPropNames,
> +                            std::vector< DAVResource > & ioResources,
> +                            const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "PROPFIND line $1$", (sal_Int32)__LINE__ );
> +    
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    propfind( curlRequest, inPath, inDepth, &inPropNames, false, rEnv );
> +
> +    const std::vector< DAVResource > rResources( parseWebDAVPropFindResponse( curlRequest.getResponseBody().get() ) );
> +    std::vector< DAVResource > *pIoResources = &ioResources;
> +    *pIoResources = rResources;
> +}
> +
> +// -------------------------------------------------------------------
> +// PROPFIND - propnames
> +// -------------------------------------------------------------------
> +void CurlSession::PROPFIND( const rtl::OUString & inPath,
> +                            const Depth inDepth,
> +                            std::vector< DAVResourceInfo > & ioResInfo,
> +                            const DAVRequestEnvironment & rEnv )
> +    throw( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "PROPFIND line $1$", (sal_Int32)__LINE__ );
> +    
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    propfind( curlRequest, inPath, inDepth, NULL, true, rEnv );
> +
> +    const std::vector< DAVResourceInfo > rResInfo( parseWebDAVPropNameResponse( curlRequest.getResponseBody().get() ) );
> +    std::vector< DAVResourceInfo > *pIoResInfo = &ioResInfo;
> +    *pIoResInfo = rResInfo;
> +}
> +
> +// -------------------------------------------------------------------
> +// PROPPATCH
> +// -------------------------------------------------------------------
> +void CurlSession::PROPPATCH( const rtl::OUString & inPath,
> +                             const std::vector< ProppatchValue > & inValues,
> +                             const DAVRequestEnvironment & rEnv )
> +    throw( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "PROPPATCH line $1$", (sal_Int32)__LINE__ );
> +
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +
> +    // check whether a lock on this resource is already owned
> +    rtl::OUString aUri( composeCurrentUri( inPath ) );
> +    ucb::Lock inLock;
> +    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
> +    if ( pLock )
> +    {
> +        inLock = pLock->getLock();
> +    }
> +    if ( inLock.LockTokens.getLength() > 0 )
> +    {
> +        curlRequest.addHeader( "If",
> +            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
> +    }
> +    
> +    rtl::OString xml = ProppatchRequest::generatePROPPATCHRequestBody( inValues );
> +    if ( xml.getLength() > 0 )
> +    {
> +        curlRequest.addHeader( "Content-Type", "application/xml" );
> +        curlRequest.setRequestBody( xml.getStr(), xml.getLength() );
> +    }
> +
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    CURLcode rc = curlRequest.proppatch( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +}
> +
> +// -------------------------------------------------------------------
> +// HEAD
> +// -------------------------------------------------------------------
> +void CurlSession::HEAD( const ::rtl::OUString & inPath,
> +                        const std::vector< ::rtl::OUString > & inHeaderNames,
> +                        DAVResource & ioResource,
> +                        const DAVRequestEnvironment & rEnv )
> +    throw( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "HEAD line $1$", (sal_Int32)__LINE__ );
> +    
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    Init(rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +
> +    ioResource.uri = inPath;
> +    ioResource.properties.clear();
> +
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    CURLcode rc = curlRequest.head( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +    responseHeadersToDAVResource( curlRequest.getResponseHeaders(), inHeaderNames, ioResource );
> +}
> +
> +// -------------------------------------------------------------------
> +// GET
> +// -------------------------------------------------------------------
> +uno::Reference< io::XInputStream >
> +CurlSession::GET( const rtl::OUString & inPath,
> +                  const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "GET line $1$", (sal_Int32)__LINE__ );
> +
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    CURLcode rc = curlRequest.get( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +
> +    return uno::Reference< io::XInputStream >( curlRequest.getResponseBody().get() );
> +}
> +
> +// -------------------------------------------------------------------
> +// GET
> +// -------------------------------------------------------------------
> +void CurlSession::GET( const rtl::OUString & inPath,
> +                       uno::Reference< io::XOutputStream > & ioOutputStream,
> +                       const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "GET line $1$", (sal_Int32)__LINE__ );
> +
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    curlRequest.saveResponseBodyTo( ioOutputStream );
> +    CURLcode rc = curlRequest.get( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +}
> +
> +// -------------------------------------------------------------------
> +// GET
> +// -------------------------------------------------------------------
> +uno::Reference< io::XInputStream >
> +CurlSession::GET( const rtl::OUString & inPath,
> +                  const std::vector< ::rtl::OUString > & inHeaderNames,
> +                  DAVResource & ioResource,
> +                  const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "GET line $1$", (sal_Int32)__LINE__ );
> +
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    CURLcode rc = curlRequest.get( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +    responseHeadersToDAVResource( curlRequest.getResponseHeaders(), inHeaderNames, ioResource );
> +
> +    return uno::Reference< io::XInputStream >( curlRequest.getResponseBody().get() );
> +}
> +
> +
> +// -------------------------------------------------------------------
> +// GET
> +// -------------------------------------------------------------------
> +void CurlSession::GET( const rtl::OUString & inPath,
> +                       uno::Reference< io::XOutputStream > & ioOutputStream,
> +                       const std::vector< ::rtl::OUString > & inHeaderNames,
> +                       DAVResource & ioResource,
> +                       const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "GET line $1$", (sal_Int32)__LINE__ );
> +
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    curlRequest.saveResponseBodyTo( ioOutputStream );
> +    CURLcode rc = curlRequest.get( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +    responseHeadersToDAVResource( curlRequest.getResponseHeaders(), inHeaderNames, ioResource );
> +}
> +
> +// -------------------------------------------------------------------
> +// PUT
> +// -------------------------------------------------------------------
> +void CurlSession::PUT( const rtl::OUString & inPath,
> +                       const uno::Reference< io::XInputStream > & inInputStream,
> +                       const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "PUT line $1$", (sal_Int32)__LINE__ );
> +    
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +    
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +    
> +    uno::Sequence< sal_Int8 > aDataToSend;
> +    if ( !getDataFromInputStream( inInputStream, aDataToSend, false ) )
> +        throw DAVException( DAVException::DAV_INVALID_ARG );
> +    curlRequest.setRequestBody( reinterpret_cast< const char * >( aDataToSend.getConstArray() ),
> +                                aDataToSend.getLength() );
> +    
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    // check whether a lock on this resource is already owned
> +    rtl::OUString aUri( composeCurrentUri( inPath ) );
> +    ucb::Lock inLock;
> +    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
> +    if ( pLock )
> +    {
> +        inLock = pLock->getLock();
> +    }
> +    if ( inLock.LockTokens.getLength() > 0 )
> +    {
> +        curlRequest.addHeader( "If",
> +            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
> +    }
> +
> +    CURLcode rc = curlRequest.put( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +}
> +
> +// -------------------------------------------------------------------
> +// POST
> +// -------------------------------------------------------------------
> +uno::Reference< io::XInputStream >
> +CurlSession::POST( const rtl::OUString & inPath,
> +                   const rtl::OUString & rContentType,
> +                   const rtl::OUString & rReferer,
> +                   const uno::Reference< io::XInputStream > & inInputStream,
> +                   const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "POST line $1$", (sal_Int32)__LINE__ );
> +    
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +    
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +    
> +    uno::Sequence< sal_Int8 > aDataToSend;
> +    if ( !getDataFromInputStream( inInputStream, aDataToSend, false ) )
> +        throw DAVException( DAVException::DAV_INVALID_ARG );
> +    curlRequest.setRequestBody( reinterpret_cast< const char * >( aDataToSend.getConstArray() ),
> +                                aDataToSend.getLength() );
> +
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    if ( !rContentType.isEmpty() )
> +        curlRequest.addHeader( "Content-Type", rtl::OUStringToOString( rContentType, RTL_TEXTENCODING_UTF8 ).getStr() );
> +    if ( !rReferer.isEmpty() )
> +        curlRequest.addHeader( "Referer", rtl::OUStringToOString( rReferer, RTL_TEXTENCODING_UTF8 ).getStr() );
> +
> +    // check whether a lock on this resource is already owned
> +    rtl::OUString aUri( composeCurrentUri( inPath ) );
> +    ucb::Lock inLock;
> +    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
> +    if ( pLock )
> +    {
> +        inLock = pLock->getLock();
> +    }
> +    if ( inLock.LockTokens.getLength() > 0 )
> +    {
> +        curlRequest.addHeader( "If",
> +            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
> +    }
> +
> +    CURLcode rc = curlRequest.post( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +    return uno::Reference< io::XInputStream >( curlRequest.getResponseBody().get() );
> +}
> +
> +// -------------------------------------------------------------------
> +// POST
> +// -------------------------------------------------------------------
> +void CurlSession::POST( const rtl::OUString & inPath,
> +                        const rtl::OUString & rContentType,
> +                        const rtl::OUString & rReferer,
> +                        const uno::Reference< io::XInputStream > & inInputStream,
> +                        uno::Reference< io::XOutputStream > & oOutputStream,
> +                        const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "POST line $1$", (sal_Int32)__LINE__ );
> +    
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +    
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +    
> +    uno::Sequence< sal_Int8 > aDataToSend;
> +    if ( !getDataFromInputStream( inInputStream, aDataToSend, false ) )
> +        throw DAVException( DAVException::DAV_INVALID_ARG );
> +    curlRequest.setRequestBody( reinterpret_cast< const char * >( aDataToSend.getConstArray() ),
> +                                aDataToSend.getLength() );
> +
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    if ( !rContentType.isEmpty() )
> +        curlRequest.addHeader( "Content-Type", rtl::OUStringToOString( rContentType, RTL_TEXTENCODING_UTF8 ).getStr() );
> +    if ( !rReferer.isEmpty() )
> +        curlRequest.addHeader( "Referer", rtl::OUStringToOString( rReferer, RTL_TEXTENCODING_UTF8 ).getStr() );
> +
> +    // check whether a lock on this resource is already owned
> +    rtl::OUString aUri( composeCurrentUri( inPath ) );
> +    ucb::Lock inLock;
> +    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
> +    if ( pLock )
> +    {
> +        inLock = pLock->getLock();
> +    }
> +    if ( inLock.LockTokens.getLength() > 0 )
> +    {
> +        curlRequest.addHeader( "If",
> +            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
> +    }
> +
> +    curlRequest.saveResponseBodyTo( oOutputStream );
> +    CURLcode rc = curlRequest.post( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +}
> +
> +// -------------------------------------------------------------------
> +// MKCOL
> +// -------------------------------------------------------------------
> +void CurlSession::MKCOL( const rtl::OUString & inPath,
> +                         const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "MKCOL line $1$", (sal_Int32)__LINE__ );
> +    
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +    
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +    
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    // check whether a lock on this resource is already owned
> +    rtl::OUString aUri( composeCurrentUri( inPath ) );
> +    ucb::Lock inLock;
> +    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
> +    if ( pLock )
> +    {
> +        inLock = pLock->getLock();
> +    }
> +    if ( inLock.LockTokens.getLength() > 0 )
> +    {
> +        curlRequest.addHeader( "If",
> +            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
> +    }
> +
> +    CURLcode rc = curlRequest.mkcol( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +}
> +
> +// -------------------------------------------------------------------
> +// COPY
> +// -------------------------------------------------------------------
> +void CurlSession::COPY( const rtl::OUString & inSourceURL,
> +                        const rtl::OUString & inDestinationURL,
> +                        const DAVRequestEnvironment & rEnv,
> +                        sal_Bool inOverWrite )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "COPY line $1$", (sal_Int32)__LINE__ );
> +
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +    
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +    
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    curlRequest.addHeader( "Destination", rtl::OUStringToOString( inDestinationURL, RTL_TEXTENCODING_UTF8 ).getStr() );
> +    curlRequest.addHeader( "Overwrite", inOverWrite? "T" : "F" );
> +    
> +    // check whether a lock on the destination resource is already owned
> +    rtl::OUString aUri( composeCurrentUri( inDestinationURL ) );
> +    ucb::Lock inLock;
> +    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
> +    if ( pLock )
> +    {
> +        inLock = pLock->getLock();
> +    }
> +    if ( inLock.LockTokens.getLength() > 0 )
> +    {
> +        curlRequest.addHeader( "If",
> +            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
> +    }
> +
> +    CURLcode rc = curlRequest.copy( m_aUri, CurlUri( inSourceURL ).GetPath() );
> +    processResponse( curlRequest, rc );
> +}
> +
> +// -------------------------------------------------------------------
> +// MOVE
> +// -------------------------------------------------------------------
> +void CurlSession::MOVE( const rtl::OUString & inSourceURL,
> +                        const rtl::OUString & inDestinationURL,
> +                        const DAVRequestEnvironment & rEnv,
> +                        sal_Bool inOverWrite )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "MOVE line $1$", (sal_Int32)__LINE__ );
> +    
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +    
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +    
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    curlRequest.addHeader( "Destination", rtl::OUStringToOString( inDestinationURL, RTL_TEXTENCODING_UTF8 ).getStr() );
> +    curlRequest.addHeader( "Overwrite", inOverWrite? "T" : "F" );
> +    
> +    // check whether a lock on the destination resource is already owned
> +    rtl::OUString aUri( composeCurrentUri( inDestinationURL ) );
> +    ucb::Lock inLock;
> +    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
> +    if ( pLock )
> +    {
> +        inLock = pLock->getLock();
> +    }
> +    if ( inLock.LockTokens.getLength() > 0 )
> +    {
> +        curlRequest.addHeader( "If",
> +            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
> +    }
> +
> +    CURLcode rc = curlRequest.copy( m_aUri, CurlUri( inSourceURL ).GetPath() );
> +    processResponse( curlRequest, rc );
> +}
> +
> +// -------------------------------------------------------------------
> +// DESTROY
> +// -------------------------------------------------------------------
> +void CurlSession::DESTROY( const rtl::OUString & inPath,
> +                           const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "DESTROY line $1$", (sal_Int32)__LINE__ );
> +    
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +    
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +    
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    // check whether a lock on this resource is already owned
> +    rtl::OUString aUri( composeCurrentUri( inPath ) );
> +    ucb::Lock inLock;
> +    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
> +    if ( pLock )
> +    {
> +        inLock = pLock->getLock();
> +    }
> +    if ( inLock.LockTokens.getLength() > 0 )
> +    {
> +        curlRequest.addHeader( "If",
> +            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
> +    }
> +
> +    CURLcode rc = curlRequest.delete_( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +}
> +
> +// -------------------------------------------------------------------
> +
> +namespace
> +{
> +    sal_Int32 lastChanceToSendRefreshRequest( TimeValue const & rStart,
> +                                              sal_Int32 timeout )
> +    {
> +        TimeValue aEnd;
> +        osl_getSystemTime( &aEnd );
> +
> +        // Try to estimate a safe absolute time for sending the
> +        // lock refresh request.
> +        sal_Int32 lastChanceToSendRefreshRequest = DAVINFINITY;
> +        if ( timeout != DAVINFINITY )
> +        {
> +            sal_Int32 calltime = aEnd.Seconds - rStart.Seconds;
> +            if ( calltime <= timeout )
> +            {
> +                lastChanceToSendRefreshRequest
> +                    = aEnd.Seconds + timeout - calltime;
> +            }
> +            else
> +            {
> +                OSL_TRACE( "No chance to refresh lock before timeout!" );
> +            }
> +        }
> +        return lastChanceToSendRefreshRequest;
> +    }
> +
> +} // namespace
> +
> +// -------------------------------------------------------------------
> +// LOCK (set new lock)
> +// -------------------------------------------------------------------
> +void CurlSession::LOCK( const ::rtl::OUString & inPath,
> +                        ucb::Lock & inLock,
> +                        const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "LOCK line $1$", (sal_Int32)__LINE__ );
> +
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    // before locking, search in the lock store if we already own a lock for this resource
> +    // if present, return with exception DAV_LOCKED_SELF
> +    rtl::OUString   aUri( composeCurrentUri( inPath ) );
> +    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
> +    if ( pLock )
> +    {
> +// already present, meaning already locked by the same AOO session and already in the lockstore
> +// just return, nothing to do
> +        return;
> +    }
> +
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +    
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    if ( inLock.Timeout == -1 )
> +        curlRequest.addHeader( "Timeout", "Infinite" );
> +    else
> +        curlRequest.addHeader( "Timeout", "Second-" + rtl::OString::valueOf( inLock.Timeout ) );
> +
> +    switch ( inLock.Depth )
> +    {
> +        //i126305 TODO investigate on this case...
> +    case ucb::LockDepth_MAKE_FIXED_SIZE:
> +
> +    case ucb::LockDepth_ZERO:
> +        curlRequest.addHeader( "Depth", "0" );
> +        break;
> +    case ucb::LockDepth_ONE:
> +        curlRequest.addHeader( "Depth", "1" );
> +        break;
> +    case ucb::LockDepth_INFINITY:
> +        curlRequest.addHeader( "Depth", "infinity" );
> +        break;
> +    }
> +    
> +    rtl::OString xml = LockRequest::generateRequestBody( inLock );
> +    curlRequest.addHeader( "Content-Type", "application/xml" );
> +    curlRequest.setRequestBody( xml.getStr(), xml.getLength() );
> +
> +    TimeValue startCall;
> +    osl_getSystemTime( &startCall );
> +    
> +    CURLcode rc = curlRequest.lock( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +
> +    // the returned property, a sequence of locks
> +    // only the first is used
> +    const DAVPropertyValue outLock( parseWebDAVLockResponse( curlRequest.getResponseBody().get() ) );
> +    if(outLock.Name.compareToAscii(RTL_CONSTASCII_STRINGPARAM( "DAV:lockdiscovery" )) == 0 )
> +    {
> +        // got a lock, use only the first returned
> +        uno::Sequence< ucb::Lock >      aLocks;
> +        outLock.Value >>= aLocks;
> +        ucb::Lock aLock = aLocks[0];
> +
> +        CurlLock* aNewLock = new CurlLock( aLock, aUri, inPath );
> +        // add the store the new lock
> +        m_aCurlLockStore.addLock(aNewLock,this,
> +                                 lastChanceToSendRefreshRequest(
> +                                     startCall, static_cast< sal_Int32 >(aLock.Timeout) ) );
> +    }
> +}
> +
> +// -------------------------------------------------------------------
> +// LOCK (refresh existing lock from DAVResourceAccess)
> +// -------------------------------------------------------------------
> +sal_Int64 CurlSession::LOCK( const ::rtl::OUString & /*inPath*/,
> +                             sal_Int64 nTimeout,
> +                             const DAVRequestEnvironment & /*rEnv*/ )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "LOCK line $1$", (sal_Int32)__LINE__ );
> +
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    return nTimeout;
> +    /*
> +    // Try to get the neon lock from lock store
> +    CurlLock * theLock
> +        = m_aCurlLockStore.findByUri( makeAbsoluteURL( inPath ) );
> +    if ( !theLock )
> +         throw DAVException( DAVException::DAV_NOT_LOCKED );
> +
> +    Init( rEnv );
> +
> +    // refresh existing lock.
> +    theLock->timeout = static_cast< long >( nTimeout );
> +
> +    TimeValue startCall;
> +    osl_getSystemTime( &startCall );
> +
> +    int theRetVal = ne_lock_refresh( m_pHttpSession, theLock );
> +
> +    if ( theRetVal == NE_OK )
> +    {
> +        m_aCurlLockStore.updateLock( theLock,
> +                                     lastChanceToSendRefreshRequest(
> +                                         startCall, theLock->timeout ) );
> +    }
> +
> +    HandleError( theRetVal, inPath, rEnv );
> +
> +    return theLock->timeout;
> +    */
> +}
> +
> +// -------------------------------------------------------------------
> +// LOCK (refresh existing lock from CurlLockStore)
> +// -------------------------------------------------------------------
> +bool CurlSession::LOCK( CurlLock * pLock,
> +                        sal_Int32 & rlastChanceToSendRefreshRequest )
> +{
> +    m_aLogger.log( LogLevel::INFO, "LOCK line $1$", (sal_Int32)__LINE__ );
> +    
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +    
> +    Init();
> +    CurlRequest curlRequest( m_pCurl );
> +    
> +    const ucb::Lock & inLock = pLock->getLock();
> +    rtl::OUString inPath = pLock->getResourcePath();
> +    
> +    if ( inLock.Timeout == -1 )
> +        curlRequest.addHeader( "Timeout", "Infinite" );
> +    else
> +        curlRequest.addHeader( "Timeout", "Second-" + rtl::OString::valueOf( inLock.Timeout ) );
> +
> +    switch ( inLock.Depth )
> +    {
> +        //i126305 TODO investigate on this case...
> +    case ucb::LockDepth_MAKE_FIXED_SIZE:
> +
> +    case ucb::LockDepth_ZERO:
> +        curlRequest.addHeader( "Depth", "0" );
> +        break;
> +    case ucb::LockDepth_ONE:
> +        curlRequest.addHeader( "Depth", "1" );
> +        break;
> +    case ucb::LockDepth_INFINITY:
> +        curlRequest.addHeader( "Depth", "infinity" );
> +        break;
> +    }
> +
> +    if ( inLock.LockTokens.getLength() > 0 )
> +    {
> +        curlRequest.addHeader( "If",
> +            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
> +    }
> +
> +    rtl::OString xml = LockRequest::generateRequestBody( inLock );
> +    curlRequest.addHeader( "Content-Type", "application/xml" );
> +    curlRequest.setRequestBody( xml.getStr(), xml.getLength() );
> +    
> +    TimeValue startCall;
> +    osl_getSystemTime( &startCall );
> +
> +    CURLcode rc = curlRequest.lock( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +
> +    // the returned property, a sequence of locks
> +    // only the first is used
> +    const DAVPropertyValue outLock( parseWebDAVLockResponse( curlRequest.getResponseBody().get() ) );
> +    uno::Sequence< ucb::Lock >      aLocks;
> +    outLock.Value >>= aLocks;
> +    ucb::Lock aLock = aLocks[0];
> +
> +    // if ok, update the lastchance refresh time in lock
> +    rlastChanceToSendRefreshRequest
> +        = lastChanceToSendRefreshRequest( startCall, static_cast< sal_Int32 >(aLock.Timeout) );
> +
> +    return true;
> +}
> +
> +// -------------------------------------------------------------------
> +// UNLOCK called from external (DAVResourceAccess)
> +// -------------------------------------------------------------------
> +void CurlSession::UNLOCK( const ::rtl::OUString & inPath,
> +                          const DAVRequestEnvironment & rEnv )
> +    throw ( DAVException )
> +{
> +    m_aLogger.log( LogLevel::INFO, "UNLOCK line $1$", (sal_Int32)__LINE__ );
> +
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +
> +    rtl::OUString aUri( composeCurrentUri( inPath ) );
> +    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
> +    if ( !pLock )
> +    {
> +        throw DAVException( DAVException::DAV_NOT_LOCKED );
> +    }
> +
> +    Init( rEnv );
> +    CurlRequest curlRequest( m_pCurl );
> +
> +    addEnvironmentRequestHeaders( curlRequest, rEnv );
> +
> +    CredentialsData credsData( this, curlRequest, rEnv );
> +    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
> +
> +    ucb::Lock inLock = pLock->getLock();
> +    curlRequest.addHeader( "Lock-Token",
> +            ( "<" + rtl::OUStringToOString( inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">" ).getStr() );
> +
> +    // remove lock from lockstore
> +    // so, if something goes wrong, we don't refresh it anymore
> +    m_aCurlLockStore.removeLock( pLock );
> +    delete pLock;
> +    
> +    CURLcode rc = curlRequest.unlock( m_aUri, inPath );
> +    processResponse( curlRequest, rc );    
> +}
> +
> +// -------------------------------------------------------------------
> +// UNLOCK (called from CurlLockStore)
> +// -------------------------------------------------------------------
> +bool CurlSession::UNLOCK( CurlLock * pLock )
> +{
> +    m_aLogger.log( LogLevel::INFO, "UNLOCK line $1$", (sal_Int32)__LINE__ );
> +    
> +    osl::Guard< osl::Mutex > theGuard( m_aMutex );
> +    
> +    Init();
> +    CurlRequest curlRequest( m_pCurl );
> +
> +    rtl::OUString inPath = pLock->getResourcePath();
> +    ucb::Lock inLock = pLock->getLock();
> +    curlRequest.addHeader( "Lock-Token",
> +            ( "<" + rtl::OUStringToOString( inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">" ).getStr() );
> +
> +    CURLcode rc = curlRequest.unlock( m_aUri, inPath );
> +    processResponse( curlRequest, rc );
> +    return true;
> +}
> +
> +// -------------------------------------------------------------------
> +void CurlSession::abort()
> +    throw ( DAVException )
> +{
> +    // 11.11.09 (tkr): The following code lines causing crashes if
> +    // closing a ongoing connection. It turned out that this existing
> +    // solution doesn't work in multi-threading environments.
> +    // So I disabled them in 3.2. . Issue #73893# should fix it in OOo 3.3.
> +    //if ( m_pHttpSession )
> +    //    ne_close_connection( m_pHttpSession );
> +}
> +
> +// -------------------------------------------------------------------
> +const ucbhelper::InternetProxyServer & CurlSession::getProxySettings() const
> +{
> +    if ( m_aUri.GetScheme().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "http" ) ) ||
> +         m_aUri.GetScheme().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ) )
> +    {
> +        return m_rProxyDecider.getProxy( m_aUri.GetScheme(),
> +                                         m_aUri.GetHost(),
> +                                         m_aUri.GetPort() );
> +    }
> +    else
> +    {
> +        // TODO: figure out, if this case can occur
> +        return m_rProxyDecider.getProxy( m_aUri.GetScheme(),
> +                                         rtl::OUString() /* not used */,
> +                                         -1 /* not used */ );
> +    }
> +}
> +
> +/*
> +// -------------------------------------------------------------------
> +namespace {
> +
> +bool containsLocktoken( const uno::Sequence< ucb::Lock > & rLocks,
> +                        const char * token )
> +{
> +    for ( sal_Int32 n = 0; n < rLocks.getLength(); ++n )
> +    {
> +        const uno::Sequence< rtl::OUString > & rTokens
> +            = rLocks[ n ].LockTokens;
> +        for ( sal_Int32 m = 0; m < rTokens.getLength(); ++m )
> +        {
> +            if ( rTokens[ m ].equalsAscii( token ) )
> +                return true;
> +        }
> +    }
> +    return false;
> +}
> +
> +} // namespace
> +*/
> +
> +// -------------------------------------------------------------------
> +// This method doesn't seem to be used.
> +// In any case the default behavior is to ask a lock with a life of 3 minutes
> +// it will then be refreshed automatically (see CurlLockStore class)
> +// In case of AOO crash the lock will expire by itself
> +bool CurlSession::removeExpiredLocktoken( const rtl::OUString & /*inURL*/,
> +                                          const DAVRequestEnvironment & /*rEnv*/ )
> +{
> +    return true;
> +    /*
> +    CurlLock * theLock = m_aCurlLockStore.findByUri( inURL );
> +    if ( !theLock )
> +        return false;
> +
> +    // do a lockdiscovery to check whether this lock is still valid.
> +    try
> +    {
> +        // @@@ Alternative: use ne_lock_discover() => less overhead
> +
> +        std::vector< DAVResource > aResources;
> +        std::vector< rtl::OUString > aPropNames;
> +        aPropNames.push_back( DAVProperties::LOCKDISCOVERY );
> +
> +        PROPFIND( rEnv.m_aRequestURI, DAVZERO, aPropNames, aResources, rEnv );
> +
> +        if ( aResources.size() == 0 )
> +            return false;
> +
> +        std::vector< DAVPropertyValue >::const_iterator it
> +            = aResources[ 0 ].properties.begin();
> +        std::vector< DAVPropertyValue >::const_iterator end
> +            = aResources[ 0 ].properties.end();
> +
> +        while ( it != end )
> +        {
> +            if ( (*it).Name.equals( DAVProperties::LOCKDISCOVERY ) )
> +            {
> +                uno::Sequence< ucb::Lock > aLocks;
> +                if ( !( (*it).Value >>= aLocks ) )
> +                    return false;
> +
> +                if ( !containsLocktoken( aLocks, theLock->token ) )
> +                {
> +                    // expired!
> +                    break;
> +                }
> +
> +                // still valid.
> +                return false;
> +            }
> +            ++it;
> +        }
> +
> +        // No lockdiscovery prop in propfind result / locktoken not found
> +        // in propfind result -> not locked
> +        OSL_TRACE( "CurlSession::removeExpiredLocktoken: Removing "
> +                   " expired lock token for %s. token: %s",
> +                   rtl::OUStringToOString( inURL,
> +                                           RTL_TEXTENCODING_UTF8 ).getStr(),
> +                   theLock->token );
> +
> +        m_aCurlLockStore.removeLock( theLock );
> +        ne_lock_destroy( theLock );
> +        return true;
> +    }
> +    catch ( DAVException const & )
> +    {
> +    }
> +    return false;
> +    */
> +}
> +
> +// -------------------------------------------------------------------
> +// static
> +bool
> +CurlSession::getDataFromInputStream(
> +    const uno::Reference< io::XInputStream > & xStream,
> +    uno::Sequence< sal_Int8 > & rData,
> +    bool bAppendTrailingZeroByte )
> +{
> +    if ( xStream.is() )
> +    {
> +        uno::Reference< io::XSeekable > xSeekable( xStream, uno::UNO_QUERY );
> +        if ( xSeekable.is() )
> +        {
> +            try
> +            {
> +                sal_Int32 nSize
> +                    = sal::static_int_cast<sal_Int32>(xSeekable->getLength());
> +                sal_Int32 nRead
> +                    = xStream->readBytes( rData, nSize );
> +
> +                if ( nRead == nSize )
> +                {
> +                    if ( bAppendTrailingZeroByte )
> +                    {
> +                        rData.realloc( nSize + 1 );
> +                        rData[ nSize ] = sal_Int8( 0 );
> +                    }
> +                    return true;
> +                }
> +            }
> +            catch ( io::NotConnectedException const & )
> +            {
> +                // readBytes
> +            }
> +            catch ( io::BufferSizeExceededException const & )
> +            {
> +                // readBytes
> +            }
> +            catch ( io::IOException const & )
> +            {
> +                // getLength, readBytes
> +            }
> +        }
> +        else
> +        {
> +            try
> +            {
> +                uno::Sequence< sal_Int8 > aBuffer;
> +                sal_Int32 nPos = 0;
> +
> +                sal_Int32 nRead = xStream->readSomeBytes( aBuffer, 65536 );
> +                while ( nRead > 0 )
> +                {
> +                    if ( rData.getLength() < ( nPos + nRead ) )
> +                        rData.realloc( nPos + nRead );
> +
> +                    aBuffer.realloc( nRead );
> +                    rtl_copyMemory( (void*)( rData.getArray() + nPos ),
> +                                    (const void*)aBuffer.getConstArray(),
> +                                    nRead );
> +                    nPos += nRead;
> +
> +                    aBuffer.realloc( 0 );
> +                    nRead = xStream->readSomeBytes( aBuffer, 65536 );
> +                }
> +
> +                if ( bAppendTrailingZeroByte )
> +                {
> +                    rData.realloc( nPos + 1 );
> +                    rData[ nPos ] = sal_Int8( 0 );
> +                }
> +                return true;
> +            }
> +            catch ( io::NotConnectedException const & )
> +            {
> +                // readBytes
> +            }
> +            catch ( io::BufferSizeExceededException const & )
> +            {
> +                // readBytes
> +            }
> +            catch ( io::IOException const & )
> +            {
> +                // readBytes
> +            }
> +        }
> +    }
> +    return false;
> +}
> +
> +// ---------------------------------------------------------------------
> +sal_Bool
> +CurlSession::isDomainMatch( rtl::OUString certHostName )
> +{
> +    rtl::OUString hostName = getHostName();
> +
> +    if (hostName.equalsIgnoreAsciiCase( certHostName ) )
> +        return sal_True;
> +
> +    if ( 0 == certHostName.indexOf( rtl::OUString::createFromAscii( "*" ) ) &&
> +         hostName.getLength() >= certHostName.getLength() )
> +    {
> +        rtl::OUString cmpStr = certHostName.copy( 1 );
> +
> +        if ( hostName.matchIgnoreAsciiCase(
> +                cmpStr, hostName.getLength() - cmpStr.getLength() ) )
> +            return sal_True;
> +    }
> +    return sal_False;
> +}
> diff --git a/main/ucb/source/ucp/webdav/SerfSession.hxx b/main/ucb/source/ucp/webdav/CurlSession.hxx
> similarity index 71%
> rename from main/ucb/source/ucp/webdav/SerfSession.hxx
> rename to main/ucb/source/ucp/webdav/CurlSession.hxx
> index 6d4438cb34..091b304324 100644
> --- a/main/ucb/source/ucp/webdav/SerfSession.hxx
> +++ b/main/ucb/source/ucp/webdav/CurlSession.hxx
> @@ -21,103 +21,103 @@
> 
> 
> 
> -#ifndef INCLUDED_SERFSESSION_HXX
> -#define INCLUDED_SERFSESSION_HXX
> +#ifndef INCLUDED_CURLSESSION_HXX
> +#define INCLUDED_CURLSESSION_HXX
> 
> #include <vector>
> #include <boost/shared_ptr.hpp>
> #include <osl/mutex.hxx>
> +#include <comphelper/componentcontext.hxx>
> +#include <comphelper/logging.hxx>
> #include "DAVResource.hxx"
> #include "DAVSession.hxx"
> -#include "SerfTypes.hxx"
> -#include "SerfLockStore.hxx"
> -#include "SerfUri.hxx"
> +#include "CurlTypes.hxx"
> +#include "CurlRequest.hxx"
> +#include "CurlLockStore.hxx"
> +#include "CurlUri.hxx"
> +#include "CurlInputStream.hxx"
> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
> +#include <curl/curl.h>
> +#include <openssl/ssl.h>
> 
> namespace ucbhelper { class ProxyDecider; }
> 
> namespace http_dav_ucp
> {
> 
> -class SerfRequestProcessor;
> -
> // -------------------------------------------------------------------
> -// SerfSession
> -// A DAVSession implementation using the neon/expat library
> +// CurlSession
> +// A DAVSession implementation using the Curl library
> // -------------------------------------------------------------------
> 
> -class SerfSession : public DAVSession
> +class CurlSession : public DAVSession
> {
> private:
> -    osl::Mutex              m_aMutex;
> +    osl::Mutex                      m_aMutex;
> +    ::comphelper::ComponentContext  m_aContext;
> +    ::comphelper::EventLogger       m_aLogger;
> +
> +    CurlUri                 m_aUri;
> 
> -    SerfUri                 m_aUri;
> -    
>     rtl::OUString           m_aProxyName;
>     sal_Int32               m_nProxyPort;
>     // The server, according RFC7231
>     // http://tools.ietf.org/html/rfc7231#section-7.4.2
> -    rtl::OUString           m_aServerHeaderField;
> -    
> -    SerfConnection*         m_pSerfConnection;
> -    serf_context_t*         m_pSerfContext;
> -    serf_bucket_alloc_t*    m_pSerfBucket_Alloc;
> -    bool                    m_bIsHeadRequestInProgress;
> +    rtl::OString            m_aServerHeaderField;
> +
> +    CURL*                   m_pCurl;
>     bool                    m_bUseChunkedEncoding;
> -    sal_Int16               m_bNoOfTransferEncodingSwitches;
> +    bool                    m_bTransferEncodingSwitched;
> 
>     const ucbhelper::InternetProxyDecider & m_rProxyDecider;
> 
>     DAVRequestEnvironment m_aEnv;
> 
> -    static SerfLockStore m_aSerfLockStore;
> +    static CurlLockStore m_aCurlLockStore;
> 
> -    char* getHostinfo();
>     bool isSSLNeeded();
> 
> -    SerfRequestProcessor*   createReqProc( const rtl::OUString & inPath );
> 
>     rtl::OUString           composeCurrentUri( const rtl::OUString & inPath );
> +    void                    addEnvironmentRequestHeaders( CurlRequest &curlRequest,
> +                                                          const DAVRequestEnvironment &env )
> +                                throw ( DAVException );
> +    void                    processResponse( CurlRequest &curlRequest,
> +                                             CURLcode curlCode )
> +                                throw ( DAVException );
> +
> +    static CURLcode         Curl_SSLContextCallback( CURL *curl,
> +                                                     void *ssl_ctx,
> +                                                     void *userptr );
> +    static int              OPENSSL_ValidateServerCertificate( int preverify_ok,
> +                                                               X509_STORE_CTX *x509_ctx );
> +    int                     validateServerX509Certificate( X509_STORE_CTX *x509StoreContext,
> +                                                           int preverifyOk );
> +    int                     verifyCertificateChain (
> +                                std::vector< uno::Sequence< sal_Int8 > > &asn1DerCertificates );
> +
> +    static int              Curl_DebugCallback( CURL *,
> +                                                curl_infotype type,
> +                                                unsigned char *data,
> +                                                size_t size,
> +                                                void* userdata );
> +    int                     curlDebugOutput( curl_infotype type, char *data, int size );
> +
> +    static bool             Curl_ProvideCredentials( long statusCode,
> +                                                     void *userdata ) throw (DAVException);
> +    bool                    provideCredentials( const DAVRequestEnvironment &env,
> +                                                CurlRequest &request,
> +                                                long statusCode ) throw (DAVException);
> 
> protected:
> -    virtual ~SerfSession();
> +    virtual ~CurlSession();
> 
> public:
> -    SerfSession( const rtl::Reference< DAVSessionFactory > & rSessionFactory,
> +    CurlSession( const rtl::Reference< DAVSessionFactory > & rSessionFactory,
>                  const rtl::OUString& inUri,
>                  const ucbhelper::InternetProxyDecider & rProxyDecider )
>         throw ( DAVException );
> 
> -    // Serf library callbacks
> -    apr_status_t setupSerfConnection( apr_socket_t * inAprSocket,
> -                                      serf_bucket_t **outSerfInputBucket,
> -                                      serf_bucket_t **outSerfOutputBucket,
> -                                      apr_pool_t* inAprPool );
> -
> -    apr_status_t provideSerfCredentials( bool bGiveProvidedCredentialsASecondTry,
> -                                         char ** outUsername, 
> -                                         char ** outPassword,
> -                                         serf_request_t * inRequest, 
> -                                         int inCode, 
> -                                         const char *inAuthProtocol,
> -                                         const char *inRealm,
> -                                         apr_pool_t *inAprPool );
> -
> -    apr_status_t verifySerfCertificateChain (
> -        int nFailures,
> -        const serf_ssl_certificate_t * const * pCertificateChainBase64Encoded,
> -        int nCertificateChainLength);
> -
> -    serf_bucket_t* acceptSerfResponse( serf_request_t * inSerfRequest,
> -                                       serf_bucket_t * inSerfStreamBucket,
> -                                       apr_pool_t* inAprPool );
> -
> -    // Serf-related data structures
> -    apr_pool_t* getAprPool();
> -    serf_bucket_alloc_t* getSerfBktAlloc();
> -    serf_context_t* getSerfContext();
> -    SerfConnection* getSerfConnection();
> -
>     // DAVSession methods
>     virtual sal_Bool CanUse( const ::rtl::OUString & inUri );
> 
> @@ -156,8 +156,6 @@ public:
>           const DAVRequestEnvironment & rEnv )
>         throw ( DAVException );
> 
> -    bool isHeadRequestInProgress();
> -
>     virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream >
>     GET( const ::rtl::OUString & inPath,
>          const DAVRequestEnvironment & rEnv )
> @@ -264,12 +262,10 @@ public:
> 
>     sal_Bool isDomainMatch( rtl::OUString certHostName );
> 
> -    const rtl::OUString & getServerHeaderField() { return m_aServerHeaderField; };
> -
> -    void setServerHeaderField( rtl::OUString aServerHeaderField ) { m_aServerHeaderField = aServerHeaderField; };
> +    const rtl::OString & getServerHeaderField() { return m_aServerHeaderField; };
> 
> private:
> -    friend class SerfLockStore;
> +    friend class CurlLockStore;
> 
>     void Init( void )
>         throw ( DAVException );
> @@ -277,24 +273,28 @@ private:
>     void Init( const DAVRequestEnvironment & rEnv )
>         throw ( DAVException );
> 
> -    void HandleError( boost::shared_ptr<SerfRequestProcessor> rReqProc )
> -        throw ( DAVException );
> -
>     const ucbhelper::InternetProxyServer & getProxySettings() const;
> +    
> +    void propfind( CurlRequest &curlRequest,
> +                   const rtl::OUString &inPath,
> +                   const Depth inDepth,
> +                   const std::vector< ::rtl::OUString > * propNames,
> +                   const bool onlyPropertyNames,
> +                   const DAVRequestEnvironment & rEnv );
> 
>     bool removeExpiredLocktoken( const rtl::OUString & inURL,
>                                  const DAVRequestEnvironment & rEnv );
> 
> -    // refresh lock, called by SerfLockStore::refreshLocks
> -    bool LOCK( SerfLock * pLock,
> +    // refresh lock, called by CurlLockStore::refreshLocks
> +    bool LOCK( CurlLock * pLock,
>                sal_Int32 & rlastChanceToSendRefreshRequest );
> 
> -    // unlock, called by SerfLockStore::~SerfLockStore
> -    bool UNLOCK( SerfLock * pLock );
> +    // unlock, called by CurlLockStore::~CurlLockStore
> +    bool UNLOCK( CurlLock * pLock );
> 
>     /*
>     // low level GET implementation, used by public GET implementations
> -    static int GET( SerfConnection * sess,
> +    static int GET( CurlConnection * sess,
>                     const char * uri,
>                     //ne_block_reader reader,
>                     bool getheaders,
> @@ -302,14 +302,14 @@ private:
> 
>     // Buffer-based PUT implementation. Serf only has file descriptor-
>     // based API.
> -    static int PUT( SerfConnection * sess,
> +    static int PUT( CurlConnection * sess,
>                     const char * uri,
>                     const char * buffer,
>                     size_t size );
> 
>     // Buffer-based POST implementation. Serf only has file descriptor-
>     // based API.
> -    int POST( SerfConnection * sess,
> +    int POST( CurlConnection * sess,
>               const char * uri,
>               const char * buffer,
>               //ne_block_reader reader,
> @@ -332,4 +332,4 @@ private:
> 
> } // namespace http_dav_ucp
> 
> -#endif // INCLUDED_SERFSESSION_HXX
> +#endif // INCLUDED_CURLSESSION_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfTypes.hxx b/main/ucb/source/ucp/webdav/CurlTypes.hxx
> similarity index 86%
> rename from main/ucb/source/ucp/webdav/SerfTypes.hxx
> rename to main/ucb/source/ucp/webdav/CurlTypes.hxx
> index 7b28225dd0..fb014106c8 100644
> --- a/main/ucb/source/ucp/webdav/SerfTypes.hxx
> +++ b/main/ucb/source/ucp/webdav/CurlTypes.hxx
> @@ -21,10 +21,9 @@
> 
> 
> 
> -#ifndef INCLUDED_SERFTYPES_HXX
> -#define INCLUDED_SERFTYPES_HXX
> +#ifndef INCLUDED_CURLTYPES_HXX
> +#define INCLUDED_CURLTYPES_HXX
> 
> -#include <serf.h>
> #include <com/sun/star/ucb/Lock.hpp>
> #include "DAVTypes.hxx"
> #include "DAVRequestEnvironment.hxx"
> @@ -34,9 +33,7 @@ using namespace com::sun::star;
> namespace http_dav_ucp
> {
> 
> -typedef serf_connection_t SerfConnection;
> -
> -class SerfLock
> +class CurlLock
> {
> private:
>     ucb::Lock               mLock;
> @@ -45,7 +42,7 @@ private:
>     // const DAVRequestEnvironment& mrRequestEnvironment;
> public:
> 
> -    SerfLock(const ucb::Lock inLock, rtl::OUString inUri, rtl::OUString inPath)
> +    CurlLock(const ucb::Lock inLock, rtl::OUString inUri, rtl::OUString inPath)
>         : mLock( inLock )
>         , mResourceUri( inUri )
>         , mPathStr( inPath )
> @@ -60,7 +57,7 @@ public:
> };
> 
> // TODO, check if we need it later on
> -typedef struct { const char *nspace, *name; } SerfPropName;
> +typedef struct { const char *nspace, *name; } CurlPropName;
> 
> };
> -#endif // INCLUDED_SERFTYPES_HXX
> +#endif // INCLUDED_CURLTYPES_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfUri.cxx b/main/ucb/source/ucp/webdav/CurlUri.cxx
> similarity index 54%
> rename from main/ucb/source/ucp/webdav/SerfUri.cxx
> rename to main/ucb/source/ucp/webdav/CurlUri.cxx
> index 43a26bd8c4..2d08fa63e7 100644
> --- a/main/ucb/source/ucp/webdav/SerfUri.cxx
> +++ b/main/ucb/source/ucp/webdav/CurlUri.cxx
> @@ -26,9 +26,10 @@
> #include <rtl/uri.hxx>
> #include <rtl/ustring.hxx>
> #include <rtl/ustrbuf.hxx>
> -#include "SerfUri.hxx"
> +#include "CurlUri.hxx"
> #include "DAVException.hxx"
> -#include "AprEnv.hxx"
> +
> +#include <curl/curl.h>
> 
> #include "../inc/urihelper.hxx"
> 
> @@ -54,43 +55,71 @@ inline bool matchIgnoreAsciiCase(rtl::OString const & rStr1,
>             == 0;
> }
> 
> +inline rtl::OUString getURLStringPart( const CURLU *curlUrl, CURLUPart part, unsigned int flags )
> +{
> +    char *value = NULL;
> +    CURLUcode rc = curl_url_get( const_cast<CURLU*>( curlUrl ), part, &value, flags );
> +    if ( rc == CURLUE_OK )
> +    {
> +        rtl::OUString str = rtl::OStringToOUString( value, RTL_TEXTENCODING_UTF8 );
> +        curl_free( value );
> +        return str;
> +    }
> +    return rtl::OUString();
> }
> 
> -SerfUri::SerfUri( const apr_uri_t * inUri )
> +}
> +
> +CurlUri::CurlUri( const CURLU * inUri )
>     throw ( DAVException )
> -    : mAprUri( *inUri )
> -    , mURI()
> +    : mURI()
>     , mScheme()
> -    , mUserInfo()
> +    , mUserName()
> +    , mPassword()
>     , mHostName()
>     , mPort()
>     , mPath()
> {
>     if ( inUri == 0 )
>         throw DAVException( DAVException::DAV_INVALID_ARG );
> -
> -    char * uri = apr_uri_unparse( apr_environment::AprEnv::getAprEnv()->getAprPool(), &mAprUri, 0 );
> -
> -    if ( uri == 0 )
> +    mCurlUri = curl_url_dup( const_cast<CURLU *>(inUri) );
> +    if ( mCurlUri == NULL )
> +         throw DAVException( DAVException::DAV_HTTP_ERROR,
> +                             rtl::OUString::createFromAscii( "Out of memory" ),
> +                             SC_INSUFFICIENT_STORAGE );
> +
> +    char * uri;
> +    CURLUcode rc = curl_url_get( mCurlUri, CURLUPART_URL, &uri, 0 );
> +    if ( rc != CURLUE_OK )
> +    {
> +        curl_url_cleanup( mCurlUri );
>         throw DAVException( DAVException::DAV_INVALID_ARG );
> +    }
> +    curl_free( uri );
> 
> -    init( &mAprUri );
> +    init( mCurlUri );
> 
>     calculateURI();
> }
> 
> -SerfUri::SerfUri( const rtl::OUString & inUri )
> +CurlUri::CurlUri( const rtl::OUString & inUri )
>     throw ( DAVException )
> -    : mAprUri()
> +    : mCurlUri( 0 )
>     , mURI()
>     , mScheme()
> -    , mUserInfo()
> +    , mUserName()
> +    , mPassword()
>     , mHostName()
> -    , mPort()
> +    , mPort( 0 )
>     , mPath()
> {
>     if ( inUri.getLength() <= 0 )
>         throw DAVException( DAVException::DAV_INVALID_ARG );
> +    mCurlUri = curl_url();
> +    if ( mCurlUri == NULL )
> +         throw DAVException( DAVException::DAV_HTTP_ERROR,
> +                             rtl::OUString::createFromAscii( "Out of memory" ),
> +                             SC_INSUFFICIENT_STORAGE );
> 
>     // #i77023#
>     rtl::OUString aEscapedUri( ucb_impl::urihelper::encodeURI( inUri ) );
> @@ -98,57 +127,112 @@ SerfUri::SerfUri( const rtl::OUString & inUri )
>     rtl::OString theInputUri(
>         aEscapedUri.getStr(), aEscapedUri.getLength(), RTL_TEXTENCODING_UTF8 );
> 
> -    if ( apr_uri_parse( apr_environment::AprEnv::getAprEnv()->getAprPool(), 
> -                        theInputUri.getStr(), &mAprUri ) != APR_SUCCESS )
> +    if ( curl_url_set( mCurlUri, CURLUPART_URL, theInputUri.getStr(), 0 ) != CURLUE_OK )
>     {
> -        throw DAVException( DAVException::DAV_INVALID_ARG );
> +        // I kid you not:
> +        // Sometimes, we are just given a URL's path part,
> +        // and CREATING THE URL ABSOLUTELY MUST SUCCEED, even though the resulting URL
> +        // of "/path/to/file.txt" will be the terrible "://:0/path/to/file.txt" !!!
> +        // (Such input usually comes from the callers of GetPathBaseName() and the like.)
> +        if ( !theInputUri.isEmpty() && theInputUri[0] == '/' &&
> +                curl_url_set( mCurlUri, CURLUPART_PATH, theInputUri.getStr(), 0 ) != CURLUE_OK )
> +        {
> +            throw DAVException( DAVException::DAV_INVALID_ARG );
> +        }
>     }
> -    if ( !mAprUri.port ) 
> +
> +    rtl::OUString portString = getURLStringPart( mCurlUri, CURLUPART_PORT, 0 );
> +    if ( portString.isEmpty() )
>     {
> -        mAprUri.port = apr_uri_port_of_scheme( mAprUri.scheme );
> +        rtl::OUString defaultPortW = getURLStringPart( mCurlUri, CURLUPART_PORT, CURLU_DEFAULT_PORT );
> +        rtl::OString defaultPortA = OUStringToOString( defaultPortW, RTL_TEXTENCODING_UTF8 );
> +        if ( !defaultPortA.isEmpty() )
> +            curl_url_set( mCurlUri, CURLUPART_PORT, defaultPortA.getStr(), 0 );
>     }
> -    if ( !mAprUri.path ) 
> +    rtl::OUString path = getURLStringPart( mCurlUri, CURLUPART_PATH, 0 );
> +    if ( path.isEmpty() )
> +        curl_url_set( mCurlUri, CURLUPART_PATH, "/", 0);
> +
> +    init( mCurlUri );
> +
> +    calculateURI();
> +}
> +
> +CurlUri::CurlUri( const CurlUri &curlUri )
> +    throw ( DAVException )
> +    : mURI()
> +    , mScheme()
> +    , mUserName()
> +    , mPassword()
> +    , mHostName()
> +    , mPort()
> +    , mPath()
> +{
> +    mCurlUri = curl_url_dup( curlUri.mCurlUri );
> +    if ( mCurlUri == NULL )
> +         throw DAVException( DAVException::DAV_HTTP_ERROR,
> +                             rtl::OUString::createFromAscii( "Out of memory" ),
> +                             SC_INSUFFICIENT_STORAGE );
> +
> +    char * uri;
> +    CURLUcode rc = curl_url_get( mCurlUri, CURLUPART_URL, &uri, 0 );
> +    if ( rc != CURLUE_OK )
>     {
> -        mAprUri.path = "/";
> +        curl_url_cleanup( mCurlUri );
> +        throw DAVException( DAVException::DAV_INVALID_ARG );
>     }
> +    curl_free( uri );
> 
> -    init( &mAprUri );
> +    init( mCurlUri );
> 
>     calculateURI();
> }
> 
> -void SerfUri::init( const apr_uri_t * pUri )
> +void CurlUri::init( const CURLU * pUri )
> {
> -    mScheme   = rtl::OStringToOUString( pUri->scheme, RTL_TEXTENCODING_UTF8 );
> -    mUserInfo = rtl::OStringToOUString( pUri->user, RTL_TEXTENCODING_UTF8 );
> -    mHostName = rtl::OStringToOUString( pUri->hostname, RTL_TEXTENCODING_UTF8 );
> -    mPort     = pUri->port;
> -    mPath     = rtl::OStringToOUString( pUri->path, RTL_TEXTENCODING_UTF8 );
> -
> -    if ( pUri->query )
> +    mScheme   = getURLStringPart( pUri, CURLUPART_SCHEME, 0 );
> +    mUserName = getURLStringPart( pUri, CURLUPART_USER, 0 );
> +    mPassword = getURLStringPart( pUri, CURLUPART_PASSWORD, 0 );
> +    mHostName = getURLStringPart( pUri, CURLUPART_HOST, 0 );
> +    rtl::OUString portString = getURLStringPart( pUri, CURLUPART_PORT, 0);
> +    mPort     = 0;
> +    if ( !portString.isEmpty() )
> +        mPort = portString.toInt32();
> +    mPath     = getURLStringPart( pUri, CURLUPART_PATH, 0 );
> +
> +    rtl::OUString query = getURLStringPart( pUri, CURLUPART_QUERY, 0 );
> +    if ( !query.isEmpty() )
>     {
>         mPath += rtl::OUString::createFromAscii( "?" );
> -        mPath += rtl::OStringToOUString( pUri->query,  RTL_TEXTENCODING_UTF8 );
> +        mPath += query;
>     }
> 
> -    if ( pUri->fragment )
> +    rtl::OUString fragment = getURLStringPart( pUri, CURLUPART_FRAGMENT, 0 );
> +    if ( !fragment.isEmpty() )
>     {
>         mPath += rtl::OUString::createFromAscii( "#" );
> -        mPath += rtl::OStringToOUString( pUri->fragment,  RTL_TEXTENCODING_UTF8 );
> +        mPath += fragment;
>     }
> }
> 
> -SerfUri::~SerfUri( )
> +CurlUri::~CurlUri( )
> {
> +    if ( mCurlUri )
> +        curl_url_cleanup( mCurlUri );
> }
> 
> -void SerfUri::calculateURI ()
> +void CurlUri::calculateURI ()
> {
>     rtl::OUStringBuffer aBuf( mScheme );
>     aBuf.appendAscii( "://" );
> -    if ( mUserInfo.getLength() > 0 )
> +    if ( mUserName.getLength() > 0 )
>     {
> -        aBuf.append( mUserInfo );
> +        aBuf.append( mUserName );
> +        if ( mPassword.getLength() > 0 )
> +        {
> +             aBuf.appendAscii( ":" );
> +             aBuf.append( mPassword );
> +        }
>         aBuf.appendAscii( "@" );
>     }
>     // Is host a numeric IPv6 address?
> @@ -186,7 +270,7 @@ void SerfUri::calculateURI ()
>     mURI = aBuf.makeStringAndClear();
> }
> 
> -::rtl::OUString SerfUri::GetPathBaseName () const
> +::rtl::OUString CurlUri::GetPathBaseName () const
> {
>     sal_Int32 nPos = mPath.lastIndexOf ('/');
>     sal_Int32 nTrail = 0;
> @@ -215,17 +299,17 @@ void SerfUri::calculateURI ()
>         return rtl::OUString::createFromAscii ("/");
> }
> 
> -bool SerfUri::operator== ( const SerfUri & rOther ) const
> +bool CurlUri::operator== ( const CurlUri & rOther ) const
> {
>     return ( mURI == rOther.mURI );
> }
> 
> -::rtl::OUString SerfUri::GetPathBaseNameUnescaped () const
> +::rtl::OUString CurlUri::GetPathBaseNameUnescaped () const
> {
>     return unescape( GetPathBaseName() );
> }
> 
> -void SerfUri::AppendPath (const rtl::OUString& rPath)
> +void CurlUri::AppendPath (const rtl::OUString& rPath)
> {
>     if (mPath.lastIndexOf ('/') != mPath.getLength () - 1)
>         mPath += rtl::OUString::createFromAscii ("/");
> @@ -235,7 +319,7 @@ void SerfUri::AppendPath (const rtl::OUString& rPath)
> };
> 
> // static
> -rtl::OUString SerfUri::escapeSegment( const rtl::OUString& segment )
> +rtl::OUString CurlUri::escapeSegment( const rtl::OUString& segment )
> {
>     return rtl::Uri::encode( segment,
>                              rtl_UriCharClassPchar,
> @@ -244,7 +328,7 @@ rtl::OUString SerfUri::escapeSegment( const rtl::OUString& segment )
> }
> 
> // static
> -rtl::OUString SerfUri::unescape( const rtl::OUString& segment )
> +rtl::OUString CurlUri::unescape( const rtl::OUString& segment )
> {
>     return rtl::Uri::decode( segment,
>                              rtl_UriDecodeWithCharset,
> @@ -252,7 +336,7 @@ rtl::OUString SerfUri::unescape( const rtl::OUString& segment )
> }
> 
> // static
> -rtl::OUString SerfUri::makeConnectionEndPointString(
> +rtl::OUString CurlUri::makeConnectionEndPointString(
>                                 const rtl::OUString & rHostName, int nPort )
> {
>     rtl::OUStringBuffer aBuf;
> diff --git a/main/ucb/source/ucp/webdav/SerfUri.hxx b/main/ucb/source/ucp/webdav/CurlUri.hxx
> similarity index 76%
> rename from main/ucb/source/ucp/webdav/SerfUri.hxx
> rename to main/ucb/source/ucp/webdav/CurlUri.hxx
> index 1f2eebfe5d..ce0137c110 100644
> --- a/main/ucb/source/ucp/webdav/SerfUri.hxx
> +++ b/main/ucb/source/ucp/webdav/CurlUri.hxx
> @@ -20,10 +20,10 @@
>  *************************************************************/
> 
> 
> -#ifndef INCLUDED_SERFURI_HXX
> -#define INCLUDED_SERFURI_HXX
> +#ifndef INCLUDED_CURLURI_HXX
> +#define INCLUDED_CURLURI_HXX
> 
> -#include <apr_uri.h>
> +#include <curl/curl.h>
> #include <rtl/ustring.hxx>
> #include "DAVException.hxx"
> 
> @@ -34,42 +34,42 @@ namespace http_dav_ucp
> #define DEFAULT_HTTPS_PORT      443
> 
> // -------------------------------------------------------------------
> -// SerfUri
> -// A URI implementation for use with the neon/expat library
> +// CurlUri
> +// A URI implementation for use with the Curl library
> // -------------------------------------------------------------------
> -class SerfUri
> +class CurlUri
> {
> 	private:
> -        apr_uri_t mAprUri;
> +        CURLU *mCurlUri;
> 		::rtl::OUString	mURI;
> 		::rtl::OUString	mScheme;
> -		::rtl::OUString	mUserInfo;
> +		::rtl::OUString	mUserName;
> +		::rtl::OUString	mPassword;
> 		::rtl::OUString	mHostName;
> 		sal_Int32		mPort;
> 		::rtl::OUString	mPath;
> 
> -        void init( const apr_uri_t * pUri );
> +        void init( const CURLU * pUri );
> 		void calculateURI ();
> 
> 	public:
> -        SerfUri( const ::rtl::OUString & inUri ) throw ( DAVException );
> -        SerfUri( const apr_uri_t * inUri ) throw ( DAVException );
> -		~SerfUri( );
> +        CurlUri( const ::rtl::OUString & inUri ) throw ( DAVException );
> +        CurlUri( const CURLU * inUri ) throw ( DAVException );
> +        CurlUri( const CurlUri &curlUri ) throw ( DAVException );
> +		~CurlUri( );
> 
> -        bool operator== ( const SerfUri & rOther ) const;
> -        bool operator!= ( const SerfUri & rOther ) const
> +        bool operator== ( const CurlUri & rOther ) const;
> +        bool operator!= ( const CurlUri & rOther ) const
>         { return !operator==( rOther ); }
> 
> -        apr_uri_t* getAprUri()
> -        {
> -            return &mAprUri;
> -        }
> 		const ::rtl::OUString & GetURI( void ) const
> 											{ return mURI; };
> 		const ::rtl::OUString & GetScheme( void ) const
> 											{ return mScheme; };
> -		const ::rtl::OUString & GetUserInfo( void ) const
> -											{ return mUserInfo; };
> +		const ::rtl::OUString & GetUserName( void ) const
> +											{ return mUserName; };
> +		const ::rtl::OUString & GetPassword( void ) const
> +											{ return mPassword; };
> 		const ::rtl::OUString & GetHost( void ) const
> 											{ return mHostName; };
> 		sal_Int32		GetPort( void )		const
> @@ -99,4 +99,4 @@ class SerfUri
> 
> } // namespace http_dav_ucp
> 
> -#endif // INCLUDED_SERFURI_HXX
> +#endif // INCLUDED_CURLURI_HXX
> diff --git a/main/ucb/source/ucp/webdav/DAVProperties.cxx b/main/ucb/source/ucp/webdav/DAVProperties.cxx
> index 12e131a150..134be44a20 100644
> --- a/main/ucb/source/ucp/webdav/DAVProperties.cxx
> +++ b/main/ucb/source/ucp/webdav/DAVProperties.cxx
> @@ -57,8 +57,8 @@ const ::rtl::OUString DAVProperties::EXECUTABLE =
> 
> // -------------------------------------------------------------------
> // static
> -void DAVProperties::createSerfPropName( const rtl::OUString & rFullName,
> -                                        SerfPropName & rName )
> +void DAVProperties::createCurlPropName( const rtl::OUString & rFullName,
> +                                        CurlPropName & rName )
> {
>     if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "DAV:" ) ) == 0 )
>     {
> @@ -186,7 +186,7 @@ void DAVProperties::createUCBPropName( const char * nspace,
> 
> // -------------------------------------------------------------------
> // static
> -bool DAVProperties::isUCBDeadProperty( const SerfPropName & rName )
> +bool DAVProperties::isUCBDeadProperty( const CurlPropName & rName )
> {
>     return ( rName.nspace &&
>              ( rtl_str_compareIgnoreAsciiCase(
> diff --git a/main/ucb/source/ucp/webdav/DAVProperties.hxx b/main/ucb/source/ucp/webdav/DAVProperties.hxx
> index 2a79d7e8d7..25a681fe95 100644
> --- a/main/ucb/source/ucp/webdav/DAVProperties.hxx
> +++ b/main/ucb/source/ucp/webdav/DAVProperties.hxx
> @@ -24,7 +24,7 @@
> #define _DAVPROPERTIES_HXX_
> 
> #include <rtl/ustring.hxx>
> -#include "SerfTypes.hxx"
> +#include "CurlTypes.hxx"
> 
> namespace http_dav_ucp
> {
> @@ -43,13 +43,13 @@ struct DAVProperties
> 	static const ::rtl::OUString SUPPORTEDLOCK;
> 	static const ::rtl::OUString EXECUTABLE;
> 
> -	static void createSerfPropName( const rtl::OUString & rFullName,
> -									SerfPropName & rName );
> +	static void createCurlPropName( const rtl::OUString & rFullName,
> +									CurlPropName & rName );
> 	static void createUCBPropName ( const char * nspace,
> 									const char * name,
> 									rtl::OUString & rFullName );
> 
> -	static bool isUCBDeadProperty( const SerfPropName & rName );
> +	static bool isUCBDeadProperty( const CurlPropName & rName );
>     static bool isUCBSpecialProperty( const rtl::OUString & rFullName,
>                                       rtl::OUString & rParsedName );
> };
> diff --git a/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx
> index ba02c36075..a5e1ade152 100644
> --- a/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx
> +++ b/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx
> @@ -1058,7 +1058,7 @@ void DAVResourceAccess::initialize()
>     osl::Guard< osl::Mutex > aGuard( m_aMutex );
>     if ( m_aPath.getLength() == 0 )
>     {
> -        SerfUri aURI( m_aURL );
> +        CurlUri aURI( m_aURL );
>         rtl::OUString aPath( aURI.GetPath() );
> 
>         /* #134089# - Check URI */
> @@ -1140,10 +1140,10 @@ sal_Bool DAVResourceAccess::detectRedirectCycle(
> {
>     osl::Guard< osl::Mutex > aGuard( m_aMutex );
> 
> -    SerfUri aUri( rRedirectURL );
> +    CurlUri aUri( rRedirectURL );
> 
> -    std::vector< SerfUri >::const_iterator it  = m_aRedirectURIs.begin();
> -    std::vector< SerfUri >::const_iterator end = m_aRedirectURIs.end();
> +    std::vector< CurlUri >::const_iterator it  = m_aRedirectURIs.begin();
> +    std::vector< CurlUri >::const_iterator end = m_aRedirectURIs.end();
> 
>     while ( it != end )
>     {
> @@ -1162,9 +1162,9 @@ void DAVResourceAccess::resetUri()
>     osl::Guard< osl::Mutex > aGuard( m_aMutex );
>     if ( m_aRedirectURIs.size() > 0 )
>     {
> -        std::vector< SerfUri >::const_iterator it  = m_aRedirectURIs.begin();
> +        std::vector< CurlUri >::const_iterator it  = m_aRedirectURIs.begin();
> 
> -        SerfUri aUri( (*it) );
> +        CurlUri aUri( (*it) );
>         m_aRedirectURIs.clear();
>         setURL ( aUri.GetURI() );
>         initialize();
> diff --git a/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx
> index 4f84afd96f..c690663a79 100644
> --- a/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx
> +++ b/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx
> @@ -38,7 +38,7 @@
> #include "DAVSession.hxx"
> #include "DAVResource.hxx"
> #include "DAVTypes.hxx"
> -#include "SerfUri.hxx"
> +#include "CurlUri.hxx"
> 
> namespace http_dav_ucp
> {
> @@ -54,7 +54,7 @@ class DAVResourceAccess
>     rtl::Reference< DAVSessionFactory > m_xSessionFactory;
>     com::sun::star::uno::Reference<
>         com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
> -    std::vector< SerfUri > m_aRedirectURIs;
> +    std::vector< CurlUri > m_aRedirectURIs;
> 
> public:
>     DAVResourceAccess() : m_xSessionFactory( 0 ) {}
> diff --git a/main/ucb/source/ucp/webdav/DAVSessionFactory.cxx b/main/ucb/source/ucp/webdav/DAVSessionFactory.cxx
> index c98803e993..97e6711a21 100644
> --- a/main/ucb/source/ucp/webdav/DAVSessionFactory.cxx
> +++ b/main/ucb/source/ucp/webdav/DAVSessionFactory.cxx
> @@ -24,8 +24,8 @@
> // MARKER(update_precomp.py): autogen include statement, do not remove
> #include "precompiled_webdav.hxx"
> #include "DAVSessionFactory.hxx"
> -#include "SerfSession.hxx"
> -#include "SerfUri.hxx"
> +#include "CurlSession.hxx"
> +#include "CurlUri.hxx"
> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
> 
> using namespace http_dav_ucp;
> @@ -60,10 +60,10 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession(
> 
>     if ( aIt == aEnd )
>     {
> -        SerfUri aURI( inUri );
> +        CurlUri aURI( inUri );
> 
>         std::auto_ptr< DAVSession > xElement(
> -            new SerfSession( this, inUri, *m_xProxyDecider.get() ) );
> +            new CurlSession( this, inUri, *m_xProxyDecider.get() ) );
> 
>         aIt = m_aMap.insert( Map::value_type( inUri, xElement.get() ) ).first;
>         aIt->second->m_aContainerIt = aIt;
> @@ -84,9 +84,9 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession(
>         // If URL scheme is different from http or https we definitely
>         // have to use a proxy and therefore can optimize the getProxy
>         // call a little:
> -        SerfUri aURI( inUri );
> +        CurlUri aURI( inUri );
> 
> -        aIt->second = new SerfSession( this, inUri, *m_xProxyDecider.get() );
> +        aIt->second = new CurlSession( this, inUri, *m_xProxyDecider.get() );
>         aIt->second->m_aContainerIt = aIt;
>         return aIt->second;
>     }
> diff --git a/main/ucb/source/ucp/webdav/LockRequest.cxx b/main/ucb/source/ucp/webdav/LockRequest.cxx
> new file mode 100644
> index 0000000000..86150c5c4c
> --- /dev/null
> +++ b/main/ucb/source/ucp/webdav/LockRequest.cxx
> @@ -0,0 +1,61 @@
> +/**************************************************************
> + * 
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + * 
> + *   http://www.apache.org/licenses/LICENSE-2.0
> + * 
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + * 
> + *************************************************************/
> +
> +// MARKER(update_precomp.py): autogen include statement, do not remove
> +#include "precompiled_webdav.hxx"
> +
> +#include <rtl/ustrbuf.hxx>
> +#include "LockRequest.hxx"
> +
> +using namespace http_dav_ucp;
> +
> +#define LOCK_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><lockinfo xmlns=\"DAV:\">"
> +#define LOCK_TYPE "<locktype><write/></locktype>"
> +#define LOCK_TRAILER "</lockinfo>"
> +
> +rtl::OString LockRequest::generateRequestBody( const ucb::Lock& inLock )
> +{
> +    const char *lockScope = NULL;
> +    switch ( inLock.Scope )
> +    {
> +        //i126305 TODO investigate on this case...
> +    case ucb::LockScope_MAKE_FIXED_SIZE:
> +
> +    case ucb::LockScope_EXCLUSIVE:
> +        lockScope = "<lockscope><exclusive/></lockscope>";
> +        break;
> +    case ucb::LockScope_SHARED:
> +        lockScope = "<lockscope><shared/></lockscope>";
> +        break;
> +    }
> +
> +    rtl::OUStringBuffer aBuffer;
> +    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_HEADER ));
> +    aBuffer.appendAscii( lockScope );
> +    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_TYPE ));
> +    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<owner>" ));
> +    rtl::OUString aStr;
> +    inLock.Owner >>= aStr;
> +    aBuffer.appendAscii( rtl::OUStringToOString( aStr, RTL_TEXTENCODING_UTF8 ).getStr() );
> +    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</owner>" ));
> +    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_TRAILER ));
> +    return rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
> +}
> diff --git a/main/ucb/source/ucp/webdav/AprEnv.cxx b/main/ucb/source/ucp/webdav/LockRequest.hxx
> similarity index 64%
> rename from main/ucb/source/ucp/webdav/AprEnv.cxx
> rename to main/ucb/source/ucp/webdav/LockRequest.hxx
> index 2fdec85f86..4a4d4162e7 100644
> --- a/main/ucb/source/ucp/webdav/AprEnv.cxx
> +++ b/main/ucb/source/ucp/webdav/LockRequest.hxx
> @@ -19,40 +19,18 @@
>  * 
>  *************************************************************/
> 
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> +#ifndef INCLUDED_LOCKREQUEST_HXX
> +#define INCLUDED_LOCKREQUEST_HXX
> 
> -#include "AprEnv.hxx"
> +#include "CurlTypes.hxx"
> 
> -namespace apr_environment
> +namespace http_dav_ucp
> {
> -
> -AprEnv::AprEnv()
> -    : mpAprPool( 0 )
> -{
> -    apr_initialize();
> -
> -    apr_pool_create(&mpAprPool, NULL);
> -}
> -
> -AprEnv::~AprEnv()
> -{
> -    apr_pool_destroy(mpAprPool);
> -
> -    apr_terminate();
> -}
> -
> -/* static */
> -AprEnv* AprEnv::getAprEnv()
> -{
> -    static AprEnv rAprEnv;
> -
> -    return &rAprEnv;
> -}
> -
> -apr_pool_t* AprEnv::getAprPool()
> -{
> -    return mpAprPool;
> +    class LockRequest
> +    {
> +    public:
> +        static rtl::OString generateRequestBody( const ucb::Lock& inLock );
> +    };
> }
> 
> -} // namespace apr_environment
> +#endif // INCLUDED_LOCKREQUEST_HXX
> \ No newline at end of file
> diff --git a/main/ucb/source/ucp/webdav/PropfindRequest.cxx b/main/ucb/source/ucp/webdav/PropfindRequest.cxx
> new file mode 100644
> index 0000000000..27e3be5a9e
> --- /dev/null
> +++ b/main/ucb/source/ucp/webdav/PropfindRequest.cxx
> @@ -0,0 +1,81 @@
> +/**************************************************************
> + * 
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + * 
> + *   http://www.apache.org/licenses/LICENSE-2.0
> + * 
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + * 
> + *************************************************************/
> +
> +// MARKER(update_precomp.py): autogen include statement, do not remove
> +#include "precompiled_webdav.hxx"
> +
> +#include <rtl/ustrbuf.hxx>
> +#include "DAVProperties.hxx"
> +#include "PropfindRequest.hxx"
> +
> +using namespace http_dav_ucp;
> +
> +rtl::OString PropfindRequest::generatePROPFINDRequestBody(
> +            const std::vector< ::rtl::OUString > * propNames,
> +            const bool onlyPropertyNames )
> +{
> +#define PROPFIND_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><propfind xmlns=\"DAV:\">"
> +#define PROPFIND_TRAILER "</propfind>"
> +
> +    // TODO is it really needed a Unicode string buffer?
> +    // All properties and property names aren't supposed to be ASCII?
> +    rtl::OUStringBuffer aBuffer;
> +    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPFIND_HEADER ));
> +
> +    // create and fill body with requested properties
> +    const int nPropCount = ( !onlyPropertyNames && propNames )
> +                           ? propNames->size() 
> +                           : 0;
> +    if ( nPropCount > 0 )
> +    {
> +        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<prop>" ) );
> +        CurlPropName thePropName;
> +        for ( int theIndex = 0; theIndex < nPropCount; theIndex ++ )
> +        {
> +            // split fullname into namespace and name!
> +            DAVProperties::createCurlPropName( (*propNames)[ theIndex ], 
> +                                               thePropName );
> +
> +            /* <*propname* xmlns="*propns*" /> */
> +            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
> +            aBuffer.appendAscii( thePropName.name );
> +            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " xmlnx=\"" ));
> +            aBuffer.appendAscii( thePropName.nspace );
> +            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\"/>" ));
> +        }
> +
> +        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop>" ));
> +    }
> +    else
> +    {
> +        if ( onlyPropertyNames )
> +        {
> +            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<propname/>" ));
> +        }
> +        else
> +        {
> +            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<allprop/>" ));
> +        }
> +    }
> +
> +    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPFIND_TRAILER ));
> +    return rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
> +}
> diff --git a/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.hxx b/main/ucb/source/ucp/webdav/PropfindRequest.hxx
> similarity index 55%
> rename from main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.hxx
> rename to main/ucb/source/ucp/webdav/PropfindRequest.hxx
> index ade9602b98..505072fda0 100644
> --- a/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.hxx
> +++ b/main/ucb/source/ucp/webdav/PropfindRequest.hxx
> @@ -19,36 +19,21 @@
>  * 
>  *************************************************************/
> 
> -#ifndef INCLUDED_SERFMKCOLREQPROCIMPL_HXX
> -#define INCLUDED_SERFMKCOLREQPROCIMPL_HXX
> +#ifndef INCLUDED_PROPFINDREQUEST_HXX
> +#define INCLUDED_PROPFINDREQUEST_HXX
> 
> -#include "SerfRequestProcessorImpl.hxx"
> +#include <vector>
> +#include "CurlTypes.hxx"
> 
> namespace http_dav_ucp
> {
> -
> -class SerfMkColReqProcImpl : public SerfRequestProcessorImpl
> -{
> -private:
> -    const char* mpLockToken;
> -public:
> -    SerfMkColReqProcImpl( const char* inPath,
> -                          const DAVRequestHeaders& inRequestHeaders,
> -                          const char* inLockToken );
> -
> -    virtual ~SerfMkColReqProcImpl();
> -
> -    virtual
> -    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -
> -protected:
> -    virtual
> -    void processChunkOfResponseData( const char* data, apr_size_t len );
> -
> -    virtual
> -    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
> -};
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFMKCOLREQPROCIMPL_HXX
> +    class PropfindRequest
> +    {
> +    public:
> +        static rtl::OString generatePROPFINDRequestBody(
> +            const std::vector< ::rtl::OUString > * propNames,
> +            const bool onlyPropertyNames);
> +    };
> +}
> +
> +#endif // INCLUDED_PROPFINDREQUEST_HXX
> \ No newline at end of file
> diff --git a/main/ucb/source/ucp/webdav/ProppatchRequest.cxx b/main/ucb/source/ucp/webdav/ProppatchRequest.cxx
> new file mode 100644
> index 0000000000..007d354849
> --- /dev/null
> +++ b/main/ucb/source/ucp/webdav/ProppatchRequest.cxx
> @@ -0,0 +1,126 @@
> +/**************************************************************
> + * 
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + * 
> + *   http://www.apache.org/licenses/LICENSE-2.0
> + * 
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + * 
> + *************************************************************/
> +
> +// MARKER(update_precomp.py): autogen include statement, do not remove
> +#include "precompiled_webdav.hxx"
> +
> +#include <rtl/ustrbuf.hxx>
> +#include "DAVProperties.hxx"
> +#include "ProppatchRequest.hxx"
> +#include "UCBDeadPropertyValue.hxx"
> +
> +using namespace http_dav_ucp;
> +
> +#define PROPPATCH_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><propertyupdate xmlns=\"DAV:\">"
> +#define PROPPATCH_TRAILER "</propertyupdate>"
> +
> +rtl::OString ProppatchRequest::generatePROPPATCHRequestBody(
> +            const std::vector< ProppatchValue > & inProperties )
> +{
> +    rtl::OString aBodyText;
> +    static const struct
> +    {
> +        const char *str;
> +        sal_Int32   len;
> +    }
> +    OpCode [] = {
> +        { RTL_CONSTASCII_STRINGPARAM( "set" ) },
> +        { RTL_CONSTASCII_STRINGPARAM( "remove" ) }
> +    };
> +    if ( inProperties.size() > 0 )
> +    {
> +        rtl::OUStringBuffer aBuffer;
> +        // add PropPatch xml header in front
> +        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPPATCH_HEADER ));
> +
> +        // <*operation code*><prop>
> +
> +        ProppatchOperation lastOp = inProperties[ 0 ].operation;
> +        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
> +        aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
> +        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><prop>" ));
> +
> +        CurlPropName thePropName;
> +        for ( unsigned long n = 0; n < inProperties.size(); ++n )
> +        {
> +            const ProppatchValue & rProperty = inProperties[ n ];
> +            // split fullname into namespace and name!
> +            DAVProperties::createCurlPropName( rProperty.name, 
> +                                               thePropName );
> +
> +            if ( rProperty.operation != lastOp )
> +            {
> +                // </prop></*last operation code*><*operation code><prop>
> +                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop></" ));
> +                aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
> +                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><" ));
> +                aBuffer.appendAscii( OpCode[rProperty.operation].str, OpCode[rProperty.operation].len );
> +                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><prop>" ));
> +            }
> +
> +            // <*propname* xmlns="*propns*"
> +            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
> +            aBuffer.appendAscii( thePropName.name );
> +            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " xmlns=\"" ));
> +            aBuffer.appendAscii( thePropName.nspace );
> +            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\"" ));
> +
> +            if ( rProperty.operation == PROPSET )
> +            {
> +                // >*property value*</*propname*>
> +                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
> +
> +                rtl::OUString aStringValue;
> +                if ( DAVProperties::isUCBDeadProperty( thePropName ) )
> +                {
> +                    UCBDeadPropertyValue::toXML( rProperty.value,
> +                                                 aStringValue );
> +                }
> +                else
> +                {
> +                    rProperty.value >>= aStringValue;
> +                }
> +                aBuffer.append( aStringValue );
> +                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</" ));
> +                aBuffer.appendAscii( thePropName.name );
> +                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
> +            }
> +            else
> +            {
> +                // />
> +                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/>" ));
> +            }
> +
> +            lastOp = rProperty.operation;
> +        }
> +
> +        // </prop></*last operation code*>
> +        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop></" ));
> +        aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
> +        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
> +
> +        // add PropPatch xml trailer at end
> +        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPPATCH_TRAILER ));
> +
> +        return rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
> +    }
> +    return rtl::OString();
> +}
> diff --git a/main/ucb/source/ucp/webdav/AprEnv.hxx b/main/ucb/source/ucp/webdav/ProppatchRequest.hxx
> similarity index 70%
> rename from main/ucb/source/ucp/webdav/AprEnv.hxx
> rename to main/ucb/source/ucp/webdav/ProppatchRequest.hxx
> index c6835b2e41..6fbeef3e52 100644
> --- a/main/ucb/source/ucp/webdav/AprEnv.hxx
> +++ b/main/ucb/source/ucp/webdav/ProppatchRequest.hxx
> @@ -19,32 +19,21 @@
>  * 
>  *************************************************************/
> 
> +#ifndef INCLUDED_PROPPATCHREQUEST_HXX
> +#define INCLUDED_PROPPATCHREQUEST_HXX
> 
> -#ifndef INCLUDED_APRENV_HXX
> -#define INCLUDED_APRENV_HXX
> +#include <vector>
> +#include "CurlTypes.hxx"
> 
> -#include <apr_pools.h>
> -
> -namespace apr_environment
> +namespace http_dav_ucp
> {
> 
> -// singleton class providing environment for APR libraries
> -class AprEnv
> -{
> +    class ProppatchRequest
> +    {
>     public:
> -        ~AprEnv();
> -
> -        static AprEnv* getAprEnv();
> -
> -        apr_pool_t* getAprPool();
> -
> -    private:
> -        apr_pool_t* mpAprPool;
> -
> -        AprEnv();
> -
> -};
> -
> -} // namespace apr_environment
> +        static rtl::OString generatePROPPATCHRequestBody(
> +            const std::vector< ProppatchValue > & inProperties );
> +    };
> +}
> 
> -#endif // INCLUDED_APRENV_HXX
> +#endif // INCLUDED_PROPPATCHREQUEST_HXX
> \ No newline at end of file
> diff --git a/main/ucb/source/ucp/webdav/SerfCallbacks.cxx b/main/ucb/source/ucp/webdav/SerfCallbacks.cxx
> deleted file mode 100644
> index 20693dab30..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfCallbacks.cxx
> +++ /dev/null
> @@ -1,121 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfCallbacks.hxx"
> -
> -#include "SerfSession.hxx"
> -#include "SerfRequestProcessor.hxx"
> -
> -using namespace http_dav_ucp;
> -
> -extern "C" apr_status_t Serf_ConnectSetup( apr_socket_t *skt,
> -                                           serf_bucket_t **read_bkt,
> -                                           serf_bucket_t **write_bkt,
> -                                           void *setup_baton,
> -                                           apr_pool_t *pool )
> -{
> -    SerfSession* pSerfSession = static_cast< SerfSession* >( setup_baton );
> -    OSL_TRACE("Serf_ConnectSetup");
> -    return pSerfSession->setupSerfConnection( skt,
> -                                              read_bkt,
> -                                              write_bkt,
> -                                              pool );
> -}
> -
> -extern "C" apr_status_t Serf_Credentials( char **username, 
> -                                          char **password,
> -                                          serf_request_t *request,
> -                                          void *baton,
> -                                          int code, 
> -                                          const char *authn_type,
> -                                          const char *realm,
> -                                          apr_pool_t *pool )
> -{
> -    SerfRequestProcessor* pReqProc = static_cast< SerfRequestProcessor* >( baton );
> -    OSL_TRACE("Serf_Credential");
> -    return pReqProc->provideSerfCredentials( username, 
> -                                             password,
> -                                             request,
> -                                             code,
> -                                             authn_type,
> -                                             realm,
> -                                             pool );
> -}
> -
> -extern "C" apr_status_t Serf_CertificateChainValidation(
> -    void* pSerfSession,
> -    int nFailures,
> -    int nErrorCode,
> -    const serf_ssl_certificate_t * const * pCertificateChainBase64Encoded,
> -    apr_size_t nCertificateChainLength)
> -{
> -    OSL_TRACE("Serf_CertificateChainValidation");
> -    return static_cast<SerfSession*>(pSerfSession)
> -        ->verifySerfCertificateChain(nFailures, pCertificateChainBase64Encoded, nCertificateChainLength);
> -}
> -
> -extern "C" apr_status_t Serf_SetupRequest( serf_request_t *request,
> -                                           void *setup_baton,
> -                                           serf_bucket_t **req_bkt,
> -                                           serf_response_acceptor_t *acceptor,
> -                                           void **acceptor_baton,
> -                                           serf_response_handler_t *handler,
> -                                           void **handler_baton,
> -                                           apr_pool_t * pool )
> -{
> -    SerfRequestProcessor* pReqProc = static_cast< SerfRequestProcessor* >( setup_baton );
> -    OSL_TRACE("Serf_SetupRequest");
> -    return pReqProc->setupSerfRequest( request, 
> -                                       req_bkt,
> -                                       acceptor,
> -                                       acceptor_baton,
> -                                       handler,
> -                                       handler_baton,
> -                                       pool );
> -}
> -
> -extern "C" serf_bucket_t* Serf_AcceptResponse( serf_request_t *request,
> -                                               serf_bucket_t *stream,
> -                                               void *acceptor_baton,
> -                                               apr_pool_t *pool )
> -{
> -    SerfRequestProcessor* pReqProc = static_cast< SerfRequestProcessor* >( acceptor_baton );
> -    OSL_TRACE("Serf_AcceptResponse");
> -    return pReqProc->acceptSerfResponse( request,
> -                                         stream,
> -                                         pool );
> -}
> -
> -extern "C" apr_status_t Serf_HandleResponse( serf_request_t *request,
> -                                             serf_bucket_t *response,
> -                                             void *handler_baton,
> -                                             apr_pool_t *pool )
> -{
> -    SerfRequestProcessor* pReqProc = static_cast< SerfRequestProcessor* >( handler_baton );
> -    OSL_TRACE("Serf_HandleResponse");
> -    return pReqProc->handleSerfResponse( request,
> -                                         response,
> -                                         pool );
> -}
> -
> diff --git a/main/ucb/source/ucp/webdav/SerfCallbacks.hxx b/main/ucb/source/ucp/webdav/SerfCallbacks.hxx
> deleted file mode 100644
> index 85245bb7e4..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfCallbacks.hxx
> +++ /dev/null
> @@ -1,69 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -
> -#ifndef INCLUDED_CALLBACKS_HXX
> -#define INCLUDED_CALLBACKS_HXX
> -
> -#include <serf.h>
> -
> -extern "C" apr_status_t Serf_ConnectSetup( apr_socket_t *skt,
> -                                           serf_bucket_t **read_bkt,
> -                                           serf_bucket_t **write_bkt,
> -                                           void *setup_baton,
> -                                           apr_pool_t *pool );
> -
> -extern "C" apr_status_t Serf_Credentials( char **username, 
> -                                          char **password,
> -                                          serf_request_t *request,
> -                                          void *baton,
> -                                          int code, 
> -                                          const char *authn_type,
> -                                          const char *realm,
> -                                          apr_pool_t *pool );
> -
> -extern "C" apr_status_t Serf_CertificateChainValidation(
> -    void* pSerfSession,
> -    int nFailures,
> -    int error_depth,
> -    const serf_ssl_certificate_t * const * pCertificateChainBase64Encoded,
> -    apr_size_t nCertificateChainLength);
> -
> -extern "C" apr_status_t Serf_SetupRequest( serf_request_t *request,
> -                                           void *setup_baton,
> -                                           serf_bucket_t **req_bkt,
> -                                           serf_response_acceptor_t *acceptor,
> -                                           void **acceptor_baton,
> -                                           serf_response_handler_t *handler,
> -                                           void **handler_baton,
> -                                           apr_pool_t * pool );
> -
> -extern "C" serf_bucket_t* Serf_AcceptResponse( serf_request_t *request,
> -                                               serf_bucket_t *stream,
> -                                               void *acceptor_baton,
> -                                               apr_pool_t *pool );
> -
> -extern "C" apr_status_t Serf_HandleResponse( serf_request_t *request,
> -                                             serf_bucket_t *response,
> -                                             void *handler_baton,
> -                                             apr_pool_t *pool );
> -
> -#endif // INCLUDED_CALLBACKS_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx
> deleted file mode 100644
> index 711cbbe61b..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx
> +++ /dev/null
> @@ -1,91 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfCopyReqProcImpl.hxx"
> -
> -#include <serf.h>
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfCopyReqProcImpl::SerfCopyReqProcImpl( const char* inSourcePath,
> -                                          const DAVRequestHeaders& inRequestHeaders,
> -                                          const char* inDestinationPath,
> -                                          const bool inOverwrite,
> -                                          const char* inLockToken )
> -    : SerfRequestProcessorImpl( inSourcePath, inRequestHeaders )
> -    , mDestPathStr( inDestinationPath )
> -    , mbOverwrite( inOverwrite )
> -    , mpLockToken( inLockToken )
> -{
> -}
> -
> -SerfCopyReqProcImpl::~SerfCopyReqProcImpl()
> -{
> -}
> -
> -serf_bucket_t * SerfCopyReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
> -                                                                 "COPY",
> -                                                                 getPathStr(),
> -                                                                 0,
> -                                                                 serf_request_get_alloc( inSerfRequest ) );
> -
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    // general header fields provided by caller
> -    setRequestHeaders( hdrs_bkt );
> -    
> -    // COPY specific header fields
> -    serf_bucket_headers_set( hdrs_bkt, "Destination", mDestPathStr );
> -    if ( mbOverwrite )
> -    {
> -        serf_bucket_headers_set( hdrs_bkt, "Overwrite", "T" );
> -    }
> -    else
> -    {
> -        serf_bucket_headers_set( hdrs_bkt, "Overwrite", "F" );
> -    }
> -    if(mpLockToken)
> -    {
> -        serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
> -    }
> -
> -    return req_bkt;
> -}
> -
> -void SerfCopyReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
> -                                                      apr_size_t /*len*/ )
> -{
> -    // nothing to do;
> -}
> -
> -void SerfCopyReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
> -{
> -    // nothing to do;
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx
> deleted file mode 100644
> index 029968e2a7..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx
> +++ /dev/null
> @@ -1,59 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -#ifndef INCLUDED_SERFCOPYREQPROCIMPL_HXX
> -#define INCLUDED_SERFCOPYREQPROCIMPL_HXX
> -
> -#include "SerfRequestProcessorImpl.hxx"
> -
> -namespace http_dav_ucp
> -{
> -
> -class SerfCopyReqProcImpl : public SerfRequestProcessorImpl
> -{
> -public:
> -    SerfCopyReqProcImpl( const char* inSourcePath,
> -                         const DAVRequestHeaders& inRequestHeaders,
> -                         const char* inDestinationPath,
> -                         const bool inOverwrite,
> -                         const char*  inLockToken );
> -
> -    virtual ~SerfCopyReqProcImpl();
> -
> -    virtual
> -    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -
> -protected:
> -    virtual
> -    void processChunkOfResponseData( const char* data, apr_size_t len );
> -
> -    virtual
> -    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
> -
> -private:
> -    const char* mDestPathStr;
> -    const bool mbOverwrite;
> -    const char* mpLockToken;
> -};
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFCOPYREQPROCIMPL_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx
> deleted file mode 100644
> index 123239516c..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx
> +++ /dev/null
> @@ -1,77 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfDeleteReqProcImpl.hxx"
> -
> -#include <serf.h>
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfDeleteReqProcImpl::SerfDeleteReqProcImpl( const char* inPath,
> -                                              const DAVRequestHeaders& inRequestHeaders,
> -                                              const char* inLockToken )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , mpLockToken( inLockToken )
> -{
> -}
> -
> -SerfDeleteReqProcImpl::~SerfDeleteReqProcImpl()
> -{
> -}
> -
> -serf_bucket_t * SerfDeleteReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
> -                                                                 "DELETE",
> -                                                                 getPathStr(),
> -                                                                 0,
> -                                                                 serf_request_get_alloc( inSerfRequest ) );
> -
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    // general header fields provided by caller
> -    setRequestHeaders( hdrs_bkt );
> -    // specific header field
> -    if(mpLockToken)
> -    {
> -        serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
> -    }
> -
> -    return req_bkt;
> -}
> -
> -void SerfDeleteReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
> -                                                        apr_size_t /*len*/ )
> -{
> -    // nothing to do;
> -}
> -
> -void SerfDeleteReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
> -{
> -    // nothing to do;
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.hxx
> deleted file mode 100644
> index 9cb4f920ad..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.hxx
> +++ /dev/null
> @@ -1,55 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -#ifndef INCLUDED_SERFDELETEREQPROCIMPL_HXX
> -#define INCLUDED_SERFDELETEREQPROCIMPL_HXX
> -
> -#include "SerfRequestProcessorImpl.hxx"
> -
> -namespace http_dav_ucp
> -{
> -
> -class SerfDeleteReqProcImpl : public SerfRequestProcessorImpl
> -{
> -private:
> -    const char* mpLockToken;
> -public:
> -    SerfDeleteReqProcImpl( const char* inPath,
> -                           const DAVRequestHeaders& inRequestHeaders,
> -                           const char* inLockRToken );
> -
> -    virtual ~SerfDeleteReqProcImpl();
> -
> -    virtual
> -    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -
> -protected:
> -    virtual
> -    void processChunkOfResponseData( const char* data, apr_size_t len );
> -
> -    virtual
> -    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
> -
> -};
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFDELETEREQPROCIMPL_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx
> deleted file mode 100644
> index 315272b4ee..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx
> +++ /dev/null
> @@ -1,187 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfGetReqProcImpl.hxx"
> -
> -using namespace com::sun::star;
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfGetReqProcImpl::SerfGetReqProcImpl( const char* inPath,
> -                                        const DAVRequestHeaders& inRequestHeaders,
> -                                        const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , xInputStream( xioInStrm )
> -    , xOutputStream()
> -    , mpHeaderNames( 0 )
> -    , mpResource( 0 )
> -{
> -}
> -
> -SerfGetReqProcImpl::SerfGetReqProcImpl( const char* inPath,
> -                                        const DAVRequestHeaders& inRequestHeaders,
> -                                        const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm,
> -                                        const std::vector< ::rtl::OUString > & inHeaderNames,
> -                                        DAVResource & ioResource )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , xInputStream( xioInStrm )
> -    , xOutputStream()
> -    , mpHeaderNames( &inHeaderNames )
> -    , mpResource( &ioResource )
> -{
> -}
> -
> -SerfGetReqProcImpl::SerfGetReqProcImpl( const char* inPath,
> -                                        const DAVRequestHeaders& inRequestHeaders,
> -                                        const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , xInputStream()
> -    , xOutputStream( xioOutStrm )
> -    , mpHeaderNames( 0 )
> -    , mpResource( 0 )
> -{
> -}
> -
> -SerfGetReqProcImpl::SerfGetReqProcImpl( const char* inPath,
> -                                        const DAVRequestHeaders& inRequestHeaders,
> -                                        const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm,
> -                                        const std::vector< ::rtl::OUString > & inHeaderNames,
> -                                        DAVResource & ioResource )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , xInputStream()
> -    , xOutputStream( xioOutStrm )
> -    , mpHeaderNames( &inHeaderNames )
> -    , mpResource( &ioResource )
> -{
> -}
> -
> -SerfGetReqProcImpl::~SerfGetReqProcImpl()
> -{
> -}
> -
> -serf_bucket_t * SerfGetReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
> -                                                                 "GET",
> -                                                                 getPathStr(),
> -                                                                 0,
> -                                                                 serf_request_get_alloc( inSerfRequest ) );
> -
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    // general header fields provided by caller
> -    setRequestHeaders( hdrs_bkt );
> -
> -    return req_bkt;
> -}
> -
> -void SerfGetReqProcImpl::processChunkOfResponseData( const char* data, 
> -                                                     apr_size_t len )
> -{
> -    if ( xInputStream.is() )
> -    {
> -        xInputStream->AddToStream( data, len );
> -    }
> -    else if ( xOutputStream.is() )
> -    {
> -        const uno::Sequence< sal_Int8 > aDataSeq( (sal_Int8 *)data, len );
> -        xOutputStream->writeBytes( aDataSeq );
> -    }
> -}
> -
> -namespace
> -{
> -    apr_status_t Serf_ProcessResponseHeader( void* inUserData,
> -                                             const char* inHeaderName,
> -                                             const char* inHeaderValue )
> -    {
> -        SerfGetReqProcImpl* pReqProcImpl = static_cast< SerfGetReqProcImpl* >( inUserData );
> -        pReqProcImpl->processSingleResponseHeader( inHeaderName,
> -                                                   inHeaderValue );
> -
> -        return APR_SUCCESS;
> -    }
> -} // end of anonymous namespace
> -
> -void SerfGetReqProcImpl::handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket )
> -{
> -    // read response header, if requested
> -    if ( mpHeaderNames != 0 && mpResource != 0 )
> -    {
> -        serf_bucket_t* SerfHeaderBucket = serf_bucket_response_get_headers( inSerfResponseBucket );
> -        if ( SerfHeaderBucket != 0 )
> -        {
> -            serf_bucket_headers_do( SerfHeaderBucket, 
> -                                    Serf_ProcessResponseHeader,
> -                                    this );
> -        }
> -    }
> -}
> -
> -void SerfGetReqProcImpl::processSingleResponseHeader( const char* inHeaderName,
> -                                                      const char* inHeaderValue )
> -{
> -    rtl::OUString aHeaderName( rtl::OUString::createFromAscii( inHeaderName ) );
> -
> -    bool bStoreHeaderField = false;
> -
> -    if ( mpHeaderNames->size() == 0 )
> -    {
> -        // store all header fields
> -        bStoreHeaderField = true;
> -    }
> -    else
> -    {
> -        // store only header fields which are requested
> -        std::vector< ::rtl::OUString >::const_iterator it( mpHeaderNames->begin() );
> -        const std::vector< ::rtl::OUString >::const_iterator end( mpHeaderNames->end() );
> -
> -        while ( it != end )
> -        {
> -            // header names are case insensitive
> -            if ( (*it).equalsIgnoreAsciiCase( aHeaderName ) )
> -            {
> -                bStoreHeaderField = true;
> -                break;
> -            }
> -            else
> -            {
> -                ++it;
> -            }
> -        }
> -    }
> -
> -    if ( bStoreHeaderField )
> -    {
> -        DAVPropertyValue thePropertyValue;
> -        thePropertyValue.IsCaseSensitive = false;
> -        thePropertyValue.Name = aHeaderName;
> -        thePropertyValue.Value <<= rtl::OUString::createFromAscii( inHeaderValue );
> -        mpResource->properties.push_back( thePropertyValue );
> -    }
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx
> deleted file mode 100644
> index 2d853f6bf2..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx
> +++ /dev/null
> @@ -1,84 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -#ifndef INCLUDED_SERFGETREQPROCIMPL_HXX
> -#define INCLUDED_SERFGETREQPROCIMPL_HXX
> -
> -#include "SerfRequestProcessorImpl.hxx"
> -
> -#include <vector>
> -#include <rtl/ustring.hxx>
> -#include "DAVResource.hxx"
> -
> -#include "SerfInputStream.hxx"
> -#include <com/sun/star/io/XOutputStream.hpp>
> -
> -namespace http_dav_ucp
> -{
> -
> -class SerfGetReqProcImpl : public SerfRequestProcessorImpl
> -{
> -public:
> -    SerfGetReqProcImpl( const char* inPath,
> -                        const DAVRequestHeaders& inRequestHeaders,
> -                        const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm );
> -
> -    SerfGetReqProcImpl( const char* inPath,
> -                        const DAVRequestHeaders& inRequestHeaders,
> -                        const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm,
> -                        const std::vector< ::rtl::OUString > & inHeaderNames,
> -                        DAVResource & ioResource );
> -
> -    SerfGetReqProcImpl( const char* inPath,
> -                        const DAVRequestHeaders& inRequestHeaders,
> -                        const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm );
> -
> -    SerfGetReqProcImpl( const char* inPath,
> -                        const DAVRequestHeaders& inRequestHeaders,
> -                        const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm,
> -                        const std::vector< ::rtl::OUString > & inHeaderNames,
> -                        DAVResource & ioResource );
> -
> -    virtual ~SerfGetReqProcImpl();
> -
> -    virtual
> -    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -
> -    void processSingleResponseHeader( const char* inHeaderName,
> -                                      const char* inHeaderValue );
> -
> -protected:
> -    virtual
> -    void processChunkOfResponseData( const char* data, apr_size_t len );
> -
> -    virtual
> -    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
> -
> -private:
> -    com::sun::star::uno::Reference< SerfInputStream > xInputStream;
> -    com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > xOutputStream;
> -    const std::vector< ::rtl::OUString > * mpHeaderNames;
> -    DAVResource* mpResource;
> -};
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFGETREQPROCIMPL_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx
> deleted file mode 100644
> index 263f255ebd..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx
> +++ /dev/null
> @@ -1,141 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfHeadReqProcImpl.hxx"
> -
> -using namespace com::sun::star;
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfHeadReqProcImpl::SerfHeadReqProcImpl( const char* inPath,
> -                                          const DAVRequestHeaders& inRequestHeaders,
> -                                          const std::vector< ::rtl::OUString > & inHeaderNames,
> -                                          DAVResource & ioResource )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , mpHeaderNames( &inHeaderNames )
> -    , mpResource( &ioResource )
> -{
> -}
> -
> -SerfHeadReqProcImpl::~SerfHeadReqProcImpl()
> -{
> -}
> -
> -serf_bucket_t * SerfHeadReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
> -                                                                 "HEAD",
> -                                                                 getPathStr(),
> -                                                                 0,
> -                                                                 serf_request_get_alloc( inSerfRequest ) );
> -
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    // general header fields provided by caller
> -    setRequestHeaders( hdrs_bkt );
> -
> -    return req_bkt;
> -}
> -
> -void SerfHeadReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
> -                                                      apr_size_t /*len*/ )
> -{
> -    // nothing to do
> -}
> -
> -namespace
> -{
> -    apr_status_t Serf_ProcessResponseHeader( void* inUserData,
> -                                             const char* inHeaderName,
> -                                             const char* inHeaderValue )
> -    {
> -        SerfHeadReqProcImpl* pReqProcImpl = static_cast< SerfHeadReqProcImpl* >( inUserData );
> -        pReqProcImpl->processSingleResponseHeader( inHeaderName,
> -                                                   inHeaderValue );
> -
> -        return APR_SUCCESS;
> -    }
> -} // end of anonymous namespace
> -
> -void SerfHeadReqProcImpl::handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket )
> -{
> -    // read response header, if requested
> -    if ( mpHeaderNames != 0 && mpResource != 0 )
> -    {
> -        serf_bucket_t* SerfHeaderBucket = serf_bucket_response_get_headers( inSerfResponseBucket );
> -        if ( SerfHeaderBucket != 0 )
> -        {
> -            serf_bucket_headers_do( SerfHeaderBucket, 
> -                                    Serf_ProcessResponseHeader,
> -                                    this );
> -        }
> -    }
> -}
> -
> -void SerfHeadReqProcImpl::processSingleResponseHeader( const char* inHeaderName,
> -                                                       const char* inHeaderValue )
> -{
> -    rtl::OUString aHeaderName( rtl::OUString::createFromAscii( inHeaderName ) );
> -
> -    bool bStoreHeaderField = false;
> -
> -    if ( mpHeaderNames->size() == 0 )
> -    {
> -        // store all header fields
> -        bStoreHeaderField = true;
> -    }
> -    else
> -    {
> -        // store only header fields which are requested
> -        std::vector< ::rtl::OUString >::const_iterator it( mpHeaderNames->begin() );
> -        const std::vector< ::rtl::OUString >::const_iterator end( mpHeaderNames->end() );
> -
> -        while ( it != end )
> -        {
> -            // header names are case insensitive
> -            if ( (*it).equalsIgnoreAsciiCase( aHeaderName ) )
> -            {
> -                bStoreHeaderField = true;
> -                break;
> -            }
> -            else
> -            {
> -                ++it;
> -            }
> -        }
> -    }
> -
> -    if ( bStoreHeaderField )
> -    {
> -        DAVPropertyValue thePropertyValue;
> -        thePropertyValue.IsCaseSensitive = false;
> -        thePropertyValue.Name = aHeaderName;
> -        thePropertyValue.Value <<= rtl::OUString::createFromAscii( inHeaderValue );
> -        mpResource->properties.push_back( thePropertyValue );
> -    }
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx
> deleted file mode 100644
> index a6758108d4..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx
> +++ /dev/null
> @@ -1,67 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -#ifndef INCLUDED_SERFHEADREQPROCIMPL_HXX
> -#define INCLUDED_SERFHEADREQPROCIMPL_HXX
> -
> -#include "SerfRequestProcessorImpl.hxx"
> -
> -#include <vector>
> -#include <rtl/ustring.hxx>
> -#include "DAVResource.hxx"
> -
> -#include "SerfInputStream.hxx"
> -#include <com/sun/star/io/XOutputStream.hpp>
> -
> -namespace http_dav_ucp
> -{
> -
> -class SerfHeadReqProcImpl : public SerfRequestProcessorImpl
> -{
> -public:
> -    SerfHeadReqProcImpl( const char* inPath,
> -                         const DAVRequestHeaders& inRequestHeaders,
> -                         const std::vector< ::rtl::OUString > & inHeaderNames,
> -                         DAVResource & ioResource );
> -
> -    virtual ~SerfHeadReqProcImpl();
> -
> -    virtual
> -    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -
> -    void processSingleResponseHeader( const char* inHeaderName,
> -                                      const char* inHeaderValue );
> -
> -protected:
> -    virtual
> -    void processChunkOfResponseData( const char* data, apr_size_t len );
> -
> -    virtual
> -    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
> -
> -private:
> -    const std::vector< ::rtl::OUString > * mpHeaderNames;
> -    DAVResource* mpResource;
> -};
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFHEADREQPROCIMPL_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.cxx
> deleted file mode 100644
> index 871718d3b2..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.cxx
> +++ /dev/null
> @@ -1,80 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfTypes.hxx"
> -#include "SerfLockRefreshProcImpl.hxx"
> -#include "DAVProperties.hxx"
> -
> -#include "webdavresponseparser.hxx"
> -#include <serf.h>
> -#include <rtl/ustrbuf.hxx>
> -#include <apr_strings.h>
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfLockRefreshProcImpl::SerfLockRefreshProcImpl( const char* inSourcePath,
> -                                                  const DAVRequestHeaders& inRequestHeaders, // on debug the header look empty
> -                                                  const ucb::Lock& inLock,
> -                                                  const char* inLockToken,
> -                                                  const char* inTimeout,
> -                                          DAVPropertyValue & outLock)
> -    : SerfLockReqProcImpl( inSourcePath, inRequestHeaders, inLock, inTimeout, outLock )
> -    , mpLockToken( inLockToken )
> -{
> -}
> -
> -SerfLockRefreshProcImpl::~SerfLockRefreshProcImpl()
> -{
> -}
> -
> -serf_bucket_t * SerfLockRefreshProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest,
> -                                                                 "LOCK",
> -                                                                 getPathStr(),
> -                                                                 0,
> -                                                                 serf_request_get_alloc( inSerfRequest ) );
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    if (hdrs_bkt != NULL)
> -    {
> -        // general header fields provided by caller
> -        setRequestHeaders( hdrs_bkt );
> -
> -        // request specific header fields
> -        if(mTimeout != 0)
> -        {
> -            serf_bucket_headers_set( hdrs_bkt, "Timeout", mTimeout );
> -        }
> -        if(mpLockToken != 0)
> -        {
> -            serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
> -        }
> -    }
> -    return req_bkt;
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.hxx
> deleted file mode 100644
> index 9c8a2e71b0..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.hxx
> +++ /dev/null
> @@ -1,51 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -#ifndef INCLUDED_SERFLOCKREFRESHPROCIMPL_HXX
> -#define INCLUDED_SERFLOCKREFRESHPROCIMPL_HXX
> -
> -#include "SerfLockReqProcImpl.hxx"
> -
> -namespace http_dav_ucp
> -{
> -
> -    class SerfLockRefreshProcImpl : public SerfLockReqProcImpl
> -    {
> -    protected:
> -        const char*         mpLockToken;
> -
> -    public:
> -        SerfLockRefreshProcImpl( const char* inSourcePath,
> -                                 const DAVRequestHeaders& inRequestHeaders,
> -                                 const ucb::Lock& inLock,
> -                                 const char* inLockToken,
> -                                 const char* inTimeout,
> -                                 DAVPropertyValue & outLock);
> -
> -        virtual ~SerfLockRefreshProcImpl();
> -
> -        virtual
> -        serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -    };
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFLOCKREFRESHPROCIMPL_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx
> deleted file mode 100644
> index 818a88a537..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx
> +++ /dev/null
> @@ -1,155 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfTypes.hxx"
> -#include "SerfLockReqProcImpl.hxx"
> -#include "DAVProperties.hxx"
> -
> -#include "webdavresponseparser.hxx"
> -#include <serf.h>
> -#include <rtl/ustrbuf.hxx>
> -#include <apr_strings.h>
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfLockReqProcImpl::SerfLockReqProcImpl( const char* inSourcePath,
> -                                          const DAVRequestHeaders& inRequestHeaders, // on debug the header look empty
> -                                          const ucb::Lock& inLock,
> -                                          const char* inTimeout,
> -                                          DAVPropertyValue & outLock)
> -    : SerfRequestProcessorImpl( inSourcePath, inRequestHeaders )
> -    , mLock( inLock )
> -    , mTimeout(inTimeout)
> -    , mLockObtained( &outLock )
> -    , xInputStream( new SerfInputStream() )
> -{
> -    switch ( inLock.Depth )
> -    {
> -        //i126305 TODO investigate on this case...
> -    case ucb::LockDepth_MAKE_FIXED_SIZE:
> -
> -    case ucb::LockDepth_ZERO:
> -        mDepthStr = "0";
> -        break;
> -    case ucb::LockDepth_ONE:
> -            mDepthStr = "1";
> -            break;
> -    case ucb::LockDepth_INFINITY:
> -            mDepthStr = "infinity";
> -            break;
> -    }
> -
> -    switch ( inLock.Scope )
> -    {
> -        //i126305 TODO investigate on this case...
> -    case ucb::LockScope_MAKE_FIXED_SIZE:
> -
> -    case ucb::LockScope_EXCLUSIVE:
> -        mLockScope = "<lockscope><exclusive/></lockscope>";
> -        break;
> -    case ucb::LockScope_SHARED:
> -        mLockScope = "<lockscope><shared/></lockscope>";
> -        break;
> -    }
> -}
> -
> -SerfLockReqProcImpl::~SerfLockReqProcImpl()
> -{
> -}
> -
> -#define LOCK_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><lockinfo xmlns=\"DAV:\">"
> -#define LOCK_TYPE "<locktype><write/></locktype>"
> -#define LOCK_TRAILER "</lockinfo>"
> -
> -serf_bucket_t * SerfLockReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -  //prepare body of request:
> -    serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
> -    serf_bucket_t* body_bkt = 0;
> -    rtl::OString aBodyText;
> -    {
> -       rtl::OUStringBuffer aBuffer;
> -        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_HEADER ));
> -        aBuffer.appendAscii( mLockScope );
> -        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_TYPE ));
> -        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<owner>" ));
> -        rtl::OUString aStr;
> -        mLock.Owner >>= aStr;
> -        aBuffer.appendAscii( rtl::OUStringToOString( aStr, RTL_TEXTENCODING_UTF8 ).getStr() );
> -        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</owner>" ));
> -        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_TRAILER ));
> -        aBodyText = rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
> -        body_bkt = serf_bucket_simple_copy_create( aBodyText.getStr(),
> -                                                   aBodyText.getLength(),
> -                                                   pSerfBucketAlloc );
> -    }
> -
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest,
> -                                                                 "LOCK",
> -                                                                 getPathStr(),
> -                                                                 body_bkt,
> -                                                                 pSerfBucketAlloc );
> -    handleChunkedEncoding(req_bkt, aBodyText.getLength());
> -
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    if (hdrs_bkt != NULL)
> -    {
> -        // general header fields provided by caller
> -        setRequestHeaders( hdrs_bkt );
> -
> -        // request specific header fields
> -        serf_bucket_headers_set( hdrs_bkt, "Timeout", mTimeout );
> -        serf_bucket_headers_set( hdrs_bkt, "Depth", mDepthStr );
> -        if (hdrs_bkt!=NULL && body_bkt != 0 && aBodyText.getLength() > 0 )
> -        {
> -            serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
> -        }
> -    }
> -    else
> -    {
> -        OSL_ASSERT("Headers Bucket missing");
> -    }
> -
> -    return req_bkt;
> -}
> -
> -void SerfLockReqProcImpl::processChunkOfResponseData( const char* data,
> -                                                      apr_size_t len )
> -{
> -    if ( xInputStream.is() )
> -    {
> -        xInputStream->AddToStream( data, len );
> -    }
> -}
> -
> -void SerfLockReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
> -{
> -    const DAVPropertyValue rLocksValue( parseWebDAVLockResponse( xInputStream.get() ) );
> -    *mLockObtained = rLocksValue;
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx
> deleted file mode 100644
> index 3983db21ec..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx
> +++ /dev/null
> @@ -1,74 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -#ifndef INCLUDED_SERFLOCKREQPROCIMPL_HXX
> -#define INCLUDED_SERFLOCKREQPROCIMPL_HXX
> -
> -#include "SerfTypes.hxx"
> -#include "SerfRequestProcessorImpl.hxx"
> -
> -#include "SerfInputStream.hxx"
> -
> -#include <vector>
> -#include <rtl/ustring.hxx>
> -#include "SerfTypes.hxx"
> -#include "DAVTypes.hxx"
> -#include "DAVResource.hxx"
> -
> -namespace http_dav_ucp
> -{
> -
> -    class SerfLockReqProcImpl : public SerfRequestProcessorImpl
> -    {
> -
> -    protected:
> -        std::vector< DAVResource > mpResources;
> -        const ucb::Lock     mLock;
> -        const char*         mDepthStr;
> -        const char*         mLockScope;
> -        const char*         mTimeout;
> -        DAVPropertyValue*   mLockObtained;
> -        com::sun::star::uno::Reference< SerfInputStream > xInputStream;
> -
> -    public:
> -        SerfLockReqProcImpl( const char* inSourcePath,
> -                             const DAVRequestHeaders& inRequestHeaders,
> -                             const ucb::Lock& inLock,
> -                             const char* inTimeout,
> -                             DAVPropertyValue & outLock);
> -
> -        virtual ~SerfLockReqProcImpl();
> -
> -        virtual
> -        serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -
> -    protected:
> -        virtual
> -        void processChunkOfResponseData( const char* data, apr_size_t len );
> -
> -        virtual
> -        void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
> -
> -    };
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFLOCKREQPROCIMPL_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx
> deleted file mode 100644
> index cc3140452e..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx
> +++ /dev/null
> @@ -1,72 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfMkColReqProcImpl.hxx"
> -
> -#include <serf.h>
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfMkColReqProcImpl::SerfMkColReqProcImpl( const char* inPath,
> -                                            const DAVRequestHeaders& inRequestHeaders,
> -                                            const char* inLockToken )
> -    : SerfRequestProcessorImpl( inPath,inRequestHeaders )
> -    , mpLockToken( inLockToken )
> -{
> -}
> -
> -SerfMkColReqProcImpl::~SerfMkColReqProcImpl()
> -{
> -}
> -
> -serf_bucket_t * SerfMkColReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
> -                                                                 "MKCOL",
> -                                                                 getPathStr(),
> -                                                                 0,
> -                                                                 serf_request_get_alloc( inSerfRequest ) );
> -
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    // general header fields provided by caller
> -    setRequestHeaders( hdrs_bkt );
> -
> -    return req_bkt;
> -}
> -
> -void SerfMkColReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
> -                                                       apr_size_t /*len*/ )
> -{
> -    // nothing to do;
> -}
> -
> -void SerfMkColReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
> -{
> -    // nothing to do;
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx
> deleted file mode 100644
> index 662eb0a1f9..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx
> +++ /dev/null
> @@ -1,91 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfMoveReqProcImpl.hxx"
> -
> -#include <serf.h>
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfMoveReqProcImpl::SerfMoveReqProcImpl( const char* inSourcePath,
> -                                          const DAVRequestHeaders& inRequestHeaders,
> -                                          const char* inDestinationPath,
> -                                          const bool inOverwrite,
> -                                          const char* inLockToken)
> -    : SerfRequestProcessorImpl( inSourcePath, inRequestHeaders )
> -    , mDestPathStr( inDestinationPath )
> -    , mbOverwrite( inOverwrite )
> -    , mpLockToken( inLockToken )
> -{
> -}
> -
> -SerfMoveReqProcImpl::~SerfMoveReqProcImpl()
> -{
> -}
> -
> -serf_bucket_t * SerfMoveReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
> -                                                                 "MOVE",
> -                                                                 getPathStr(),
> -                                                                 0,
> -                                                                 serf_request_get_alloc( inSerfRequest ) );
> -
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    // general header fields provided by caller
> -    setRequestHeaders( hdrs_bkt );
> -    
> -    // MOVE specific header fields
> -    serf_bucket_headers_set( hdrs_bkt, "Destination", mDestPathStr );
> -    if ( mbOverwrite )
> -    {
> -        serf_bucket_headers_set( hdrs_bkt, "Overwrite", "T" );
> -    }
> -    else
> -    {
> -        serf_bucket_headers_set( hdrs_bkt, "Overwrite", "F" );
> -    }
> -    if(mpLockToken)
> -    {
> -        serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
> -    }
> -
> -    return req_bkt;
> -}
> -
> -void SerfMoveReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
> -                                                      apr_size_t /*len*/ )
> -{
> -    // nothing to do;
> -}
> -
> -void SerfMoveReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
> -{
> -    // nothing to do;
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx
> deleted file mode 100644
> index cf49e9983c..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx
> +++ /dev/null
> @@ -1,59 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -#ifndef INCLUDED_SERFMOVEREQPROCIMPL_HXX
> -#define INCLUDED_SERFMOVEREQPROCIMPL_HXX
> -
> -#include "SerfRequestProcessorImpl.hxx"
> -
> -namespace http_dav_ucp
> -{
> -
> -class SerfMoveReqProcImpl : public SerfRequestProcessorImpl
> -{
> -public:
> -    SerfMoveReqProcImpl( const char* inSourcePath,
> -                         const DAVRequestHeaders& inRequestHeaders,
> -                         const char* inDestinationPath,
> -                         const bool inOverwrite,
> -                         const char* inLockToken );
> -
> -    virtual ~SerfMoveReqProcImpl();
> -
> -    virtual
> -    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -
> -protected:
> -    virtual
> -    void processChunkOfResponseData( const char* data, apr_size_t len );
> -
> -    virtual
> -    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
> -
> -private:
> -    const char* mDestPathStr;
> -    const bool  mbOverwrite;
> -    const char* mpLockToken;
> -};
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFMOVEREQPROCIMPL_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
> deleted file mode 100644
> index 20cd38edc2..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
> +++ /dev/null
> @@ -1,136 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfPostReqProcImpl.hxx"
> -
> -#include <serf.h>
> -
> -using namespace com::sun::star;
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfPostReqProcImpl::SerfPostReqProcImpl( const char* inPath,
> -                                          const DAVRequestHeaders& inRequestHeaders,
> -                                          const char* inData,
> -                                          apr_size_t inDataLen,
> -                                          const char* inLockToken,
> -                                          const char* inContentType,
> -                                          const char* inReferer,
> -                                          const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , mpPostData( inData )
> -    , mnPostDataLen( inDataLen )
> -    , mpLockToken( inLockToken )
> -    , mpContentType( inContentType )
> -    , mpReferer( inReferer )
> -    , xInputStream( xioInStrm )
> -    , xOutputStream()
> -{
> -}
> -
> -SerfPostReqProcImpl::SerfPostReqProcImpl( const char* inPath,
> -                                          const DAVRequestHeaders& inRequestHeaders,
> -                                          const char* inData,
> -                                          apr_size_t inDataLen,
> -                                          const char* inLockToken,
> -                                          const char* inContentType,
> -                                          const char* inReferer,
> -                                          const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , mpPostData( inData )
> -    , mnPostDataLen( inDataLen )
> -    , mpLockToken( inLockToken )
> -    , mpContentType( inContentType )
> -    , mpReferer( inReferer )
> -    , xInputStream()
> -    , xOutputStream( xioOutStrm )
> -{
> -}
> -
> -SerfPostReqProcImpl::~SerfPostReqProcImpl()
> -{
> -}
> -
> -serf_bucket_t * SerfPostReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -    serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
> -
> -    // create body bucket
> -    serf_bucket_t* body_bkt = 0;
> -    if ( mpPostData != 0 && mnPostDataLen > 0 )
> -    {
> -        body_bkt = SERF_BUCKET_SIMPLE_STRING_LEN( mpPostData, mnPostDataLen, pSerfBucketAlloc );
> -    }
> -
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
> -                                                                 "POST",
> -                                                                 getPathStr(),
> -                                                                 body_bkt,
> -                                                                 serf_request_get_alloc( inSerfRequest ) );
> -    handleChunkedEncoding(req_bkt, mnPostDataLen);
> -
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    // general header fields provided by caller
> -    setRequestHeaders( hdrs_bkt );
> -
> -    // request specific header fields
> -    if ( mpContentType != 0 )
> -    {
> -        serf_bucket_headers_set( hdrs_bkt, "Content-Type", mpContentType );
> -    }
> -    if ( mpReferer != 0 )
> -    {
> -        serf_bucket_headers_set( hdrs_bkt, "Referer", mpReferer );
> -    }
> -    if(mpLockToken)
> -    {
> -        serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
> -    }
> -
> -    return req_bkt;
> -}
> -
> -void SerfPostReqProcImpl::processChunkOfResponseData( const char* data, 
> -                                                      apr_size_t len )
> -{
> -    if ( xInputStream.is() )
> -    {
> -        xInputStream->AddToStream( data, len );
> -    }
> -    else if ( xOutputStream.is() )
> -    {
> -        const uno::Sequence< sal_Int8 > aDataSeq( (sal_Int8 *)data, len );
> -        xOutputStream->writeBytes( aDataSeq );
> -    }
> -}
> -
> -void SerfPostReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
> -{
> -    // nothing to do;
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx
> deleted file mode 100644
> index a0420faf3c..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx
> +++ /dev/null
> @@ -1,79 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -#ifndef INCLUDED_SERFPOSTREQPROCIMPL_HXX
> -#define INCLUDED_SERFPOSTREQPROCIMPL_HXX
> -
> -#include "SerfRequestProcessorImpl.hxx"
> -
> -#include "SerfInputStream.hxx"
> -#include <com/sun/star/io/XOutputStream.hpp>
> -
> -namespace http_dav_ucp
> -{
> -
> -class SerfPostReqProcImpl : public SerfRequestProcessorImpl
> -{
> -public:
> -    SerfPostReqProcImpl( const char* inPath,
> -                         const DAVRequestHeaders& inRequestHeaders,
> -                         const char* inData,
> -                         apr_size_t inDataLen,
> -                         const char* inLockToken,
> -                         const char* inContentType,
> -                         const char* inReferer,
> -                         const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm );
> -
> -    SerfPostReqProcImpl( const char* inPath,
> -                         const DAVRequestHeaders& inRequestHeaders,
> -                         const char* inData,
> -                         apr_size_t inDataLen,
> -                         const char* inLockToken,
> -                         const char* inContentType,
> -                         const char* inReferer,
> -                         const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm );
> -
> -    virtual ~SerfPostReqProcImpl();
> -
> -    virtual
> -    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -
> -protected:
> -    virtual
> -    void processChunkOfResponseData( const char* data, apr_size_t len );
> -
> -    virtual
> -    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
> -
> -private:
> -    const char* mpPostData;
> -    apr_size_t mnPostDataLen;
> -    const char* mpLockToken;
> -    const char* mpContentType;
> -    const char* mpReferer;
> -    com::sun::star::uno::Reference< SerfInputStream > xInputStream;
> -    com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > xOutputStream;
> -
> -};
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFPOSTREQPROCIMPL_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
> deleted file mode 100644
> index 806f50a00b..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
> +++ /dev/null
> @@ -1,202 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfPropFindReqProcImpl.hxx"
> -#include "SerfTypes.hxx"
> -#include "DAVProperties.hxx"
> -
> -#include "webdavresponseparser.hxx"
> -#include <comphelper/seqstream.hxx>
> -#include <rtl/ustrbuf.hxx>
> -
> -
> -using namespace com::sun::star;
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfPropFindReqProcImpl::SerfPropFindReqProcImpl( const char* inPath,
> -                                                  const DAVRequestHeaders& inRequestHeaders,
> -                                                  const Depth inDepth,
> -                                                  const std::vector< ::rtl::OUString > & inPropNames,
> -                                                  std::vector< DAVResource > & ioResources )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , mDepthStr( 0 )
> -    , mpPropNames( &inPropNames )
> -    , mpResources( &ioResources )
> -    , mpResInfo( 0 )
> -    , mbOnlyPropertyNames( false )
> -    , xInputStream( new SerfInputStream() )
> -{
> -    init( inDepth );
> -}
> -
> -SerfPropFindReqProcImpl::SerfPropFindReqProcImpl( const char* inPath,
> -                                                  const DAVRequestHeaders& inRequestHeaders,
> -                                                  const Depth inDepth,
> -                                                  std::vector< DAVResourceInfo > & ioResInfo )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , mDepthStr( 0 )
> -    , mpPropNames( 0 )
> -    , mpResources( 0 )
> -    , mpResInfo( &ioResInfo )
> -    , mbOnlyPropertyNames( true )
> -    , xInputStream( new SerfInputStream() )
> -{
> -    init( inDepth );
> -}
> -
> -void SerfPropFindReqProcImpl::init( const Depth inDepth )
> -{
> -    switch ( inDepth )
> -    {
> -        case DAVZERO:
> -            mDepthStr = "0";
> -            break;
> -        case DAVONE:
> -            mDepthStr = "1";
> -            break;
> -        case DAVINFINITY:
> -            mDepthStr = "infinity";
> -            break;
> -    }
> -}
> -
> -SerfPropFindReqProcImpl::~SerfPropFindReqProcImpl()
> -{
> -}
> -
> -#define PROPFIND_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><propfind xmlns=\"DAV:\">"
> -#define PROPFIND_TRAILER "</propfind>"
> -
> -serf_bucket_t * SerfPropFindReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -    serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
> -
> -    // body bucket - certain properties OR all properties OR only property names
> -    serf_bucket_t* body_bkt = 0;
> -    rtl::OString aBodyText;
> -    {
> -        // TODO is it really needed a Unicode string buffer?
> -        // All properties and property names aren't supposed to be ASCII?
> -        rtl::OUStringBuffer aBuffer;
> -        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPFIND_HEADER ));
> -
> -        // create and fill body bucket with requested properties
> -        const int nPropCount = ( !mbOnlyPropertyNames && mpPropNames )
> -                               ? mpPropNames->size() 
> -                               : 0;
> -        if ( nPropCount > 0 )
> -        {
> -            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<prop>" ) );
> -            SerfPropName thePropName;
> -            for ( int theIndex = 0; theIndex < nPropCount; theIndex ++ )
> -            {
> -                // split fullname into namespace and name!
> -                DAVProperties::createSerfPropName( (*mpPropNames)[ theIndex ], 
> -                                                   thePropName );
> -
> -                /* <*propname* xmlns="*propns*" /> */
> -                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
> -                aBuffer.appendAscii( thePropName.name );
> -                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " xmlnx=\"" ));
> -                aBuffer.appendAscii( thePropName.nspace );
> -                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\"/>" ));
> -            }
> -
> -            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop>" ));
> -        }
> -        else
> -        {
> -            if ( mbOnlyPropertyNames )
> -            {
> -                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<propname/>" ));
> -            }
> -            else
> -            {
> -                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<allprop/>" ));
> -            }
> -        }
> -
> -        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPFIND_TRAILER ));
> -        aBodyText = rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
> -        body_bkt = serf_bucket_simple_copy_create( aBodyText.getStr(),
> -                                                   aBodyText.getLength(),
> -                                                   pSerfBucketAlloc );
> -    }
> -
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
> -                                                                 "PROPFIND",
> -                                                                 getPathStr(),
> -                                                                 body_bkt,
> -                                                                 pSerfBucketAlloc );
> -    handleChunkedEncoding(req_bkt, aBodyText.getLength());
> -
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    if (hdrs_bkt != NULL)
> -    {
> -        // general header fields provided by caller
> -        setRequestHeaders( hdrs_bkt );
> -
> -        // request specific header fields
> -        serf_bucket_headers_set( hdrs_bkt, "Depth", mDepthStr );
> -        if (hdrs_bkt!=NULL && body_bkt != 0 && aBodyText.getLength() > 0 )
> -        {
> -            serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
> -        }
> -    }
> -    else
> -    {
> -        OSL_ASSERT("Headers Bucket missing");
> -    }
> -
> -    return req_bkt;
> -}
> -
> -void SerfPropFindReqProcImpl::processChunkOfResponseData( const char* data, 
> -                                                          apr_size_t len )
> -{
> -    if ( xInputStream.is() )
> -    {
> -        xInputStream->AddToStream( data, len );
> -    }
> -}
> -
> -void SerfPropFindReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
> -{
> -    if ( mbOnlyPropertyNames )
> -    {
> -        const std::vector< DAVResourceInfo > rResInfo( parseWebDAVPropNameResponse( xInputStream.get() ) );
> -        *mpResInfo = rResInfo;
> -    }
> -    else
> -    {
> -        const std::vector< DAVResource > rResources( parseWebDAVPropFindResponse( xInputStream.get() ) );
> -        *mpResources = rResources;
> -    }
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.hxx
> deleted file mode 100644
> index b6870a85ec..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.hxx
> +++ /dev/null
> @@ -1,77 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -#ifndef INCLUDED_SERFPROPFINDREQPROCIMPL_HXX
> -#define INCLUDED_SERFPROPFINDREQPROCIMPL_HXX
> -
> -#include "SerfRequestProcessorImpl.hxx"
> -
> -#include <vector>
> -#include <rtl/ustring.hxx>
> -#include "DAVTypes.hxx"
> -#include "DAVResource.hxx"
> -
> -#include "SerfInputStream.hxx"
> -
> -namespace http_dav_ucp
> -{
> -
> -class SerfPropFindReqProcImpl : public SerfRequestProcessorImpl
> -{
> -public:
> -    SerfPropFindReqProcImpl( const char* inPath,
> -                             const DAVRequestHeaders& inRequestHeaders,
> -                             const Depth inDepth,
> -                             const std::vector< ::rtl::OUString > & inPropNames,
> -                             std::vector< DAVResource > & ioResources );
> -    
> -    SerfPropFindReqProcImpl( const char* inPath,
> -                             const DAVRequestHeaders& inRequestHeaders,
> -                             const Depth inDepth,
> -                             std::vector< DAVResourceInfo > & ioResInfo );
> -
> -    virtual ~SerfPropFindReqProcImpl();
> -
> -    virtual
> -    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -
> -protected:
> -    virtual
> -    void processChunkOfResponseData( const char* data, apr_size_t len );
> -
> -    virtual
> -    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
> -
> -private:
> -    void init( const Depth inDepth );
> -
> -    const char* mDepthStr;
> -    const std::vector< ::rtl::OUString > * mpPropNames;
> -    std::vector< DAVResource > * mpResources;
> -    std::vector< DAVResourceInfo > * mpResInfo;
> -
> -    const bool mbOnlyPropertyNames;
> -    com::sun::star::uno::Reference< SerfInputStream > xInputStream;
> -};
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFPROPFINDREQPROCIMPL_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
> deleted file mode 100644
> index 57c7e7350b..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
> +++ /dev/null
> @@ -1,200 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include <rtl/ustring.hxx>
> -#include <rtl/ustrbuf.hxx>
> -#include "DAVProperties.hxx"
> -#include "UCBDeadPropertyValue.hxx"
> -
> -#include "SerfPropPatchReqProcImpl.hxx"
> -#include "SerfTypes.hxx"
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfPropPatchReqProcImpl::SerfPropPatchReqProcImpl( const char* inPath,
> -                                                    const DAVRequestHeaders& inRequestHeaders,
> -                                                    const std::vector< ProppatchValue > & inProperties,
> -                                                    const char* inLockToken )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , mpProperties( &inProperties )
> -    , mpLockToken( inLockToken )
> -{
> -}
> -
> -SerfPropPatchReqProcImpl::~SerfPropPatchReqProcImpl()
> -{
> -}
> -
> -#define PROPPATCH_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><propertyupdate xmlns=\"DAV:\">"
> -#define PROPPATCH_TRAILER "</propertyupdate>"
> -
> -serf_bucket_t * SerfPropPatchReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -    serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
> -
> -    // body bucket
> -    serf_bucket_t* body_bkt = 0;
> -    rtl::OString aBodyText;
> -    {
> -        // create and fill body bucket with properties to be set or removed
> -        static const struct
> -        {
> -            const char *str;
> -            sal_Int32   len;
> -        }
> -        OpCode [] = {
> -            { RTL_CONSTASCII_STRINGPARAM( "set" ) },
> -            { RTL_CONSTASCII_STRINGPARAM( "remove" ) }
> -        };
> -        const int nPropCount = ( mpProperties != 0 )
> -                               ? mpProperties->size() 
> -                               : 0;
> -        if ( nPropCount > 0 )
> -        {
> -            rtl::OUStringBuffer aBuffer;
> -            // add PropPatch xml header in front
> -            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPPATCH_HEADER ));
> -
> -            // <*operation code*><prop>
> -
> -            ProppatchOperation lastOp = (*mpProperties)[ 0 ].operation;
> -            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
> -            aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
> -            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><prop>" ));
> -
> -            SerfPropName thePropName;
> -            for ( int n = 0; n < nPropCount; ++n )
> -            {
> -                const ProppatchValue & rProperty = (*mpProperties)[ n ];
> -                // split fullname into namespace and name!
> -                DAVProperties::createSerfPropName( rProperty.name, 
> -                                                   thePropName );
> -
> -                if ( rProperty.operation != lastOp )
> -                {
> -                    // </prop></*last operation code*><*operation code><prop>
> -                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop></" ));
> -                    aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
> -                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><" ));
> -                    aBuffer.appendAscii( OpCode[rProperty.operation].str, OpCode[rProperty.operation].len );
> -                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><prop>" ));
> -                }
> -
> -                // <*propname* xmlns="*propns*"
> -                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
> -                aBuffer.appendAscii( thePropName.name );
> -                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " xmlns=\"" ));
> -                aBuffer.appendAscii( thePropName.nspace );
> -                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\"" ));
> -
> -                if ( rProperty.operation == PROPSET )
> -                {
> -                    // >*property value*</*propname*>
> -                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
> -
> -                    rtl::OUString aStringValue;
> -                    if ( DAVProperties::isUCBDeadProperty( thePropName ) )
> -                    {
> -                        UCBDeadPropertyValue::toXML( rProperty.value,
> -                                                     aStringValue );
> -                    }
> -                    else
> -                    {
> -                        rProperty.value >>= aStringValue;
> -                    }
> -                    aBuffer.append( aStringValue );
> -                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</" ));
> -                    aBuffer.appendAscii( thePropName.name );
> -                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
> -                }
> -                else
> -                {
> -                    // />
> -                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/>" ));
> -                }
> -
> -                lastOp = rProperty.operation;
> -            }
> -
> -            // </prop></*last operation code*>
> -            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop></" ));
> -            aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
> -            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
> -
> -            // add PropPatch xml trailer at end
> -            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPPATCH_TRAILER ));
> -
> -            aBodyText = rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
> -            body_bkt = serf_bucket_simple_copy_create( aBodyText.getStr(),
> -                                                       aBodyText.getLength(),
> -                                                       pSerfBucketAlloc );
> -        }
> -    }
> -
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
> -                                                                 "PROPPATCH",
> -                                                                 getPathStr(),
> -                                                                 body_bkt,
> -                                                                 pSerfBucketAlloc ) ;
> -    handleChunkedEncoding(req_bkt, aBodyText.getLength());
> -
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    if (hdrs_bkt != NULL)
> -    {
> -        // general header fields provided by caller
> -        setRequestHeaders( hdrs_bkt );
> -
> -        // request specific header fields
> -        if(mpLockToken)
> -        {
> -            serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
> -        }
> -        if ( body_bkt != 0 && aBodyText.getLength() > 0 )
> -        {
> -            serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
> -        }
> -    }
> -    else
> -    {
> -        OSL_ASSERT("Headers Bucket missing");
> -    }
> -
> -    return req_bkt;
> -}
> -
> -void SerfPropPatchReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
> -                                                           apr_size_t /*len*/ )
> -{
> -    // nothing to do;
> -}
> -
> -void SerfPropPatchReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
> -{
> -    // nothing to do;
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.hxx
> deleted file mode 100644
> index 454344d750..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.hxx
> +++ /dev/null
> @@ -1,60 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -#ifndef INCLUDED_SERFPROPPATCHREQPROCIMPL_HXX
> -#define INCLUDED_SERFPROPPATCHREQPROCIMPL_HXX
> -
> -#include "SerfRequestProcessorImpl.hxx"
> -
> -#include <vector>
> -#include "DAVTypes.hxx"
> -
> -namespace http_dav_ucp
> -{
> -
> -class SerfPropPatchReqProcImpl : public SerfRequestProcessorImpl
> -{
> -public:
> -    SerfPropPatchReqProcImpl( const char* inPath,
> -                              const DAVRequestHeaders& inRequestHeaders,
> -                              const std::vector< ProppatchValue > & inProperties,
> -                              const char* inLockToken );
> -
> -    virtual ~SerfPropPatchReqProcImpl();
> -
> -    virtual
> -    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -
> -protected:
> -    virtual
> -    void processChunkOfResponseData( const char* data, apr_size_t len );
> -
> -    virtual
> -    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
> -
> -private:
> -    const std::vector< ProppatchValue > * mpProperties;
> -    const  char *mpLockToken;
> -};
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFPROPPATCHREQPROCIMPL_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
> deleted file mode 100644
> index 2057705458..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
> +++ /dev/null
> @@ -1,93 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include <rtl/ustring.hxx>
> -
> -#include "SerfPutReqProcImpl.hxx"
> -
> -#include <serf.h>
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfPutReqProcImpl::SerfPutReqProcImpl( const char* inPath,
> -                                        const DAVRequestHeaders& inRequestHeaders,
> -                                        const char* inData,
> -                                        const char* inLockToken,
> -                                        apr_size_t inDataLen )
> -    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
> -    , mpData( inData )
> -    , mpLockToken( inLockToken)
> -    , mnDataLen( inDataLen )
> -{
> -}
> -
> -SerfPutReqProcImpl::~SerfPutReqProcImpl()
> -{
> -}
> -
> -serf_bucket_t * SerfPutReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
> -{
> -    serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
> -
> -    // create body bucket
> -    serf_bucket_t* body_bkt = 0;
> -    if ( mpData != 0 && mnDataLen > 0 )
> -    {
> -        body_bkt = SERF_BUCKET_SIMPLE_STRING_LEN( mpData, mnDataLen, pSerfBucketAlloc );
> -    }
> -
> -    // create serf request
> -    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest,
> -                                                                 "PUT",
> -                                                                 getPathStr(),
> -                                                                 body_bkt,
> -                                                                 serf_request_get_alloc( inSerfRequest ) );
> -    handleChunkedEncoding(req_bkt, mnDataLen);
> -
> -    // set request header fields
> -    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
> -    // general header fields provided by caller
> -    setRequestHeaders( hdrs_bkt );
> -    if(mpLockToken)
> -    {
> -    // request specific header field
> -        serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
> -    }
> -
> -    return req_bkt;
> -}
> -
> -void SerfPutReqProcImpl::processChunkOfResponseData( const char* /*data*/,
> -                                                     apr_size_t /*len*/ )
> -{
> -    // nothing to do;
> -}
> -
> -void SerfPutReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
> -{
> -    // nothing to do;
> -}
> -
> -} // namespace http_dav_ucp
> diff --git a/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx
> deleted file mode 100644
> index 887e1612d2..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx
> +++ /dev/null
> @@ -1,61 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -#ifndef INCLUDED_SERFPUTREQPROCIMPL_HXX
> -#define INCLUDED_SERFPUTREQPROCIMPL_HXX
> -
> -#include "SerfRequestProcessorImpl.hxx"
> -
> -namespace http_dav_ucp
> -{
> -
> -class SerfPutReqProcImpl : public SerfRequestProcessorImpl
> -{
> -public:
> -    SerfPutReqProcImpl( const char* inPath,
> -                        const DAVRequestHeaders& inRequestHeaders,
> -                        const char* inData,
> -                        const char* inLockToken,
> -                        apr_size_t inDataLen );
> -    
> -
> -    virtual ~SerfPutReqProcImpl();
> -
> -    virtual
> -    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
> -
> -protected:
> -    virtual
> -    void processChunkOfResponseData( const char* data, apr_size_t len );
> -
> -    virtual
> -    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
> -
> -private:
> -    const char* mpData;
> -    const char* mpLockToken;
> -    apr_size_t mnDataLen;
> -
> -};
> -
> -} // namespace http_dav_ucp
> -
> -#endif // INCLUDED_SERFPUTREQPROCIMPL_HXX
> diff --git a/main/ucb/source/ucp/webdav/SerfRequestProcessor.cxx b/main/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
> deleted file mode 100644
> index e3786301d8..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
> +++ /dev/null
> @@ -1,721 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -// MARKER(update_precomp.py): autogen include statement, do not remove
> -#include "precompiled_webdav.hxx"
> -
> -#include "SerfRequestProcessor.hxx"
> -#include "SerfRequestProcessorImpl.hxx"
> -#include "SerfRequestProcessorImplFac.hxx"
> -#include "SerfCallbacks.hxx"
> -#include "SerfSession.hxx"
> -
> -#include <apr_strings.h>
> -
> -//to examine returned http code
> -#include "DAVException.hxx"
> -
> -namespace http_dav_ucp
> -{
> -
> -SerfRequestProcessor::SerfRequestProcessor( SerfSession& rSerfSession,
> -                                            const rtl::OUString & inPath,
> -                                            const bool bUseChunkedEncoding )
> -    : mrSerfSession( rSerfSession )
> -    , mPathStr( 0 )
> -    , mbUseChunkedEncoding( bUseChunkedEncoding )
> -    , mDestPathStr( 0 )
> -    , mContentType( 0 )
> -    , mReferer( 0 )
> -    , mpProcImpl( 0 )
> -    , mbProcessingDone( false )
> -    , mpDAVException()
> -    , mnHTTPStatusCode( SC_NONE )
> -    , mHTTPStatusCodeText()
> -    , mRedirectLocation()
> -    , mnSuccessfulCredentialAttempts( 0 )
> -    , mbInputOfCredentialsAborted( false )
> -    , mbSetupSerfRequestCalled( false )
> -    , mbAcceptSerfResponseCalled( false )
> -    , mbHandleSerfResponseCalled( false )
> -{
> -    mPathStr = apr_pstrdup( mrSerfSession.getAprPool(), 
> -                            rtl::OUStringToOString( inPath, RTL_TEXTENCODING_UTF8 ).getStr() );
> -}
> -
> -SerfRequestProcessor::~SerfRequestProcessor()
> -{
> -    delete mpProcImpl;
> -    delete mpDAVException;
> -}
> -
> -void SerfRequestProcessor::prepareProcessor()
> -{
> -    delete mpDAVException;
> -    mpDAVException = 0;
> -    mnHTTPStatusCode = SC_NONE;
> -    mHTTPStatusCodeText = rtl::OUString();
> -    mRedirectLocation = rtl::OUString();
> -
> -    mnSuccessfulCredentialAttempts = 0;
> -    mbInputOfCredentialsAborted = false;
> -    mbSetupSerfRequestCalled = false;
> -    mbAcceptSerfResponseCalled = false;
> -    mbHandleSerfResponseCalled = false;
> -}
> -
> -// PROPFIND - allprop & named
> -bool SerfRequestProcessor::processPropFind( const Depth inDepth,
> -                                            const std::vector< ::rtl::OUString > & inPropNames,
> -                                            std::vector< DAVResource > & ioResources,
> -                                            apr_status_t& outSerfStatus )
> -{
> -    mpProcImpl = createPropFindReqProcImpl( mPathStr,
> -                                            mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                            inDepth,
> -                                            inPropNames,
> -                                            ioResources );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// PROPFIND - property names
> -bool SerfRequestProcessor::processPropFind( const Depth inDepth,
> -                                            std::vector< DAVResourceInfo > & ioResInfo,
> -                                            apr_status_t& outSerfStatus )
> -{
> -    mpProcImpl = createPropFindReqProcImpl( mPathStr,
> -                                            mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                            inDepth,
> -                                            ioResInfo );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// PROPPATCH
> -bool SerfRequestProcessor::processPropPatch( const std::vector< ProppatchValue > & inProperties,
> -                                             const com::sun::star::ucb::Lock  inLock,
> -                                             apr_status_t& outSerfStatus )
> -{
> -    char * inLockToken = static_cast<char*>(0);
> -    if(inLock.LockTokens.getLength() > 0)
> -    {
> -        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
> -                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
> -    }
> -    mpProcImpl = createPropPatchReqProcImpl( mPathStr,
> -                                             mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                             inProperties,
> -                                             inLockToken );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// GET
> -bool SerfRequestProcessor::processGet( const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm, 
> -                                       apr_status_t& outSerfStatus )
> -{
> -    mpProcImpl = createGetReqProcImpl( mPathStr,
> -                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                       xioInStrm );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// GET inclusive header fields
> -bool SerfRequestProcessor::processGet( const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm, 
> -                                       const std::vector< ::rtl::OUString > & inHeaderNames,
> -                                       DAVResource & ioResource,
> -                                       apr_status_t& outSerfStatus )
> -{
> -    mpProcImpl = createGetReqProcImpl( mPathStr,
> -                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                       xioInStrm,
> -                                       inHeaderNames,
> -                                       ioResource );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// GET
> -bool SerfRequestProcessor::processGet( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm, 
> -                                       apr_status_t& outSerfStatus )
> -{
> -    mpProcImpl = createGetReqProcImpl( mPathStr,
> -                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                       xioOutStrm );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// GET inclusive header fields
> -bool SerfRequestProcessor::processGet( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm, 
> -                                       const std::vector< ::rtl::OUString > & inHeaderNames,
> -                                       DAVResource & ioResource,
> -                                       apr_status_t& outSerfStatus )
> -{
> -    mpProcImpl = createGetReqProcImpl( mPathStr,
> -                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                       xioOutStrm,
> -                                       inHeaderNames,
> -                                       ioResource );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// HEAD
> -bool SerfRequestProcessor::processHead( const std::vector< ::rtl::OUString > & inHeaderNames,
> -                                        DAVResource & ioResource,
> -                                        apr_status_t& outSerfStatus )
> -{
> -    mpProcImpl = createHeadReqProcImpl( mPathStr,
> -                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                        inHeaderNames,
> -                                        ioResource );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// PUT
> -bool SerfRequestProcessor::processPut( const char* inData,
> -                                       apr_size_t inDataLen,
> -                                       const com::sun::star::ucb::Lock inLock,
> -                                       apr_status_t& outSerfStatus )
> -{
> -    char * inLockToken = static_cast<char*>(0);
> -    if(inLock.LockTokens.getLength() > 0)
> -    {
> -        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
> -                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
> -    }
> -    mpProcImpl = createPutReqProcImpl( mPathStr,
> -                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                       inData,
> -                                       inLockToken,
> -                                       inDataLen );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// POST
> -bool SerfRequestProcessor::processPost( const char* inData,
> -                                        apr_size_t inDataLen,
> -                                        const rtl::OUString & inContentType,
> -                                        const rtl::OUString & inReferer,
> -                                        const com::sun::star::ucb::Lock inLock,
> -                                        const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm,
> -                                        apr_status_t& outSerfStatus )
> -{
> -    mContentType = apr_pstrdup( mrSerfSession.getAprPool(), 
> -                                rtl::OUStringToOString( inContentType, RTL_TEXTENCODING_UTF8 ).getStr() );
> -    mReferer = apr_pstrdup( mrSerfSession.getAprPool(), 
> -                                rtl::OUStringToOString( inReferer, RTL_TEXTENCODING_UTF8 ).getStr() );
> -    char * inLockToken = static_cast<char*>(0);
> -    if(inLock.LockTokens.getLength() > 0)
> -    {
> -        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
> -                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
> -    }
> -    mpProcImpl = createPostReqProcImpl( mPathStr,
> -                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                        inData,
> -                                        inDataLen,
> -                                        inLockToken,
> -                                        mContentType,
> -                                        mReferer,
> -                                        xioInStrm );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// POST
> -bool SerfRequestProcessor::processPost( const char* inData,
> -                                        apr_size_t inDataLen,
> -                                        const rtl::OUString & inContentType,
> -                                        const rtl::OUString & inReferer,
> -                                        const com::sun::star::ucb::Lock inLock,
> -                                        const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm,
> -                                        apr_status_t& outSerfStatus )
> -{
> -    mContentType = apr_pstrdup( mrSerfSession.getAprPool(), 
> -                                rtl::OUStringToOString( inContentType, RTL_TEXTENCODING_UTF8 ).getStr() );
> -    mReferer = apr_pstrdup( mrSerfSession.getAprPool(), 
> -                            rtl::OUStringToOString( inReferer, RTL_TEXTENCODING_UTF8 ).getStr() );
> -    char * inLockToken = static_cast<char*>(0);
> -    if(inLock.LockTokens.getLength() > 0)
> -    {
> -        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
> -                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
> -    }
> -    mpProcImpl = createPostReqProcImpl( mPathStr,
> -                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                        inData,
> -                                        inDataLen,
> -                                        inLockToken,
> -                                        mContentType,
> -                                        mReferer,
> -                                        xioOutStrm );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// DELETE
> -bool SerfRequestProcessor::processDelete( const com::sun::star::ucb::Lock inLock,
> -                                          apr_status_t& outSerfStatus )
> -{
> -    char * inLockToken = static_cast<char*>(0);
> -    if(inLock.LockTokens.getLength() > 0)
> -    {
> -        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
> -                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
> -    }
> -    mpProcImpl = createDeleteReqProcImpl( mPathStr,
> -                                          mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                          inLockToken );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// MKCOL
> -bool SerfRequestProcessor::processMkCol( const com::sun::star::ucb::Lock inLock,
> -                                         apr_status_t& outSerfStatus )
> -{
> -    char * inLockToken = static_cast<char*>(0);
> -    if(inLock.LockTokens.getLength() > 0)
> -    {
> -        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
> -                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
> -    }
> -    mpProcImpl = createMkColReqProcImpl( mPathStr,
> -                                         mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                         inLockToken );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// COPY
> -bool SerfRequestProcessor::processCopy( const rtl::OUString & inDestinationPath,
> -                                        const bool inOverwrite,
> -                                        const com::sun::star::ucb::Lock inLock,
> -                                        apr_status_t& outSerfStatus )
> -{
> -    mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(), 
> -                                rtl::OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
> -    char * inLockToken = static_cast<char*>(0);
> -    if(inLock.LockTokens.getLength() > 0)
> -    {
> -        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
> -                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
> -    }
> -    mpProcImpl = createCopyReqProcImpl( mPathStr,
> -                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                        mDestPathStr,
> -                                        inOverwrite,
> -                                        inLockToken );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -// MOVE
> -bool SerfRequestProcessor::processMove( const rtl::OUString & inDestinationPath,
> -                                        const bool inOverwrite,
> -                                        const com::sun::star::ucb::Lock  inLock,
> -                                        apr_status_t& outSerfStatus )
> -{
> -    mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(), 
> -                                rtl::OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
> -    char * inLockToken = static_cast<char*>(0);
> -    if(inLock.LockTokens.getLength() > 0)
> -    {
> -        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
> -                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
> -    }
> -    mpProcImpl = createMoveReqProcImpl( mPathStr,
> -                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                        mDestPathStr,
> -                                        inOverwrite,
> -                                        inLockToken );
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -//LOCK creating a new lock
> -bool SerfRequestProcessor::processLock( const rtl::OUString & inDestinationPath,
> -                                        const com::sun::star::ucb::Lock& inLock,
> -                                        DAVPropertyValue & outLock,
> -                                        apr_status_t& outSerfStatus )
> -{
> -    mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(),
> -                                rtl::OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
> -    char * Timeout;
> -    if(inLock.Timeout == -1)
> -        Timeout = apr_psprintf( mrSerfSession.getAprPool(), "Infinite" );
> -    else
> -        Timeout = apr_psprintf( mrSerfSession.getAprPool(), "Second-%ld", inLock.Timeout );
> -
> -    mpProcImpl = createLockReqProcImpl( mPathStr,
> -                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                        inLock,
> -                                        Timeout,
> -                                        outLock);
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -//LOCK refresh an existing lock
> -bool SerfRequestProcessor::processLockRefresh( const rtl::OUString & inDestinationPath,
> -                                        const com::sun::star::ucb::Lock& inLock,
> -                                        DAVPropertyValue & outLock,
> -                                        apr_status_t& outSerfStatus )
> -{
> -    mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(),
> -                                rtl::OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
> -    char * Timeout;
> -    if(inLock.Timeout == -1)
> -        Timeout = apr_psprintf( mrSerfSession.getAprPool(), "Infinite" );
> -    else
> -        Timeout = apr_psprintf( mrSerfSession.getAprPool(), "Second-%ld", inLock.Timeout );
> -
> -    char * inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
> -                                 rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
> -
> -    mpProcImpl = createLockRefreshProcImpl( mPathStr,
> -                                            mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                            inLock,
> -                                            inLockToken,
> -                                            Timeout,
> -                                            outLock);
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -//ULOCK unlock an existing lock
> -bool SerfRequestProcessor::processUnlock( const rtl::OUString & inDestinationPath,
> -                                        const com::sun::star::ucb::Lock& inLock,
> -                                        apr_status_t& outSerfStatus )
> -{
> -    mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(),
> -                                rtl::OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
> -
> -    char * aToken = apr_psprintf( mrSerfSession.getAprPool(), "<%s>",
> -                                 rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
> -
> -    mpProcImpl = createUnlockProcImpl( mPathStr,
> -                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
> -                                       inLock,
> -                                       aToken );
> -
> -    outSerfStatus = runProcessor();
> -
> -    return outSerfStatus == APR_SUCCESS;
> -}
> -
> -apr_status_t SerfRequestProcessor::runProcessor()
> -{
> -    prepareProcessor();
> -
> -    // activate chunked encoding, if requested
> -    if ( mbUseChunkedEncoding )
> -    {
> -        mpProcImpl->activateChunkedEncoding();
> -    }
> -
> -    // create serf request
> -    OSL_ASSERT(mrSerfSession.getSerfConnection() != NULL);
> -    serf_connection_request_create( mrSerfSession.getSerfConnection(),
> -                                    Serf_SetupRequest,
> -                                    this );
> -
> -    // perform serf request
> -    mbProcessingDone = false;
> -    apr_status_t status = APR_SUCCESS;
> -    serf_context_t* pSerfContext = mrSerfSession.getSerfContext();
> -    apr_pool_t* pAprPool = mrSerfSession.getAprPool();
> -    while ( true )
> -    {
> -        status = serf_context_run( pSerfContext,
> -                                   SERF_DURATION_FOREVER,
> -                                   pAprPool );
> -        if ( APR_STATUS_IS_TIMEUP( status ) )
> -        {
> -            continue;
> -        }
> -        if ( status != APR_SUCCESS )
> -        {
> -#if OSL_DEBUG_LEVEL > 0
> -            char buff[512];
> -            OSL_TRACE("SerfRequestProcessor::runProcessor, status != APR_SUCCESS: %d (%s)",status, apr_strerror(status, buff, 512));
> -#endif
> -            break;
> -        }
> -        if ( mbProcessingDone )
> -        {
> -            break;
> -        }
> -    }
> -
> -    postprocessProcessor( status );
> -
> -    return status;
> -}
> -
> -void SerfRequestProcessor::postprocessProcessor( const apr_status_t inStatus )
> -{
> -    if ( inStatus == APR_SUCCESS )
> -    {
> -        return;
> -    }
> -
> -    OSL_TRACE("SerfRequestProcessor::postprocessProcessor:%d",__LINE__);
> -    switch ( inStatus )
> -    {
> -    case APR_EGENERAL:
> -    case SERF_ERROR_AUTHN_FAILED:
> -        // general error; <mnHTTPStatusCode> provides more information
> -        {
> -            switch ( mnHTTPStatusCode )
> -            {
> -            case SC_NONE:
> -                if ( !mbSetupSerfRequestCalled )
> -                {
> -                    mpDAVException = new DAVException( DAVException::DAV_HTTP_LOOKUP,
> -                                                       SerfUri::makeConnectionEndPointString( mrSerfSession.getHostName(),
> -                                                                                              mrSerfSession.getPort() ) );
> -                }
> -                else if ( mbInputOfCredentialsAborted )
> -                {
> -                    mpDAVException = new DAVException( DAVException::DAV_HTTP_NOAUTH,
> -                                                       SerfUri::makeConnectionEndPointString( mrSerfSession.getHostName(),
> -                                                                                              mrSerfSession.getPort() ) );
> -                }
> -                else
> -                {
> -                    mpDAVException = new DAVException( DAVException::DAV_HTTP_ERROR,
> -                                                       mHTTPStatusCodeText,
> -                                                       mnHTTPStatusCode );
> -                }
> -                break;
> -            case SC_MOVED_PERMANENTLY:
> -            case SC_MOVED_TEMPORARILY:
> -            case SC_SEE_OTHER:
> -            case SC_TEMPORARY_REDIRECT:
> -                mpDAVException = new DAVException( DAVException::DAV_HTTP_REDIRECT,
> -                                                   mRedirectLocation );
> -                break;
> -            case SC_LOCKED:
> -                mpDAVException = new DAVException( DAVException::DAV_LOCKED,
> -                                                   mHTTPStatusCodeText,
> -                                                   mnHTTPStatusCode );
> -                break;
> -            default:
> -                mpDAVException = new DAVException( DAVException::DAV_HTTP_ERROR,
> -                                                   mHTTPStatusCodeText,
> -                                                   mnHTTPStatusCode );
> -                break;
> -            }
> -        }
> -        break;
> -
> -    default:
> -        mpDAVException = new DAVException( DAVException::DAV_HTTP_ERROR );
> -        break;
> -    }
> -}
> -
> -apr_status_t SerfRequestProcessor::provideSerfCredentials( char ** outUsername,
> -                                                           char ** outPassword,
> -                                                           serf_request_t * inRequest,
> -                                                           int inCode,
> -                                                           const char *inAuthProtocol,
> -                                                           const char *inRealm,
> -                                                           apr_pool_t *inAprPool )
> -{
> -    // as each successful provided credentials are tried twice - see below - the
> -    // number of real attempts is half of the value of <mnSuccessfulCredentialAttempts>
> -    if ( (mnSuccessfulCredentialAttempts / 2) >= 5 ||
> -         mbInputOfCredentialsAborted )
> -    {
> -        mbInputOfCredentialsAborted = true;
> -        return SERF_ERROR_AUTHN_FAILED;
> -    }
> -
> -    // because serf keeps credentials only for a connection in case of digest authentication
> -    // we give each successful provided credentials a second try in order to workaround the
> -    // situation that the connection for which the credentials have been provided has been closed
> -    // before the provided credentials could be applied for the request.
> -    apr_status_t status = mrSerfSession.provideSerfCredentials( (mnSuccessfulCredentialAttempts % 2) == 1,
> -                                                                outUsername,
> -                                                                outPassword,
> -                                                                inRequest,
> -                                                                inCode,
> -                                                                inAuthProtocol,
> -                                                                inRealm,
> -                                                                inAprPool );
> -    if ( status != APR_SUCCESS )
> -    {
> -        mbInputOfCredentialsAborted = true;
> -    }
> -    else
> -    {
> -        ++mnSuccessfulCredentialAttempts;
> -    }
> -
> -    return status;
> -}
> -
> -apr_status_t SerfRequestProcessor::setupSerfRequest( serf_request_t * inSerfRequest,
> -                                   serf_bucket_t ** outSerfRequestBucket,
> -                                   serf_response_acceptor_t * outSerfResponseAcceptor,
> -                                   void ** outSerfResponseAcceptorBaton,
> -                                   serf_response_handler_t * outSerfResponseHandler,
> -                                   void ** outSerfResponseHandlerBaton,
> -                                   apr_pool_t * /*inAprPool*/ )
> -{
> -    mbSetupSerfRequestCalled = true;
> -    *outSerfRequestBucket = mpProcImpl->createSerfRequestBucket( inSerfRequest );
> -
> -    // apply callbacks for accepting response and handling response
> -    *outSerfResponseAcceptor = Serf_AcceptResponse;
> -    *outSerfResponseAcceptorBaton = this;
> -    *outSerfResponseHandler = Serf_HandleResponse;
> -    *outSerfResponseHandlerBaton = this;
> -
> -    return APR_SUCCESS;
> -}
> -
> -serf_bucket_t* SerfRequestProcessor::acceptSerfResponse( serf_request_t * inSerfRequest,
> -                                                         serf_bucket_t * inSerfStreamBucket,
> -                                                         apr_pool_t * inAprPool )
> -{
> -    mbAcceptSerfResponseCalled = true;
> -    return mrSerfSession.acceptSerfResponse( inSerfRequest,
> -                                             inSerfStreamBucket,
> -                                             inAprPool );
> -}
> -
> -apr_status_t SerfRequestProcessor::handleSerfResponse( serf_request_t * inSerfRequest,
> -                                                       serf_bucket_t * inSerfResponseBucket,
> -                                                       apr_pool_t * inAprPool )
> -{
> -    mbHandleSerfResponseCalled = true;
> -
> -    // some general response handling and error handling
> -    {
> -        if ( !inSerfResponseBucket )
> -        {
> -            /* A NULL response can come back if the request failed completely */
> -            mbProcessingDone = true;
> -            return APR_EGENERAL;
> -        }
> -
> -        serf_status_line sl;
> -        apr_status_t status = serf_bucket_response_status( inSerfResponseBucket, &sl );
> -        if ( status )
> -        {
> -            mbProcessingDone = false; // allow another try in order to get a response
> -            return status;
> -        }
> -        serf_bucket_t *headers = serf_bucket_response_get_headers( inSerfResponseBucket );
> -
> -        // check header according:
> -        // http://tools.ietf.org/html/rfc7231#section-7.4.2
> -        // need to do this so we can adjust the protocol accordingly
> -        // serf_bucket_headers_get is case independent
> -        const char* server = serf_bucket_headers_get( headers, "server" );
> -        if( server )
> -        {
> -            //update the server type on session
> -            mrSerfSession.setServerHeaderField( ::rtl::OUString::createFromAscii( server ) );
> -        }
> -        //the following extension is MS IIS specific,
> -        //see https://msdn.microsoft.com/en-us/library/cc250064.aspx
> -        //site last checked on 2015-03-02
> -        //TODO i126305 need to be added when serf is updated to a version supporting Windows authentication
> -        //const char* msDavExtErr = serf_bucket_headers_get( headers, "X-MSDAVEXT_ERROR" );
> -
> -        // TODO - check, if response status code handling is correct
> -        mnHTTPStatusCode = ( sl.version != 0 && sl.code >= 0 )
> -                           ? static_cast< sal_uInt16 >( sl.code )
> -                           : SC_NONE;
> -        if ( sl.reason )
> -        {
> -            mHTTPStatusCodeText = ::rtl::OUString::createFromAscii( sl.reason );
> -        }
> -        if ( ( sl.version == 0 || sl.code < 0 ) ||
> -             mnHTTPStatusCode >= 300 )
> -        {
> -            if ( mnHTTPStatusCode == 301 ||
> -                 mnHTTPStatusCode == 302 ||
> -                 mnHTTPStatusCode == 303 ||
> -                 mnHTTPStatusCode == 307 )
> -            {
> -                // new location for certain redirections
> -                const char* location = serf_bucket_headers_get( headers, "Location" );
> -                if ( location )
> -                {
> -                    mRedirectLocation = rtl::OUString::createFromAscii( location );
> -                }
> -                mbProcessingDone = true;
> -                return APR_EGENERAL;
> -            }
> -            else if ( mrSerfSession.isHeadRequestInProgress() &&
> -                      ( mnHTTPStatusCode == 401 || mnHTTPStatusCode == 407 ) )
> -            {
> -                // keep going as authentication is not required on HEAD request.
> -                // the response already contains header fields.
> -            }
> -            else
> -            {
> -                mbProcessingDone = true;
> -                return APR_EGENERAL;
> -            }
> -        }
> -    }
> -
> -    // request specific processing of the response bucket
> -    apr_status_t status = APR_SUCCESS;
> -    mbProcessingDone = mpProcImpl->processSerfResponseBucket( inSerfRequest,
> -                                                              inSerfResponseBucket,
> -                                                              inAprPool,
> -                                                              status );
> -
> -    return status;
> -}
> -
> -} // namespace http_dav_ucp
> -
> diff --git a/main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx b/main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
> deleted file mode 100644
> index 36d63f0025..0000000000
> --- a/main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
> +++ /dev/null
> @@ -1,208 +0,0 @@
> -/**************************************************************
> - * 
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership.  The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License.  You may obtain a copy of the License at
> - * 
> - *   http://www.apache.org/licenses/LICENSE-2.0
> - * 
> - * Unless required by applicable law or agreed to in writing,
> - * software distributed under the License is distributed on an
> - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> - * KIND, either express or implied.  See the License for the
> - * specific language governing permissions and limitations
> - * under the License.
> - * 
> - *************************************************************/
> -
> -
> -#ifndef INCLUDED_SERFREQUESTPROCESSOR_HXX
> -#define INCLUDED_SERFREQUESTPROCESSOR_HXX
> -
> -#include <apr_errno.h>
> -#include <apr_pools.h>
> -
> -#include <serf.h>
> -
> -#include "DAVTypes.hxx"
> -#include "DAVResource.hxx"
> -#include "DAVException.hxx"
> -
> -#include "SerfTypes.hxx"
> -#include "SerfInputStream.hxx"
> -#include <com/sun/star/io/XOutputStream.hpp>
> -
> -namespace http_dav_ucp
> -{
> -
> -class SerfSession;
> -class SerfRequestProcessorImpl;
> -
> -class SerfRequestProcessor
> -{
> -public:
> -    SerfRequestProcessor( SerfSession& rSerfSession,
> -                          const rtl::OUString & inPath,
> -                          const bool bUseChunkedEncoding );
> -    ~SerfRequestProcessor();
> -
> -    // PROPFIND - allprop & named
> -    bool processPropFind( const Depth inDepth,
> -                          const std::vector< ::rtl::OUString > & inPropNames,
> -                          std::vector< DAVResource > & ioResources,
> -                          apr_status_t& outSerfStatus );
> -
> -    // PROPFIND - property names
> -    bool processPropFind( const Depth inDepth,
> -                          std::vector< DAVResourceInfo > & ioResInfo,
> -                          apr_status_t& outSerfStatus );
> -
> -    // PROPPATCH
> -    bool processPropPatch( const std::vector< ProppatchValue > & inProperties,
> -                           const com::sun::star::ucb::Lock  inLock,
> -                           apr_status_t& outSerfStatus );
> -
> -    // GET
> -    bool processGet( const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm, 
> -                     apr_status_t& outSerfStatus );
> -
> -    // GET inclusive header fields
> -    bool processGet( const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm, 
> -                     const std::vector< ::rtl::OUString > & inHeaderNames,
> -                     DAVResource & ioResource,
> -                     apr_status_t& outSerfStatus );
> -
> -    // GET
> -    bool processGet( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm,
> -                     apr_status_t& outSerfStatus );
> -
> -    // GET inclusive header fields
> -    bool processGet( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm,
> -                     const std::vector< ::rtl::OUString > & inHeaderNames,
> -                     DAVResource & ioResource,
> -                     apr_status_t& outSerfStatus );
> -
> -    // HEAD
> -    bool processHead( const std::vector< ::rtl::OUString > & inHeaderNames,
> -                      DAVResource & ioResource,
> -                      apr_status_t& outSerfStatus );
> -
> -    // PUT
> -    bool processPut( const char* inData,
> -                     apr_size_t inDataLen,
> -                     const com::sun::star::ucb::Lock  inLock,
> -                     apr_status_t& outSerfStatus );
> -
> -    // POST
> -    bool processPost( const char* inData,
> -                      apr_size_t inDataLen,
> -                      const rtl::OUString & inContentType,
> -                      const rtl::OUString & inReferer,
> -                      const com::sun::star::ucb::Lock  inLock,
> -                      const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm,
> -                      apr_status_t& outSerfStatus );
> -
> -    // POST
> -    bool processPost( const char* inData,
> -                      apr_size_t inDataLen,
> -                      const rtl::OUString & inContentType,
> -                      const rtl::OUString & inReferer,
> -                      const com::sun::star::ucb::Lock  inLock,
> -                      const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm,
> -                      apr_status_t& outSerfStatus );
> -
> -    // DELETE
> -    bool processDelete( const com::sun::star::ucb::Lock inLock,
> -                        apr_status_t& outSerfStatus );
> -
> -    // MKCOL
> -    bool processMkCol( const com::sun::star::ucb::Lock inLock,
> -                       apr_status_t& outSerfStatus );
> -
> -    // COPY
> -    bool processCopy( const rtl::OUString & inDestinationPath,
> -                      const bool inOverwrite,
> -                      const com::sun::star::ucb::Lock inLock,
> -                      apr_status_t& outSerfStatus );
> -
> -    // MOVE
> -    bool processMove( const rtl::OUString & inDestinationPath,
> -                      const bool inOverwrite,
> -                      const com::sun::star::ucb::Lock inLock,
> -                      apr_status_t& outSerfStatus );
> -
> -    // LOCK
> -    bool processLock( const rtl::OUString & inDestinationPath,
> ... 2846 lines suppressed ...
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


(openoffice) 01/12: Port our WebDAV content provider from serf/apr/apr-util, to curl.

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 9646dec509b481cb88dbe1130c2f325ed13af748
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Mon Apr 4 03:06:47 2022 +0200

    Port our WebDAV content provider from serf/apr/apr-util, to curl.
    
    Patch by: me
    
    (adapted from commit 51ba086bf122dbb5b50fd813e5b9a81c051aa16b by Arrigo
    Marchiori)
---
 ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch |   13 -
 ext_libraries/apr-util/apr-util-1.6.1.expat.patch  |   17 -
 .../apr-util/apr-util-1.6.1.makewin32.patch        |  199 --
 ext_libraries/apr-util/aprutil_version.mk          |   24 -
 ext_libraries/apr-util/makefile.mk                 |  139 --
 ext_libraries/apr-util/prj/build.lst               |    5 -
 ext_libraries/apr-util/prj/d.lst                   |   15 -
 ext_libraries/apr/apr-1.6.5-no-devenv.patch        |   16 -
 ext_libraries/apr/apr-1.6.5-windows.patch          |   11 -
 ext_libraries/apr/apr_version.mk                   |   24 -
 ext_libraries/apr/makefile.mk                      |  128 --
 ext_libraries/apr/prj/build.lst                    |    3 -
 ext_libraries/apr/prj/d.lst                        |   24 -
 ext_libraries/serf/NULbytes.patch                  |  313 ----
 ext_libraries/serf/makefile.mk                     |  134 --
 ext_libraries/serf/prj/build.lst                   |    3 -
 ext_libraries/serf/prj/d.lst                       |   12 -
 ext_libraries/serf/serf-1.2.1.ldl.patch            |   11 -
 ext_libraries/serf/serf-1.2.1.libs.patch           |   11 -
 ext_libraries/serf/serf-1.2.1.logging.patch        |   27 -
 ext_libraries/serf/serf_version.mk                 |   24 -
 ext_libraries/serf/win/Library_serf.mk             |   89 -
 ext_libraries/serf/win/Makefile                    |   30 -
 ext_libraries/serf/win/Module_serf.mk              |   27 -
 ext_libraries/serf/win/Package_inc.mk              |   27 -
 main/NOTICE                                        |    6 -
 main/RepositoryExternal.mk                         |  106 --
 main/configure.ac                                  |   82 +-
 main/curl/curl-wnt.patch                           |   38 +
 main/curl/makefile.mk                              |   18 +-
 main/curl/prj/build.lst                            |    2 +-
 main/external_deps.lst                             |   18 -
 main/scp2/prj/build.lst                            |    2 +-
 main/scp2/source/ooo/file_library_ooo.scp          |   61 -
 main/scp2/source/ooo/makefile.mk                   |   23 -
 main/scp2/source/ooo/shortcut_ooo.scp              |   47 -
 main/set_soenv.in                                  |    9 -
 main/ucb/Library_ucpdav1.mk                        |   34 +-
 main/ucb/prj/build.lst                             |    2 +-
 main/ucb/source/ucp/webdav/ContentProperties.cxx   |    4 +-
 .../{SerfInputStream.cxx => CurlInputStream.cxx}   |   40 +-
 .../{SerfInputStream.hxx => CurlInputStream.hxx}   |   15 +-
 .../{SerfLockStore.cxx => CurlLockStore.cxx}       |   50 +-
 .../{SerfLockStore.hxx => CurlLockStore.hxx}       |   38 +-
 main/ucb/source/ucp/webdav/CurlRequest.cxx         |  391 ++++
 main/ucb/source/ucp/webdav/CurlRequest.hxx         |  130 ++
 main/ucb/source/ucp/webdav/CurlSession.cxx         | 1959 ++++++++++++++++++++
 .../webdav/{SerfSession.hxx => CurlSession.hxx}    |  144 +-
 .../ucp/webdav/{SerfTypes.hxx => CurlTypes.hxx}    |   15 +-
 .../source/ucp/webdav/{SerfUri.cxx => CurlUri.cxx} |  174 +-
 .../source/ucp/webdav/{SerfUri.hxx => CurlUri.hxx} |   42 +-
 main/ucb/source/ucp/webdav/DAVProperties.cxx       |    6 +-
 main/ucb/source/ucp/webdav/DAVProperties.hxx       |    8 +-
 main/ucb/source/ucp/webdav/DAVResourceAccess.cxx   |   12 +-
 main/ucb/source/ucp/webdav/DAVResourceAccess.hxx   |    4 +-
 main/ucb/source/ucp/webdav/DAVSessionFactory.cxx   |   12 +-
 main/ucb/source/ucp/webdav/LockRequest.cxx         |   61 +
 .../ucp/webdav/{AprEnv.cxx => LockRequest.hxx}     |   42 +-
 main/ucb/source/ucp/webdav/PropfindRequest.cxx     |   81 +
 ...erfMkColReqProcImpl.hxx => PropfindRequest.hxx} |   43 +-
 main/ucb/source/ucp/webdav/ProppatchRequest.cxx    |  126 ++
 .../webdav/{AprEnv.hxx => ProppatchRequest.hxx}    |   35 +-
 main/ucb/source/ucp/webdav/SerfCallbacks.cxx       |  121 --
 main/ucb/source/ucp/webdav/SerfCallbacks.hxx       |   69 -
 main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx |   91 -
 main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx |   59 -
 .../source/ucp/webdav/SerfDeleteReqProcImpl.cxx    |   77 -
 .../source/ucp/webdav/SerfDeleteReqProcImpl.hxx    |   55 -
 main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx  |  187 --
 main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx  |   84 -
 main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx |  141 --
 main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx |   67 -
 .../source/ucp/webdav/SerfLockRefreshProcImpl.cxx  |   80 -
 .../source/ucp/webdav/SerfLockRefreshProcImpl.hxx  |   51 -
 main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx |  155 --
 main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx |   74 -
 .../ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx |   72 -
 main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx |   91 -
 main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx |   59 -
 main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx |  136 --
 main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx |   79 -
 .../source/ucp/webdav/SerfPropFindReqProcImpl.cxx  |  202 --
 .../source/ucp/webdav/SerfPropFindReqProcImpl.hxx  |   77 -
 .../source/ucp/webdav/SerfPropPatchReqProcImpl.cxx |  200 --
 .../source/ucp/webdav/SerfPropPatchReqProcImpl.hxx |   60 -
 main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx  |   93 -
 main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx  |   61 -
 .../ucb/source/ucp/webdav/SerfRequestProcessor.cxx |  721 -------
 .../ucb/source/ucp/webdav/SerfRequestProcessor.hxx |  208 ---
 .../source/ucp/webdav/SerfRequestProcessorImpl.cxx |  164 --
 .../source/ucp/webdav/SerfRequestProcessorImpl.hxx |   79 -
 .../ucp/webdav/SerfRequestProcessorImplFac.cxx     |  286 ---
 .../ucp/webdav/SerfRequestProcessorImplFac.hxx     |  142 --
 main/ucb/source/ucp/webdav/SerfSession.cxx         | 1708 -----------------
 main/ucb/source/ucp/webdav/SerfUnlockProcImpl.cxx  |   92 -
 main/ucb/source/ucp/webdav/SerfUnlockProcImpl.hxx  |   69 -
 main/ucb/source/ucp/webdav/webdavcontent.cxx       |   26 +-
 main/ucb/source/ucp/webdav/webdavdatasupplier.cxx  |   10 +-
 main/ucb/source/ucp/webdav/webdavprovider.cxx      |   21 +-
 99 files changed, 3201 insertions(+), 7972 deletions(-)

diff --git a/ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch b/ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch
deleted file mode 100644
index bdd636214b..0000000000
--- a/ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- misc/apr-util-1.6.1/include/apu.hw	2008-11-21 07:18:37.000000000 +0100
-+++ misc/build/apr-util-1.6.1/include/apu.hw	2012-01-03 13:37:20.042007300 +0100
-@@ -132,8 +132,8 @@
- #define APU_HAVE_NSS            0
- #endif
- 
--#define APU_HAVE_APR_ICONV      1
--#define APU_HAVE_ICONV          0
-+#undef APU_HAVE_APR_ICONV
-+#undef APU_HAVE_ICONV
- #define APR_HAS_XLATE           (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
- 
- #endif /* APU_H */
diff --git a/ext_libraries/apr-util/apr-util-1.6.1.expat.patch b/ext_libraries/apr-util/apr-util-1.6.1.expat.patch
deleted file mode 100644
index 3a84a6a3a6..0000000000
--- a/ext_libraries/apr-util/apr-util-1.6.1.expat.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- misc/apr-util-1.6.1/build/apu-conf.m4	2011-08-08 06:32:27.000000000 -0300
-+++ misc/build/apr-util-1.6.1/build/apu-conf.m4	2013-06-12 20:09:05.877947541 -0300
-@@ -87,8 +87,14 @@ dnl be dropped later.
- dnl
- AC_DEFUN([APU_SYSTEM_EXPAT], [
-  
-+  APU_TRY_EXPAT_LINK([OpenOffice expat], apu_cv_expat_openoffice,
-+     [expat.h], [-L"$SOLARLIBDIR" -lexpat_xmlparse -lexpat_xmltok],
-+     [APR_ADDTO(APRUTIL_INCLUDES, [-I"$SOLARINCDIR"/external])] )
-+
-+  if test $apu_has_expat = 0; then
-   APU_TRY_EXPAT_LINK([Expat 1.95.x], apu_cv_expat_system, 
-     [expat.h], [-lexpat])
-+  fi
- 
-   if test $apu_has_expat = 0; then
-     APU_TRY_EXPAT_LINK([old Debian-packaged expat], apu_cv_expat_debian,
diff --git a/ext_libraries/apr-util/apr-util-1.6.1.makewin32.patch b/ext_libraries/apr-util/apr-util-1.6.1.makewin32.patch
deleted file mode 100644
index f986fde96d..0000000000
--- a/ext_libraries/apr-util/apr-util-1.6.1.makewin32.patch
+++ /dev/null
@@ -1,199 +0,0 @@
---- misc/apr-util-1.6.1/Library_apr-util.mk	2012-01-05 14:49:40.529219100 +0100
-+++ misc/build/apr-util-1.6.1/Library_apr-util.mk	2012-01-05 14:47:18.621102400 +0100
-@@ -1 +1,89 @@
--dummy
-+#/**************************************************************
-+# * 
-+# * Licensed to the Apache Software Foundation (ASF) under one
-+# * or more contributor license agreements.  See the NOTICE file
-+# * distributed with this work for additional information
-+# * regarding copyright ownership.  The ASF licenses this file
-+# * to you under the Apache License, Version 2.0 (the
-+# * "License"); you may not use this file except in compliance
-+# * with the License.  You may obtain a copy of the License at
-+# * 
-+# *   http://www.apache.org/licenses/LICENSE-2.0
-+# * 
-+# * Unless required by applicable law or agreed to in writing,
-+# * software distributed under the License is distributed on an
-+# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-+# * KIND, either express or implied.  See the License for the
-+# * specific language governing permissions and limitations
-+# * under the License.
-+# * 
-+# *************************************************************/
-+
-+$(eval $(call gb_Library_Library,apr-util))
-+
-+$(eval $(call gb_Library_add_package_headers,apr-util,apr-util_inc))
-+
-+$(eval $(call gb_Library_set_include,apr-util,\
-+	$$(INCLUDE) \
-+	-I./include \
-+	-I./include/private \
-+	-I$(OUTDIR)/inc/apr \
-+))
-+
-+$(eval $(call gb_Library_add_defs,apr-util,\
-+	-DAPU_DECLARE_EXPORT -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DWIN32_EXPORTS \
-+))
-+
-+$(eval $(call gb_Library_add_linked_libs,apr-util,\
-+	apr \
-+	expat_xmltok \
-+	expat_xmlparse \
-+    $(gb_STDLIBS) \
-+))
-+
-+$(eval $(call gb_Library_add_cobjects,apr-util,\
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_brigade \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_alloc \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_eos \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_file \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_flush \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_heap \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_mmap \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_pipe \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_pool \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_refcount \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_simple \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/buckets/apr_buckets_socket \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/apr_crypto \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/apr_md4 \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/apr_md5 \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/apr_sha1 \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/getuuid \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/crypto/uuid \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbd/apr_dbd \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/apr_dbm \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/apr_dbm_sdbm \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/sdbm/sdbm \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/sdbm/sdbm_hash \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/sdbm/sdbm_lock \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/dbm/sdbm/sdbm_pair \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/encoding/apr_base64 \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/hooks/apr_hooks \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/ldap/apr_ldap_stub \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/ldap/apr_ldap_url \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/memcache/apr_memcache \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apr_date \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apr_queue \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apr_reslist \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apr_rmm \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apr_thread_pool \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apu_dso \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/misc/apu_version \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/strmatch/apr_strmatch \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/uri/apr_uri \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/xlate/xlate \
-+	apr-util/$(INPATH)/misc/build/apr-util-1.6.1/xml/apr_xml \
-+))
-+
-+# vim: set noet sw=4 ts=4:
---- misc/apr-util-1.6.1/Makefile	2012-01-05 14:49:40.420212900 +0100
-+++ misc/build/apr-util-1.6.1/Makefile	2012-01-05 14:47:07.827485100 +0100
-@@ -1 +1,32 @@
--dummy
-+#/**************************************************************
-+# * 
-+# * Licensed to the Apache Software Foundation (ASF) under one
-+# * or more contributor license agreements.  See the NOTICE file
-+# * distributed with this work for additional information
-+# * regarding copyright ownership.  The ASF licenses this file
-+# * to you under the Apache License, Version 2.0 (the
-+# * "License"); you may not use this file except in compliance
-+# * with the License.  You may obtain a copy of the License at
-+# * 
-+# *   http://www.apache.org/licenses/LICENSE-2.0
-+# * 
-+# * Unless required by applicable law or agreed to in writing,
-+# * software distributed under the License is distributed on an
-+# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-+# * KIND, either express or implied.  See the License for the
-+# * specific language governing permissions and limitations
-+# * under the License.
-+# * 
-+# *************************************************************/
-+
-+ifeq ($(strip $(SOLARENV)),)
-+$(error No environment set!)
-+endif
-+
-+gb_PARTIALBUILD := T
-+GBUILDDIR := $(SOLARENV)/gbuild
-+include $(GBUILDDIR)/gbuild.mk
-+
-+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
-+
-+# vim: set noet sw=4 ts=4:
---- misc/apr-util-1.6.1/Module_apr-util.mk	2012-01-05 14:49:40.476216100 +0100
-+++ misc/build/apr-util-1.6.1/Module_apr-util.mk	2012-01-05 14:47:42.567472100 +0100
-@@ -1 +1,29 @@
--dummy
-+#/**************************************************************
-+# * 
-+# * Licensed to the Apache Software Foundation (ASF) under one
-+# * or more contributor license agreements.  See the NOTICE file
-+# * distributed with this work for additional information
-+# * regarding copyright ownership.  The ASF licenses this file
-+# * to you under the Apache License, Version 2.0 (the
-+# * "License"); you may not use this file except in compliance
-+# * with the License.  You may obtain a copy of the License at
-+# * 
-+# *   http://www.apache.org/licenses/LICENSE-2.0
-+# * 
-+# * Unless required by applicable law or agreed to in writing,
-+# * software distributed under the License is distributed on an
-+# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-+# * KIND, either express or implied.  See the License for the
-+# * specific language governing permissions and limitations
-+# * under the License.
-+# * 
-+# *************************************************************/
-+
-+$(eval $(call gb_Module_Module,apr-util))
-+
-+$(eval $(call gb_Module_add_targets,apr-util,\
-+	Library_apr-util \
-+	Package_inc \
-+))
-+
-+# vim: set noet ts=4 sw=4:
---- misc/apr-util-1.6.1/Package_inc.mk	2012-01-05 14:49:40.585222300 +0100
-+++ misc/build/apr-util-1.6.1/Package_inc.mk	2012-01-05 14:47:51.616989700 +0100
-@@ -1 +1,33 @@
--dummy
-+#/**************************************************************
-+# * 
-+# * Licensed to the Apache Software Foundation (ASF) under one
-+# * or more contributor license agreements.  See the NOTICE file
-+# * distributed with this work for additional information
-+# * regarding copyright ownership.  The ASF licenses this file
-+# * to you under the Apache License, Version 2.0 (the
-+# * "License"); you may not use this file except in compliance
-+# * with the License.  You may obtain a copy of the License at
-+# * 
-+# *   http://www.apache.org/licenses/LICENSE-2.0
-+# * 
-+# * Unless required by applicable law or agreed to in writing,
-+# * software distributed under the License is distributed on an
-+# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-+# * KIND, either express or implied.  See the License for the
-+# * specific language governing permissions and limitations
-+# * under the License.
-+# * 
-+# *************************************************************/
-+
-+$(eval $(call gb_Package_Package,apr-util_inc,$(EXT_LIBRARIES)/apr-util/$(INPATH)/misc/build/apr-util-1.6.1/include))
-+$(eval $(call gb_Package_add_files, apr-util_inc, inc/apr-util,        \
-+       apu.h                                                           \
-+       apu_version.h                                                   \
-+       apr_uri.h                                                       \
-+       apr_date.h                                                      \
-+       apr_uuid.h                                                      \
-+       apr_md5.h                                                       \
-+       apr_xlate.h                                                     \
-+       apr_base64.h                                                    \
-+))
-+
diff --git a/ext_libraries/apr-util/aprutil_version.mk b/ext_libraries/apr-util/aprutil_version.mk
deleted file mode 100644
index 6a4eabb335..0000000000
--- a/ext_libraries/apr-util/aprutil_version.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-#**************************************************************
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-#**************************************************************
-
-APR_UTIL_MAJOR=1
-APR_UTIL_MINOR=6
-APR_UTIL_MICRO=1
diff --git a/ext_libraries/apr-util/makefile.mk b/ext_libraries/apr-util/makefile.mk
deleted file mode 100644
index c2ba7b5324..0000000000
--- a/ext_libraries/apr-util/makefile.mk
+++ /dev/null
@@ -1,139 +0,0 @@
-#**************************************************************
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-#**************************************************************
-
-PRJ=.
-
-PRJNAME=apr-util
-TARGET=aprutil
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE :	settings.mk
-.INCLUDE :	aprutil_version.mk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(SYSTEM_APR_UTIL)"=="YES"
-
-all:
-	@echo "Using system apr-util.  Does not have to be built."
-
-.ELSE
-
-# Assemble the full version number from the parts defined in aprutil_version.mk
-APR_UTIL_VERSION=$(APR_UTIL_MAJOR).$(APR_UTIL_MINOR).$(APR_UTIL_MICRO)
-
-
-TARFILE_NAME=$(PRJNAME)-$(APR_UTIL_VERSION)
-TARFILE_MD5=bd502b9a8670a8012c4d90c31a84955f
-
-.IF "$(OS)"=="WNT"
-
-ADDITIONAL_FILES=Makefile Module_apr-util.mk Library_apr-util.mk Package_inc.mk
-
-PATCH_FILES= \
-    $(TARFILE_NAME).apu.hw.patch \
-    $(TARFILE_NAME).makewin32.patch
-
-CONFIGURE_DIR=
-CONFIGURE_ACTION=cp include/apu.hw include/apu.h;							\
-	cp include/apr_ldap.hw include/apr_ldap.h;								\
-	cp include/private/apu_config.hw include/private/apu_config.h;			\
-	cp include/private/apu_select_dbm.hw include/private/apu_select_dbm.h
-CONFIGURE_FLAGS=
-
-BUILD_DIR=$(CONFIGURE_DIR)
-BUILD_ACTION=$(GNUMAKE)
-#BUILD_FLAGS+= -j$(EXTMAXPROCESS)
-
-.ELIF "$(GUI)" == "OS2"
-
-@all:
-	@echo "using system apr-util. nothing do do."
-
-
-.ELSE
-
-
-
-CONFIGURE_DIR=
-CONFIGURE_ACTION=autoconf && .$/configure
-CONFIGURE_FLAGS=								\
-	--with-apr=$(OUTDIR)/bin/apr-1-config		\
-	--prefix=$(OUTDIR)							\
-	--includedir=$(OUTDIR)$/inc$/apr-util		\
-	--with-iconv="no"				
-
-
-# Use our own expat on the Mac.  Maybe we should do this on Linux, too? Yes!
-.IF "$(OS)" == "MACOSX" || ("$(OS)" == "LINUX" && "$(SYSTEM_EXPAT)"!="YES")
-
-# Recent versions of clang on macOS break some tests in APR 1.6 (and older)
-# configure (mostly around testing sizeof) due to errors now being fatal.
-# Work around this by ignoring all errors
-.IF "$(OS)"=="MACOSX"
-XCPPFLAGS=-Wno-error=all
-.ENDIF
-
-expat_CPPFLAGS=-I$(SOLARINCDIR)$/external
-expat_LDFLAGS+=-L$(SOLARLIBDIR)
-XCPPFLAGS+=$(expat_CPPFLAGS)
-CONFIGURE_FLAGS+= SOLARINCDIR=$(SOLARINCDIR) SOLARLIBDIR=$(SOLARLIBDIR) \
-	CPPFLAGS="$(XCPPFLAGS)" LDFLAGS=$(expat_LDFLAGS)
-
-# The non-standard names of our expat libraries (yes, plural) make 
-# a special handling in apr-utils configure necessary.
-PATCH_FILES+= $(TARFILE_NAME).expat.patch
-
-.ENDIF
-
-
-BUILD_DIR=$(CONFIGURE_DIR)
-BUILD_ACTION=$(GNUMAKE)
-BUILD_FLAGS+= -j$(EXTMAXPROCESS)
-
-# Make apu-1-config believe that apr-util has been installed.
-INSTALL_ACTION=if [ -f apu-1-config.orig ]; then mv -f apu-1-config.orig apu-1-config; fi;	\
-	cp apu-1-config apu-1-config.orig;							\
-	sed -e "s/^location=source/location=installed/;s/^\(installbuilddir=.*\)\/.*/\\1\/lib\/apr-util\"/" apu-1-config > apu-1-config.installed;								\
-	mv -f apu-1-config.installed apu-1-config;	\
-	chmod +x apu-1-config
-
-OUT2INC+=include$/apr*.h
-OUT2INC+=include$/apu*.h
-OUT2INC_SUBDIR=apr-util
-
-.IF "$(OS)"=="MACOSX"
-OUT2LIB+=.libs/libaprutil-1.*dylib
-.ELSE
-OUT2LIB=.libs/libaprutil-1.so*
-.ENDIF
-OUT2BIN=apu-1-config
-
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : set_ext.mk
-.INCLUDE : target.mk
-.INCLUDE : tg_ext.mk
-
-.ENDIF
diff --git a/ext_libraries/apr-util/prj/build.lst b/ext_libraries/apr-util/prj/build.lst
deleted file mode 100644
index d205e1992e..0000000000
--- a/ext_libraries/apr-util/prj/build.lst
+++ /dev/null
@@ -1,5 +0,0 @@
-# adding dependence on sal due to used $gb_STDLIBS which contain uwinapi for Windows
-# here a corresponding cleanup is needed as apr-util should not have a dependence on uwinapi
-apru     apr-util :  sal APR:apr EXPAT:expat NULL
-apru     apr-util usr1    -	all	apru_mkout NULL
-apru     apr-util nmake	-	all	apru_apr-util NULL
diff --git a/ext_libraries/apr-util/prj/d.lst b/ext_libraries/apr-util/prj/d.lst
deleted file mode 100644
index 5c67d11cf0..0000000000
--- a/ext_libraries/apr-util/prj/d.lst
+++ /dev/null
@@ -1,15 +0,0 @@
-mkdir: %_DEST%\inc%_EXT%\apr-util
-..\%__SRC%\inc\apr-util\apr*.h %_DEST%\inc%_EXT%\apr-util
-..\%__SRC%\inc\apr-util\apu*.h %_DEST%\inc%_EXT%\apr-util
-..\aprutil_version.mk %_DEST%\inc%_EXT%
-
-# Unixes
-..\%__SRC%\bin\apu-1-config %_DEST%\bin%_EXT%
-
-# Linux
-..\%__SRC%\lib\libaprutil-1.so.*.* %_DEST%\lib%_EXT%
-..\%__SRC%\lib\libaprutil-1.so.* %_DEST%\lib%_EXT%
-linklib: libaprutil-1.so.*
-
-# Mac
-..\%__SRC%\lib\libaprutil-1.*dylib %_DEST%\lib%_EXT%
diff --git a/ext_libraries/apr/apr-1.6.5-no-devenv.patch b/ext_libraries/apr/apr-1.6.5-no-devenv.patch
deleted file mode 100644
index 1f79190c41..0000000000
--- a/ext_libraries/apr/apr-1.6.5-no-devenv.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- misc/build/apr-1.6.5/Makefile.win	2013-10-03 12:58:21.000000000 +0200
-+++ misc/build/apr-1.6.5/Makefile.win	2016-07-26 12:59:58.183576182 +0200
-@@ -26,12 +26,7 @@
- #   nmake -f Makefile.win PREFIX=C:\APR buildall checkall install clean
- #
- 
--!IF EXIST("apr.sln") && ([devenv /help > NUL 2>&1] == 0) \
--    && !defined(USEMAK) && !defined(USEDSW)
--USESLN=1
--USEMAK=0
--USEDSW=0
--!ELSEIF EXIST("apr.mak") && !defined(USEDSW)
-+!IF EXIST("apr.mak") && !defined(USEDSW)
- USESLN=0
- USEMAK=1
- USEDSW=0
diff --git a/ext_libraries/apr/apr-1.6.5-windows.patch b/ext_libraries/apr/apr-1.6.5-windows.patch
deleted file mode 100644
index 917573a934..0000000000
--- a/ext_libraries/apr/apr-1.6.5-windows.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- misc/build/apr-1.6.5/Makefile.win	2018-03-05 05:48:04.021330400 +0200
-+++ misc/build/apr-1.6.5/Makefile.win	2018-03-05 05:58:03.647346500 +0200
-@@ -39,7 +39,7 @@
- PREFIX=..\apr-dist
- 
- !IF [$(COMSPEC) /c cl /nologo /? \
--	| $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0
-+	| findstr.exe "x64" >NUL ] == 0
- ARCH=x64 Release
- !ELSE
- ARCH=Win32 Release
diff --git a/ext_libraries/apr/apr_version.mk b/ext_libraries/apr/apr_version.mk
deleted file mode 100644
index 3c924440f3..0000000000
--- a/ext_libraries/apr/apr_version.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-#**************************************************************
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-#**************************************************************
-
-APR_MAJOR=1
-APR_MINOR=6
-APR_MICRO=5
diff --git a/ext_libraries/apr/makefile.mk b/ext_libraries/apr/makefile.mk
deleted file mode 100644
index ea007d9c23..0000000000
--- a/ext_libraries/apr/makefile.mk
+++ /dev/null
@@ -1,128 +0,0 @@
-#**************************************************************
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-#**************************************************************
-
-PRJ=.
-
-PRJNAME=apr
-TARGET=apr
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE :	settings.mk
-.INCLUDE :      apr_version.mk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(SYSTEM_APR)"=="YES"
-
-all:
-	@echo "Using system apr.  Does not have to be built."
-
-.ELSE
-
-# Assemble the full version number from the parts defined in apr_version.mk
-APRVERSION=$(APR_MAJOR).$(APR_MINOR).$(APR_MICRO)
-
-TARFILE_NAME=$(PRJNAME)-$(APRVERSION)
-TARFILE_MD5=0759294408daace192c935b7c9e76e04
-
-.IF "$(OS)"=="WNT"
-
-PATCH_FILES+= $(TARFILE_NAME)-no-devenv.patch
-PATCH_FILES+= $(TARFILE_NAME)-windows.patch
-CONFIGURE_ACTION=cp include/apr.hw include/apr.h
-BUILD_DIR=
-BUILD_ACTION=INCLUDE="$(INCLUDE);./include" USEMAK=1  nmake -f Makefile.win buildall
-
-.ELIF "$(GUI)" == "OS2"
-
-@all:
-	@echo "using system apr. nothing do do."
-
-.ELSE
-
-CONFIGURE_DIR=
-CONFIGURE_ACTION=.$/configure --prefix=$(OUTDIR) --includedir=$(OUTDIR)$/inc$/apr
-
-# Recent versions of clang (clang-12xxx) on macOS break some tests in APR 1.6 (and older)
-# configure (mostly around testing sizeof) due to errors now being fatal.
-# Work around this by ignoring all errors but only with the later versions of Xcode
-.IF "$(OS)"=="MACOSX" && "$(COM)"=="CLANG" && "$(CCNUMVER)" > "001100000003"
-CONFIGURE_FLAGS=CPPFLAGS="-Wno-error=all"
-.ELSE
-CONFIGURE_FLAGS=
-.ENDIF
-
-BUILD_DIR=$(CONFIGURE_DIR)
-BUILD_ACTION=$(GNUMAKE) --debug=b
-#BUILD_FLAGS+= -j$(EXTMAXPROCESS)
-
-# Make apr-1-config believe that apr has been installed.
-INSTALL_ACTION=if [ -f apr-1-config.orig ]; then mv -f apr-1-config.orig apr-1-config; fi;	\
-	cp apr-1-config apr-1-config.orig;							\
-	sed -e "s/^location=source/location=installed/;s/^\(installbuilddir=.*\)\/.*/\\1\/lib\/apr\"/" apr-1-config > apr-1-config.installed;								\
-	mv -f apr-1-config.installed apr-1-config;	\
-	chmod +x apr-1-config
-
-.ENDIF
-
-OUT2INC+=include$/apr*.h
-OUT2INC_SUBDIR=apr
-
-.IF "$(OS)"=="WNT"
-.IF "$(CPUNAME)"=="INTEL"
-OUT2LIB+=LibR$/*.lib
-OUT2LIB+=LibR$/*.pdb
-OUT2LIB+=Release$/libaprapp-1.lib
-OUT2LIB+=Release$/libaprapp-1.pdb
-OUT2LIB+=Release$/libapr-1.lib
-OUT2LIB+=Release$/libapr-1.exp
-OUT2BIN+=Release$/libapr-1.dll
-OUT2BIN+=Release$/libapr-1.pdb
-.ELIF "$(CPUNAME)"=="X86_64"
-OUT2LIB+=x64/LibR$/*.lib
-OUT2LIB+=x64/LibR$/*.pdb
-OUT2LIB+=x64/Release$/libaprapp-1.lib
-OUT2LIB+=x64/Release$/libaprapp-1.pdb
-OUT2LIB+=x64/Release$/libapr-1.lib
-OUT2LIB+=x64/Release$/libapr-1.exp
-OUT2BIN+=x64/Release$/libapr-1.dll
-OUT2BIN+=x64/Release$/libapr-1.pdb
-.ENDIF
-.ELSE
-.IF "$(OS)"=="MACOSX"
-OUT2LIB+=.libs/libapr-1.*dylib
-.ELSE
-OUT2LIB+=.libs/libapr-1.so*
-.ENDIF
-OUT2BIN=build/apr_rules.mk
-OUT2BIN+=libtool
-OUT2BIN+=apr-1-config
-.ENDIF
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : set_ext.mk
-.INCLUDE : target.mk
-.INCLUDE : tg_ext.mk
-
-.ENDIF
diff --git a/ext_libraries/apr/prj/build.lst b/ext_libraries/apr/prj/build.lst
deleted file mode 100644
index 9393650666..0000000000
--- a/ext_libraries/apr/prj/build.lst
+++ /dev/null
@@ -1,3 +0,0 @@
-apr     apr : solenv NULL	
-apr     apr usr1    -	all	apr_mkout NULL
-apr     apr nmake	-	all	apr_apr NULL
diff --git a/ext_libraries/apr/prj/d.lst b/ext_libraries/apr/prj/d.lst
deleted file mode 100644
index 926421f9f7..0000000000
--- a/ext_libraries/apr/prj/d.lst
+++ /dev/null
@@ -1,24 +0,0 @@
-mkdir: %_DEST%\inc%_EXT%\apr
-mkdir: %_DEST%\lib%_EXT%\apr
-
-# Includes
-..\%__SRC%\inc\apr\apr*.h %_DEST%\inc%_EXT%\apr
-..\apr_version.mk %_DEST%\inc%_EXT%
-
-# Windows
-..\%__SRC%\bin\libapr-1.dll %_DEST%\bin%_EXT%
-..\%__SRC%\lib\libapr-1.lib %_DEST%\lib%_EXT%
-
-# Unixes
-..\%__SRC%\bin\apr-1-config %_DEST%\bin%_EXT%
-..\%__SRC%\bin\libtool %_DEST%\lib%_EXT%\apr
-..\%__SRC%\bin\apr_rules.mk %_DEST%\lib%_EXT%\apr
-
-# Linux
-..\%__SRC%\lib\libapr-1.so.*.* %_DEST%\lib%_EXT%
-..\%__SRC%\lib\libapr-1.so.* %_DEST%\lib%_EXT%
-linklib: libapr-1.so.*.*
-linklib: libapr-1.so.*
-
-# Mac
-..\%__SRC%\lib\libapr-1.*dylib %_DEST%\lib%_EXT%
diff --git a/ext_libraries/serf/NULbytes.patch b/ext_libraries/serf/NULbytes.patch
deleted file mode 100644
index 12593d92e3..0000000000
--- a/ext_libraries/serf/NULbytes.patch
+++ /dev/null
@@ -1,313 +0,0 @@
-------------------------------------------------------------------------
-r1699925 | breser | 2014-08-04 11:04:00 -0700 (Mon, 04 Aug 2014) | 5 lines
-
-On the 1.3.x branch: 
-
-Merge changes from trunk:
-- r2392: Handle NUL bytes in fields of X.509 certs.
-
-------------------------------------------------------------------------
-Index: misc/build/serf-1.2.1/buckets/ssl_buckets.c
-===================================================================
---- misc/serf-1.2.1/buckets/ssl_buckets.c	(revision 1699924)
-+++ misc/build/serf-1.2.1/buckets/ssl_buckets.c	(revision 1699925)
-@@ -202,6 +202,8 @@
- };
- 
- static void disable_compression(serf_ssl_context_t *ssl_ctx);
-+static char *
-+    pstrdup_escape_nul_bytes(const char *buf, int len, apr_pool_t *pool);
- 
- #if SSL_VERBOSE
- /* Log all ssl alerts that we receive from the server. */
-@@ -427,6 +429,81 @@
- #endif
- };
- 
-+typedef enum san_copy_t {
-+    EscapeNulAndCopy = 0,
-+    ErrorOnNul = 1,
-+} san_copy_t;
-+
-+
-+static apr_status_t
-+get_subject_alt_names(apr_array_header_t **san_arr, X509 *ssl_cert,
-+                      san_copy_t copy_action, apr_pool_t *pool)
-+{
-+    STACK_OF(GENERAL_NAME) *names;
-+
-+    /* assert: copy_action == ErrorOnNul || (san_arr && pool) */
-+
-+    /* Get subjectAltNames */
-+    names = X509_get_ext_d2i(ssl_cert, NID_subject_alt_name, NULL, NULL);
-+    if (names) {
-+        int names_count = sk_GENERAL_NAME_num(names);
-+        int name_idx;
-+
-+        if (san_arr)
-+            *san_arr = apr_array_make(pool, names_count, sizeof(char*));
-+        for (name_idx = 0; name_idx < names_count; name_idx++) {
-+            char *p = NULL;
-+            GENERAL_NAME *nm = sk_GENERAL_NAME_value(names, name_idx);
-+
-+            switch (nm->type) {
-+                case GEN_DNS:
-+                    if (copy_action == ErrorOnNul &&
-+                        strlen(nm->d.ia5->data) != nm->d.ia5->length)
-+                        return SERF_ERROR_SSL_CERT_FAILED;
-+                    if (san_arr && *san_arr)
-+                        p = pstrdup_escape_nul_bytes((const char *)nm->d.ia5->data,
-+                                                     nm->d.ia5->length,
-+                                                     pool);
-+                    break;
-+                default:
-+                    /* Don't know what to do - skip. */
-+                    break;
-+            }
-+
-+            if (p) {
-+                APR_ARRAY_PUSH(*san_arr, char*) = p;
-+            }
-+        }
-+        sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free);
-+    }
-+    
-+    return APR_SUCCESS;
-+}
-+
-+static apr_status_t validate_cert_hostname(X509 *server_cert, apr_pool_t *pool)
-+{
-+    char buf[1024];
-+    int length;
-+    apr_status_t ret;
-+
-+    ret = get_subject_alt_names(NULL, server_cert, ErrorOnNul, NULL);
-+    if (ret) {
-+      return ret;
-+    } else {
-+        /* Fail if the subject's CN field contains \0 characters. */
-+        X509_NAME *subject = X509_get_subject_name(server_cert);
-+        if (!subject)
-+            return SERF_ERROR_SSL_CERT_FAILED;
-+
-+        length = X509_NAME_get_text_by_NID(subject, NID_commonName, buf, 1024);
-+        if (length != -1)
-+            if (strlen(buf) != length)
-+                return SERF_ERROR_SSL_CERT_FAILED;
-+    }
-+
-+    return APR_SUCCESS;
-+}
-+
- static int
- validate_server_certificate(int cert_valid, X509_STORE_CTX *store_ctx)
- {
-@@ -435,6 +512,7 @@
-     X509 *server_cert;
-     int err, depth;
-     int failures = 0;
-+    apr_status_t status;
- 
-     ssl = X509_STORE_CTX_get_ex_data(store_ctx,
-                                      SSL_get_ex_data_X509_STORE_CTX_idx());
-@@ -475,6 +553,11 @@
-         }
-     }
- 
-+    /* Validate hostname */
-+    status = validate_cert_hostname(server_cert, ctx->pool);
-+    if (status)
-+        failures |= SERF_SSL_CERT_UNKNOWN_FAILURE;
-+
-     /* Check certificate expiry dates. */
-     if (X509_cmp_current_time(X509_get_notBefore(server_cert)) >= 0) {
-         failures |= SERF_SSL_CERT_NOTYETVALID;
-@@ -485,7 +568,6 @@
- 
-     if (ctx->server_cert_callback &&
-         (depth == 0 || failures)) {
--        apr_status_t status;
-         serf_ssl_certificate_t *cert;
-         apr_pool_t *subpool;
- 
-@@ -512,7 +594,6 @@
- 
-     if (ctx->server_cert_chain_callback
-         && (depth == 0 || failures)) {
--        apr_status_t status;
-         STACK_OF(X509) *chain;
-         const serf_ssl_certificate_t **certs;
-         int certs_len;
-@@ -1461,7 +1542,50 @@
- 
- /* Functions to read a serf_ssl_certificate structure. */
- 
--/* Creates a hash_table with keys (E, CN, OU, O, L, ST and C). */
-+/* Takes a counted length string and escapes any NUL bytes so that
-+ * it can be used as a C string.  NUL bytes are escaped as 3 characters
-+ * "\00" (that's a literal backslash).
-+ * The returned string is allocated in POOL.
-+ */
-+static char *
-+pstrdup_escape_nul_bytes(const char *buf, int len, apr_pool_t *pool)
-+{
-+    int i, nul_count = 0;
-+    char *ret;
-+
-+    /* First determine if there are any nul bytes in the string. */
-+    for (i = 0; i < len; i++) {
-+        if (buf[i] == '\0')
-+            nul_count++;
-+    }
-+
-+    if (nul_count == 0) {
-+        /* There aren't so easy case to just copy the string */
-+        ret = apr_pstrdup(pool, buf);
-+    } else {
-+        /* There are so we have to replace nul bytes with escape codes
-+         * Proper length is the length of the original string, plus
-+         * 2 times the number of nulls (for two digit hex code for
-+         * the value) + the trailing null. */
-+        char *pos;
-+        ret = pos = apr_palloc(pool, len + 2 * nul_count + 1);
-+        for (i = 0; i < len; i++) {
-+            if (buf[i] != '\0') {
-+                *(pos++) = buf[i];
-+            } else {
-+                *(pos++) = '\\';
-+                *(pos++) = '0';
-+                *(pos++) = '0';
-+            }
-+        }
-+        *pos = '\0';
-+    }
-+
-+    return ret;
-+}
-+
-+/* Creates a hash_table with keys (E, CN, OU, O, L, ST and C). Any NUL bytes in
-+   these fields in the certificate will be escaped as \00. */
- static apr_hash_t *
- convert_X509_NAME_to_table(X509_NAME *org, apr_pool_t *pool)
- {
-@@ -1474,37 +1598,44 @@
-                                     NID_commonName,
-                                     buf, 1024);
-     if (ret != -1)
--        apr_hash_set(tgt, "CN", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
-+        apr_hash_set(tgt, "CN", APR_HASH_KEY_STRING,
-+                     pstrdup_escape_nul_bytes(buf, ret, pool));
-     ret = X509_NAME_get_text_by_NID(org,
-                                     NID_pkcs9_emailAddress,
-                                     buf, 1024);
-     if (ret != -1)
--        apr_hash_set(tgt, "E", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
-+        apr_hash_set(tgt, "E", APR_HASH_KEY_STRING,
-+                     pstrdup_escape_nul_bytes(buf, ret, pool));
-     ret = X509_NAME_get_text_by_NID(org,
-                                     NID_organizationalUnitName,
-                                     buf, 1024);
-     if (ret != -1)
--        apr_hash_set(tgt, "OU", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
-+        apr_hash_set(tgt, "OU", APR_HASH_KEY_STRING,
-+                     pstrdup_escape_nul_bytes(buf, ret, pool));
-     ret = X509_NAME_get_text_by_NID(org,
-                                     NID_organizationName,
-                                     buf, 1024);
-     if (ret != -1)
--        apr_hash_set(tgt, "O", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
-+        apr_hash_set(tgt, "O", APR_HASH_KEY_STRING,
-+                     pstrdup_escape_nul_bytes(buf, ret, pool));
-     ret = X509_NAME_get_text_by_NID(org,
-                                     NID_localityName,
-                                     buf, 1024);
-     if (ret != -1)
--        apr_hash_set(tgt, "L", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
-+        apr_hash_set(tgt, "L", APR_HASH_KEY_STRING,
-+                     pstrdup_escape_nul_bytes(buf, ret, pool));
-     ret = X509_NAME_get_text_by_NID(org,
-                                     NID_stateOrProvinceName,
-                                     buf, 1024);
-     if (ret != -1)
--        apr_hash_set(tgt, "ST", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
-+        apr_hash_set(tgt, "ST", APR_HASH_KEY_STRING,
-+                     pstrdup_escape_nul_bytes(buf, ret, pool));
-     ret = X509_NAME_get_text_by_NID(org,
-                                     NID_countryName,
-                                     buf, 1024);
-     if (ret != -1)
--        apr_hash_set(tgt, "C", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf));
-+        apr_hash_set(tgt, "C", APR_HASH_KEY_STRING,
-+                     pstrdup_escape_nul_bytes(buf, ret, pool));
- 
-     return tgt;
- }
-@@ -1550,7 +1681,7 @@
-     unsigned int md_size, i;
-     unsigned char md[EVP_MAX_MD_SIZE];
-     BIO *bio;
--    STACK_OF(GENERAL_NAME) *names;
-+    apr_array_header_t *san_arr;
- 
-     /* sha1 fingerprint */
-     if (X509_digest(cert->ssl_cert, EVP_sha1(), md, &md_size)) {
-@@ -1595,33 +1726,9 @@
-     BIO_free(bio);
- 
-     /* Get subjectAltNames */
--    names = X509_get_ext_d2i(cert->ssl_cert, NID_subject_alt_name, NULL, NULL);
--    if (names) {
--        int names_count = sk_GENERAL_NAME_num(names);
--
--        apr_array_header_t *san_arr = apr_array_make(pool, names_count,
--                                                     sizeof(char*));
-+    if (!get_subject_alt_names(&san_arr, cert->ssl_cert, EscapeNulAndCopy, pool))
-         apr_hash_set(tgt, "subjectAltName", APR_HASH_KEY_STRING, san_arr);
--        for (i = 0; i < names_count; i++) {
--            char *p = NULL;
--            GENERAL_NAME *nm = sk_GENERAL_NAME_value(names, i);
- 
--            switch (nm->type) {
--            case GEN_DNS:
--                p = apr_pstrmemdup(pool, (const char *)nm->d.ia5->data,
--                                   nm->d.ia5->length);
--                break;
--            default:
--                /* Don't know what to do - skip. */
--                break;
--            }
--            if (p) {
--                APR_ARRAY_PUSH(san_arr, char*) = p;
--            }
--        }
--        sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free);
--    }
--
-     return tgt;
- }
- 
-------------------------------------------------------------------------
-r1699931 | breser | 2014-08-05 19:24:00 -0700 (Tue, 05 Aug 2014) | 6 lines
-
-On the 1.3.x branch: 
-
-Merge changes from trunk:
-- r2398: Initialize san_arr when we're expected to fill it.
-
-
-------------------------------------------------------------------------
-Index: misc/build/serf-1.2.1/buckets/ssl_buckets.c
-===================================================================
---- misc/serf-1.2.1/buckets/ssl_buckets.c	(revision 1699930)
-+++ misc/build/serf-1.2.1/buckets/ssl_buckets.c	(revision 1699931)
-@@ -443,6 +443,10 @@
- 
-     /* assert: copy_action == ErrorOnNul || (san_arr && pool) */
- 
-+    if (san_arr) {
-+        *san_arr = NULL;
-+    }
-+
-     /* Get subjectAltNames */
-     names = X509_get_ext_d2i(ssl_cert, NID_subject_alt_name, NULL, NULL);
-     if (names) {
diff --git a/ext_libraries/serf/makefile.mk b/ext_libraries/serf/makefile.mk
deleted file mode 100644
index d3f7c553ac..0000000000
--- a/ext_libraries/serf/makefile.mk
+++ /dev/null
@@ -1,134 +0,0 @@
-#**************************************************************
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-#**************************************************************
-
-PRJ=.
-
-PRJNAME=serf
-TARGET=so_serf
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE :	settings.mk
-.INCLUDE :	serf_version.mk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(SYSTEM_SERF)"=="YES"
-
-all:
-	@echo "Using system serf.  Does not have to be built."
-
-.ELSE
-
-# Assemble the full version number from the parts defined in serf_version.mk
-LIBSERFVERSION=$(SERF_MAJOR).$(SERF_MINOR).$(SERF_MICRO)
-
-TARFILE_NAME=$(PRJNAME)-$(LIBSERFVERSION)
-# This is the SHA1 checksum, not MD5 but tg_ext.mk does not now about this and,
-# thankfully, does not care.
-TARFILE_MD5=f65fbbd72926c8e7cf0dbd4ada03b0d226f461fd
-
-PATCH_FILES=NULbytes.patch
-
-.IF "$(OS)"=="WNT"
-
-CONFIGURE_DIR=
-CONFIGURE_ACTION=
-CONFIGURE_FLAGS=
-
-BUILD_DIR=
-BUILD_ACTION=$(GNUMAKE)
-BUILD_FLAGS+= -f ../../../../win/Makefile -j$(EXTMAXPROCESS)
-
-.ELIF "$(GUI)" == "OS2"
-
-@all:
-	@echo "using system serf. nothing do do."
-
-.ELSE
-
-.IF "$(OS)"=="MACOSX" || "$(OS)"=="FREEBSD" || "$(OS)"=="LINUX"
-# Do not link against expat.  It is not necessary (apr-util is already linked against it)
-# and does not work (we use a different expat library schema.)
-PATCH_FILES+=$(TARFILE_NAME).libs.patch
-.ENDIF
-
-.IF "$(OS)"=="LINUX"
-# Add -ldl as last library so that the linker has no trouble resolving dependencies.
-PATCH_FILES+=$(TARFILE_NAME).ldl.patch
-.ENDIF
-
-# Export ENABLE_SERF_LOGGING=YES to enable serf logging
-.IF "$(ENABLE_SERF_LOGGING)" == "YES"
-PATCH_FILES+=$(TARFILE_NAME).logging.patch
-CDEFS+=-DENABLE_SERF_VERBOSE -DSERF_VERBOSE
-.ENDIF
-
-CONFIGURE_DIR=
-CONFIGURE_ACTION=autoconf && .$/configure
-
-.IF "$(OS)"=="LINUX"
-.IF "$(SYSTEM_OPENSSL)"=="YES"
-CDEFS+=$(OPENSSL_CFLAGS)
-.ELSE
-OPENSSLINCDIR=external
-CDEFS+=-I$(SOLARINCDIR)$/$(OPENSSLINCDIR)
-.ENDIF
-.ENDIF
-
-# On Linux/Mac we need the content of CDEFS in CFLAGS so that the ssl headers are searched for
-.IF "$(OS)"=="MACOSX" || "$(OS)"=="LINUX"
-# in a directory that corresponds to the directory that is searched for the ssl library.
-CONFIGURE_FLAGS='CFLAGS=$(CDEFS)'
-.ENDIF
-
-BUILD_DIR=$(CONFIGURE_DIR)
-BUILD_ACTION=$(GNUMAKE)
-BUILD_FLAGS+= -j$(EXTMAXPROCESS)
-
-.IF "$(OS)"=="MACOSX"
-# Serf names its library only with the major number.
-# We are using minor and micro as well.  Fix that here
-# by creating a copy with the right name.
-SERF_ORIGINAL_LIB=.libs/libserf-$(SERF_MAJOR).0.dylib
-SERF_FIXED_LIB=.libs/libserf-$(LIBSERFVERSION).0.dylib
-INSTALL_ACTION=if [ -f "$(SERF_ORIGINAL_LIB)" -a ! -f "$(SERF_FIXED_LIB)" ]; then cp $(SERF_ORIGINAL_LIB) $(SERF_FIXED_LIB); fi	 
-.ENDIF
-
-OUT2INC+=serf*.h
-OUT2INC_SUBDIR=serf
-
-.IF "$(OS)"=="MACOSX"
-OUT2LIB+=$(SERF_FIXED_LIB)
-OUT2LIB+=.libs/libserf-1.*dylib
-.ELSE
-OUT2LIB=.libs/libserf-1.so*
-.ENDIF
-
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : set_ext.mk
-.INCLUDE : target.mk
-.INCLUDE : tg_ext.mk
-
-.ENDIF
diff --git a/ext_libraries/serf/prj/build.lst b/ext_libraries/serf/prj/build.lst
deleted file mode 100644
index ccde897f4a..0000000000
--- a/ext_libraries/serf/prj/build.lst
+++ /dev/null
@@ -1,3 +0,0 @@
-serf     serf :  APR_UTIL:apr-util OPENSSL:openssl NULL	
-serf     serf usr1    -	all	serf_mkout NULL
-serf     serf nmake	-	all	serf_serf NULL
diff --git a/ext_libraries/serf/prj/d.lst b/ext_libraries/serf/prj/d.lst
deleted file mode 100644
index 29c8eb6c60..0000000000
--- a/ext_libraries/serf/prj/d.lst
+++ /dev/null
@@ -1,12 +0,0 @@
-mkdir: %_DEST%\inc%_EXT%\serf
-..\%__SRC%\inc\serf\serf*.h %_DEST%\inc%_EXT%\serf
-..\serf_version.mk %_DEST%\inc%_EXT%
-
-# Mac
-..\%__SRC%\lib\libserf-1.*dylib %_DEST%\lib%_EXT%
-
-# Linux, BSD, et al
-..\%__SRC%\lib\libserf-1.so.*.* %_DEST%\lib%_EXT%
-..\%__SRC%\lib\libserf-1.so.* %_DEST%\lib%_EXT%
-linklib: libserf-1.so.*.*
-linklib: libserf-1.so.*
diff --git a/ext_libraries/serf/serf-1.2.1.ldl.patch b/ext_libraries/serf/serf-1.2.1.ldl.patch
deleted file mode 100644
index 9b2758d04c..0000000000
--- a/ext_libraries/serf/serf-1.2.1.ldl.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- misc/serf-1.2.1/Makefile.in	2013-06-03 15:21:14.000000000 -0300
-+++ misc/build/serf-1.2.1/Makefile.in	2013-06-07 12:31:04.416862903 -0300
-@@ -56,7 +56,7 @@ MKDIR = @mkdir_p@
- INSTALL = @INSTALL@
- 
- LDFLAGS = @EXTRA_LDFLAGS@ @LDFLAGS@
--LIBS = @EXTRA_LIBS@  @SERF_LIBS@ -lz -lssl -lcrypto
-+LIBS = @EXTRA_LIBS@  @SERF_LIBS@ -lz -lssl -lcrypto -ldl
- 
- all: $(TARGET_LIB) $(PROGRAMS)
- 
diff --git a/ext_libraries/serf/serf-1.2.1.libs.patch b/ext_libraries/serf/serf-1.2.1.libs.patch
deleted file mode 100644
index 8224203530..0000000000
--- a/ext_libraries/serf/serf-1.2.1.libs.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- misc/serf-1.2.1/configure.in	2013-06-03 14:52:41.000000000 -0300
-+++ misc/build/serf-1.2.1/configure.in	2013-06-07 12:27:36.914098933 -0300
-@@ -257,7 +257,7 @@ AC_SEARCH_LIBS(fabs, m)
- 
- libs=""
- if test -n "$apu_config"; then
--  APR_ADDTO(libs, [`$apu_config --link-libtool --libs`])
-+  APR_ADDTO(libs, [`$apu_config --link-libtool`])
- fi
- APR_ADDTO(libs, [`$apr_config --link-libtool --libs` $LIBS])
- 
diff --git a/ext_libraries/serf/serf-1.2.1.logging.patch b/ext_libraries/serf/serf-1.2.1.logging.patch
deleted file mode 100644
index a0714434d1..0000000000
--- a/ext_libraries/serf/serf-1.2.1.logging.patch
+++ /dev/null
@@ -1,27 +0,0 @@
---- misc/serf-1.2.1/serf_private.h	2013-06-03 14:22:51.000000000 -0300
-+++ misc/build/serf-1.2.1/serf_private.h	2013-06-07 12:33:34.432688365 -0300
-@@ -32,12 +32,18 @@
- 
- /* Internal logging facilities, set flag to 1 to enable console logging for
-    the selected component. */
--#define SSL_VERBOSE 0
--#define SSL_MSG_VERBOSE 0  /* logs decrypted requests and responses. */
--#define SOCK_VERBOSE 0
--#define SOCK_MSG_VERBOSE 0 /* logs bytes received from or written to a socket. */
--#define CONN_VERBOSE 0
--#define AUTH_VERBOSE 0
-+#ifdef ENABLE_SERF_VERBOSE
-+#define SERF_VERBOSE_FLAG 1
-+#else
-+#define SERF_VERBOSE_FLAG 0
-+#endif
-+
-+#define SSL_VERBOSE         SERF_VERBOSE_FLAG
-+#define SSL_MSG_VERBOSE     SERF_VERBOSE_FLAG  /* logs decrypted requests and responses. */
-+#define SOCK_VERBOSE        SERF_VERBOSE_FLAG
-+#define SOCK_MSG_VERBOSE    SERF_VERBOSE_FLAG /* logs bytes received from or written to a socket. */
-+#define CONN_VERBOSE        SERF_VERBOSE_FLAG
-+#define AUTH_VERBOSE        SERF_VERBOSE_FLAG
- 
- 
- typedef struct serf__authn_scheme_t serf__authn_scheme_t;
diff --git a/ext_libraries/serf/serf_version.mk b/ext_libraries/serf/serf_version.mk
deleted file mode 100644
index 4cf137984f..0000000000
--- a/ext_libraries/serf/serf_version.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-#**************************************************************
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-#**************************************************************
-
-SERF_MAJOR=1
-SERF_MINOR=2
-SERF_MICRO=1
diff --git a/ext_libraries/serf/win/Library_serf.mk b/ext_libraries/serf/win/Library_serf.mk
deleted file mode 100755
index 64e0861e37..0000000000
--- a/ext_libraries/serf/win/Library_serf.mk
+++ /dev/null
@@ -1,89 +0,0 @@
-#/**************************************************************
-# * 
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# * 
-# *   http://www.apache.org/licenses/LICENSE-2.0
-# * 
-# * Unless required by applicable law or agreed to in writing,
-# * software distributed under the License is distributed on an
-# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# * KIND, either express or implied.  See the License for the
-# * specific language governing permissions and limitations
-# * under the License.
-# * 
-# *************************************************************/
-
-$(eval $(call gb_Library_Library,serf))
-
-$(eval $(call gb_Library_add_package_headers,serf,serf_inc))
-
-$(eval $(call gb_Library_set_include,serf,\
-	$$(INCLUDE) \
-	-I. \
-	-I$(OUTDIR)/inc/apr \
-	-I$(OUTDIR)/inc/apr-util \
-	-I$(OUTDIR)/inc/external/zlib \
-))
-
-$(eval $(call gb_Library_add_defs,serf,\
-	-DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DWIN32_EXPORTS \
-))
-
-ORIGINAL_DEF_FILE=build/serf.def
-FIXED_DEF_FILE=build/fixed-serf.def
-
-$(call gb_LinkTarget_get_target,$(call gb_Library__get_linktargetname,serf)) : $(FIXED_DEF_FILE)
-$(FIXED_DEF_FILE) : $(ORIGINAL_DEF_FILE)
-	cp $< $@
-	echo serf_bucket_request_set_CL >> $@
-
-$(eval $(call gb_Library_add_ldflags,serf,\
-	-DEF:$(FIXED_DEF_FILE)	\
-))
-
-$(eval $(call gb_Library_add_linked_libs,serf,\
-	apr \
-	apr-util \
-	libeay32 \
-	ssleay32 \
-	zlib \
-    $(gb_STDLIBS) \
-))
-
-$(eval $(call gb_Library_add_cobjects,serf,\
-	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth \
-	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth_basic \
-	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth_digest \
-	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth_kerb \
-	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth_kerb_gss \
-	serf/$(INPATH)/misc/build/serf-1.2.1/auth/auth_kerb_sspi \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/aggregate_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/allocator \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/barrier_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/bwtp_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/chunk_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/dechunk_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/deflate_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/file_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/headers_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/iovec_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/limit_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/mmap_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/request_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/response_body_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/response_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/simple_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/socket_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/buckets/ssl_buckets \
-	serf/$(INPATH)/misc/build/serf-1.2.1/context \
-	serf/$(INPATH)/misc/build/serf-1.2.1/incoming \
-	serf/$(INPATH)/misc/build/serf-1.2.1/outgoing \
-	serf/$(INPATH)/misc/build/serf-1.2.1/ssltunnel \
-))
diff --git a/ext_libraries/serf/win/Makefile b/ext_libraries/serf/win/Makefile
deleted file mode 100755
index 8dfd47b297..0000000000
--- a/ext_libraries/serf/win/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-#/**************************************************************
-# * 
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# * 
-# *   http://www.apache.org/licenses/LICENSE-2.0
-# * 
-# * Unless required by applicable law or agreed to in writing,
-# * software distributed under the License is distributed on an
-# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# * KIND, either express or implied.  See the License for the
-# * specific language governing permissions and limitations
-# * under the License.
-# * 
-# *************************************************************/
-
-ifeq ($(strip $(SOLARENV)),)
-$(error No environment set!)
-endif
-
-gb_PARTIALBUILD := T
-GBUILDDIR := $(SOLARENV)/gbuild
-include $(GBUILDDIR)/gbuild.mk
-
-$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))Module*.mk)))
diff --git a/ext_libraries/serf/win/Module_serf.mk b/ext_libraries/serf/win/Module_serf.mk
deleted file mode 100755
index 2258d05e3f..0000000000
--- a/ext_libraries/serf/win/Module_serf.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-#/**************************************************************
-# * 
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# * 
-# *   http://www.apache.org/licenses/LICENSE-2.0
-# * 
-# * Unless required by applicable law or agreed to in writing,
-# * software distributed under the License is distributed on an
-# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# * KIND, either express or implied.  See the License for the
-# * specific language governing permissions and limitations
-# * under the License.
-# * 
-# *************************************************************/
-
-$(eval $(call gb_Module_Module,serf))
-
-$(eval $(call gb_Module_add_targets,serf,\
-	Library_serf \
-	Package_inc \
-))
diff --git a/ext_libraries/serf/win/Package_inc.mk b/ext_libraries/serf/win/Package_inc.mk
deleted file mode 100755
index 7d47447e57..0000000000
--- a/ext_libraries/serf/win/Package_inc.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-#/**************************************************************
-# * 
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# * 
-# *   http://www.apache.org/licenses/LICENSE-2.0
-# * 
-# * Unless required by applicable law or agreed to in writing,
-# * software distributed under the License is distributed on an
-# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# * KIND, either express or implied.  See the License for the
-# * specific language governing permissions and limitations
-# * under the License.
-# * 
-# *************************************************************/
-
-$(eval $(call gb_Package_Package,serf_inc,$(EXT_LIBRARIES)/serf/$(INPATH)/misc/build/serf-1.2.1))
-$(eval $(call gb_Package_add_files, serf_inc, inc/serf,        \
-       serf.h                                                  \
-       serf_bucket_types.h                                     \
-       serf_bucket_util.h                                      \
-       ))
diff --git a/main/NOTICE b/main/NOTICE
index 0b8baa42fa..43d0de4cc7 100644
--- a/main/NOTICE
+++ b/main/NOTICE
@@ -172,17 +172,11 @@ ____
 
 As part of the base system this product also includes code from the following
 projects which are licensed under the Apache license:
-- serf
 - redland
 - StAX
 
 The notices from these projects are following:
 
-serf
-This product includes software developed by
-The Apache Software Foundation (https://www.apache.org/).
-
-
 redland
 This product includes Redland software (http://librdf.org/)
 developed at the Institute for Learning and Research Technology,
diff --git a/main/RepositoryExternal.mk b/main/RepositoryExternal.mk
index 44c91900e8..afc4420ba1 100644
--- a/main/RepositoryExternal.mk
+++ b/main/RepositoryExternal.mk
@@ -396,112 +396,6 @@ endef
 endif # SYSTEM_OPENSSL
 
 
-ifeq ($(SYSTEM_APR),YES)
-
-define gb_LinkTarget__use_apr
-$(call gb_LinkTarget_add_defs,$(1),\
-		-DSYSTEM_APR \
-)
-$(call gb_LinkTarget_set_include,$(1),\
-	$$(INCLUDE) \
-	$(APR_CFLAGS) \
-)
-$(call gb_LinkTarget_add_libs,$(1),$(APR_LIBS))
-endef
-
-else # !SYSTEM_APR
-
-ifeq ($(OS),WNT)
-$(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE,libapr-1))
-else
-$(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE,apr-1))
-endif
-
-define gb_LinkTarget__use_apr
-$(call gb_LinkTarget_set_include,$(1),\
-	$$(INCLUDE) \
-	-I$(OUTDIR)/inc/apr \
-)
-ifeq ($(OS),WNT)
-$(call gb_LinkTarget_add_linked_libs,$(1),libapr-1)
-else
-$(call gb_LinkTarget_add_linked_libs,$(1),apr-1)
-endif
-endef
-
-endif # SYSTEM_APR
-
-
-ifeq ($(SYSTEM_APR_UTIL),YES)
-
-define gb_LinkTarget__use_apr_util
-$(call gb_LinkTarget_add_defs,$(1),\
-	-DSYSTEM_APR_UTIL \
-)
-$(call gb_LinkTarget_set_include,$(1),\
-	$$(INCLUDE) \
-	$(APR_UTIL_CFLAGS) \
-)
-$(call gb_LinkTarget_add_libs,$(1),$(APR_UTIL_LIBS))
-endef
-
-else # !SYSTEM_APR_UTIL
-
-# on Windows apr-util is registered by ext_libraries/Repository.mk
-ifneq ($(OS),WNT)
-$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,aprutil-1))
-endif
-
-define gb_LinkTarget__use_apr_util
-$(call gb_LinkTarget_set_include,$(1),\
-	$$(INCLUDE) \
-	-I$(OUTDIR)/inc/apr-util \
-)
-ifeq ($(OS),WNT)
-$(call gb_LinkTarget_add_linked_libs,$(1),apr-util)
-else
-$(call gb_LinkTarget_add_linked_libs,$(1),aprutil-1)
-endif
-endef
-
-endif # SYSTEM_APR_UTIL
-
-
-ifeq ($(SYSTEM_SERF),YES)
-
-define gb_LinkTarget__use_serf
-$(call gb_LinkTarget_add_defs,$(1),\
-	-DSYSTEM_SERF \
-)
-$(call gb_LinkTarget_set_include,$(1),\
-	$$(INCLUDE) \
-	$(SERF_CFLAGS) \
-)
-$(call gb_LinkTarget_add_libs,$(1),$(SERF_LIBS))
-endef
-
-else # !SYSTEM_SERF
-
-# on Windows serf is registered by ext_libraries/Repository.mk
-ifneq ($(OS),WNT)
-$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,serf-1))
-endif
-
-define gb_LinkTarget__use_serf
-$(call gb_LinkTarget_set_include,$(1),\
-	$$(INCLUDE) \
-	-I$(OUTDIR)/inc/serf \
-)
-ifeq ($(OS),WNT)
-$(call gb_LinkTarget_add_linked_libs,$(1),serf)
-else
-$(call gb_LinkTarget_add_linked_libs,$(1),serf-1)
-endif
-endef
-
-endif # SYSTEM_SERF
-
-
 ifeq ($(SYSTEM_CURL),YES)
 
 define gb_LinkTarget__use_curl
diff --git a/main/configure.ac b/main/configure.ac
index e0ba7564f4..62cd7932f4 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -772,15 +772,6 @@ AC_ARG_WITH(local-solver,
 AC_ARG_ENABLE(javascript,
 [  --disable-javascript    Disables support for JavaScript macros.
 ],,)
-AC_ARG_WITH(system-apr,
-[  --with-system-apr       Use apr library already installed on the system
-],,)
-AC_ARG_WITH(system-apr-util,
-[  --with-system-apr-util  Use apr-util library already installed on the system
-],,)
-AC_ARG_WITH(system-serf,
-[  --with-system-serf      Use serf library already installed on the system
-],,)
 AC_ARG_WITH(system-coinmp,
 [  --with-system-coinmp    Use CoinMP library already installed on the system
 ],,)
@@ -4437,70 +4428,6 @@ fi
 AC_SUBST(ENABLE_JAVASCRIPT)
 
 
-dnl ===================================================================
-dnl Check for system apr
-dnl ===================================================================
-SYSTEM_APR=NO
-APR_CFLAGS=
-APR_LIBS=
-AC_MSG_CHECKING([which libapr to use])
-if test "x$with_system_apr" = "xyes" -o -n "$with_system_libs"; then
-    AC_MSG_RESULT([system])
-    PKG_CHECK_MODULES([APR], [apr-1 >= 1.0])
-    SYSTEM_APR=YES
-else
-    AC_MSG_RESULT([internal])
-    SYSTEM_APR=NO
-    BUILD_TYPE="$BUILD_TYPE APR"
-fi
-AC_SUBST(SYSTEM_APR)
-AC_SUBST(APR_CFLAGS)
-AC_SUBST(APR_LIBS)
-
-
-dnl ===================================================================
-dnl Check for system apr-util
-dnl ===================================================================
-SYSTEM_APR_UTIL=NO
-APR_UTIL_CFLAGS=
-APR_UTIL_LIBS=
-AC_MSG_CHECKING([which libapr-util to use])
-if test "x$with_system_apr_util" = "xyes" -o -n "$with_system_libs"; then
-    AC_MSG_RESULT([system])
-    PKG_CHECK_MODULES([APR_UTIL], [apr-util-1 >= 1.0])
-    SYSTEM_APR_UTIL=YES
-else
-    AC_MSG_RESULT([internal])
-    SYSTEM_APR_UTIL=NO
-    BUILD_TYPE="$BUILD_TYPE APR_UTIL"
-fi
-AC_SUBST(SYSTEM_APR_UTIL)
-AC_SUBST(APR_UTIL_CFLAGS)
-AC_SUBST(APR_UTIL_LIBS)
-
-
-dnl ===================================================================
-dnl Check for system serf
-dnl ===================================================================
-SYSTEM_SERF=NO
-SERF_CFLAGS=
-SERF_LIBS=
-AC_MSG_CHECKING([which libserf to use])
-if test -n "$with_system_serf" -o -n "$with_system_libs" && \
-  test "$with_system_serf" != "no"; then
-    AC_MSG_RESULT([system])
-    PKG_CHECK_MODULES([SERF], [serf-1 >= 1.1])
-    SYSTEM_SERF=YES
-else
-    AC_MSG_RESULT([internal])
-    SYSTEM_SERF=NO
-    BUILD_TYPE="$BUILD_TYPE SERF"
-fi
-AC_SUBST(SYSTEM_SERF)
-AC_SUBST(SERF_CFLAGS)
-AC_SUBST(SERF_LIBS)
-
-
 dnl ===================================================================
 dnl Check for CoinMP
 dnl ===================================================================
@@ -4564,6 +4491,15 @@ if test -n "$with_system_curl" -o -n "$with_system_libs" && \
    else
       AC_MSG_RESULT([yes])
    fi
+
+   # Does curl use OpenSSL as its SSL implementation? Needed for ucb/source/ucp/webdav.
+   AC_MSG_CHECKING([whether curl uses OpenSSL as its SSL backend])
+   if $CURLCONFIG --ssl-backends | $GREP -q 'OpenSSL'; then
+      AC_MSG_RESULT([yes])
+   else
+      AC_MSG_ERROR([no, cannot use system curl whose SSL backend isn't OpenSSL])
+   fi
+
    CURL_LIBS=`$CURLCONFIG --libs`
    CURL_CFLAGS=`$CURLCONFIG --cflags`
 else
diff --git a/main/curl/curl-wnt.patch b/main/curl/curl-wnt.patch
new file mode 100644
index 0000000000..b38ad3c4c0
--- /dev/null
+++ b/main/curl/curl-wnt.patch
@@ -0,0 +1,38 @@
+--- misc/build/curl-7.72.0/winbuild/MakefileBuild.vc	2020-08-17 00:28:40.000000000 +0200
++++ misc/build/curl-7.72.0/winbuild/MakefileBuild.vc	2022-04-23 19:57:39.594763000 +0200
+@@ -115,7 +115,7 @@
+ !IFNDEF WITH_DEVEL
+ WITH_DEVEL   = ../../deps
+ !ENDIF
+-DEVEL_INCLUDE= $(WITH_DEVEL)/include
++DEVEL_INCLUDE= $(WITH_DEVEL)/inc/external
+ DEVEL_LIB    = $(WITH_DEVEL)/lib
+ 
+ !IF EXISTS("$(DEVEL_INCLUDE)")
+@@ -233,7 +233,7 @@
+ ZLIB_LIB_DIR = $(ZLIB_PATH)\lib
+ ZLIB_LFLAGS  = $(ZLIB_LFLAGS) "/LIBPATH:$(ZLIB_LIB_DIR)"
+ !ELSE
+-ZLIB_INC_DIR = $(DEVEL_INCLUDE)
++ZLIB_INC_DIR = $(DEVEL_INCLUDE)\zlib
+ ZLIB_LIB_DIR = $(DEVEL_LIB)
+ !ENDIF
+ 
+@@ -568,6 +568,7 @@
+ 	@if not exist "$(LIB_DIROBJ)\vtls" mkdir $(LIB_DIROBJ)\vtls
+ 	@if not exist "$(LIB_DIROBJ)\vssh" mkdir $(LIB_DIROBJ)\vssh
+ 	@if not exist "$(LIB_DIROBJ)\vquic" mkdir $(LIB_DIROBJ)\vquic
++	@if not exist "$(LIB_DIROBJ)\vssh" mkdir $(LIB_DIROBJ)\vssh
+ 
+ $(CURL_DIROBJ):
+ 	@if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)
+@@ -590,6 +591,9 @@
+ 	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
+ 
+ {$(LIBCURL_SRC_DIR)\vquic\}.c{$(LIB_DIROBJ)\vquic\}.obj:
++	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
++
++{$(LIBCURL_SRC_DIR)\vssh\}.c{$(LIB_DIROBJ)\vssh\}.obj:
+ 	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
+ 
+ $(LIB_DIROBJ)\libcurl.res: $(LIBCURL_SRC_DIR)\libcurl.rc
diff --git a/main/curl/makefile.mk b/main/curl/makefile.mk
index 533495b3a5..dafa4a6b30 100644
--- a/main/curl/makefile.mk
+++ b/main/curl/makefile.mk
@@ -39,7 +39,7 @@ all:
 
 TARFILE_NAME=curl-7.72.0
 TARFILE_MD5=7422feb126df677d2d33294a1fd079ea
-PATCH_FILES=buildssh.patch
+PATCH_FILES=curl-wnt.patch
 
 #ADDITIONAL_FILES= lib$/config-os2.h lib$/Makefile.os2
 
@@ -58,7 +58,7 @@ curl_LDFLAGS+:=$(ARCH_FLAGS)
 CONFIGURE_DIR=.$/
 #relative to CONFIGURE_DIR
 CONFIGURE_ACTION=.$/configure
-CONFIGURE_FLAGS= --without-ssl --without-libidn --enable-ftp --enable-ipv6 --enable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --disable-static CPPFLAGS="$(curl_CFLAGS)"  LDFLAGS="$(curl_LDFLAGS)"
+CONFIGURE_FLAGS= --with-ssl --without-libidn --enable-ftp --enable-ipv6 --enable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --disable-static CPPFLAGS="$(curl_CFLAGS)"  LDFLAGS="$(curl_LDFLAGS)"
 
 BUILD_DIR=$(CONFIGURE_DIR)$/lib
 BUILD_ACTION=$(GNUMAKE)
@@ -81,7 +81,7 @@ curl_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
 CONFIGURE_DIR=.$/
 #relative to CONFIGURE_DIR
 CONFIGURE_ACTION=.$/configure
-CONFIGURE_FLAGS= --without-ssl --enable-ftp --enable-ipv6 --disable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --build=i586-pc-mingw32 --host=i586-pc-mingw32 CC="$(curl_CC)" CPPFLAGS="$(INCLUDE)" OBJDUMP="objdump" LDFLAGS="-L$(ILIB:s/;/ -L/)" LIBS="$(curl_LIBS)"
+CONFIGURE_FLAGS= --with-ssl --enable-ftp --enable-ipv6 --enable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --build=i586-pc-mingw32 --host=i586-pc-mingw32 CC="$(curl_CC)" CPPFLAGS="$(INCLUDE)" OBJDUMP="objdump" LDFLAGS="-L$(ILIB:s/;/ -L/)" LIBS="$(curl_LIBS)"
 BUILD_DIR=$(CONFIGURE_DIR)$/lib
 BUILD_ACTION=make
 OUT2BIN=$(BUILD_DIR)$/.libs$/libcurl*.dll
@@ -104,17 +104,17 @@ curl_MACHINE:="X64"
 
 BUILD_DIR=.$/winbuild
 .IF "$(debug)"==""
-BUILD_ACTION=CC="cl.exe" nmake -f Makefile.vc mode=dll VC=9 EXCFLAGS=$(EXCFLAGS) MACHINE=$(curl_MACHINE)
+BUILD_ACTION=CC="cl.exe" nmake -f Makefile.vc mode=dll VC=9 EXCFLAGS=$(EXCFLAGS) MACHINE=$(curl_MACHINE) RTLIBCFG=static WITH_DEVEL=$(OUTDIR) WITH_ZLIB=dll WITH_SSL=dll
 .ELSE
-BUILD_ACTION=CC="cl.exe" nmake -f Makefile.vc mode=dll VC=9 DEBUG=yes EXCFLAGS=$(EXCFLAGS) MACHINE=$(curl_MACHINE)
+BUILD_ACTION=CC="cl.exe" nmake -f Makefile.vc mode=dll VC=9 DEBUG=yes EXCFLAGS=$(EXCFLAGS) MACHINE=$(curl_MACHINE) RTLIBCFG=static WITH_DEVEL=$(OUTDIR) WITH_ZLIB=dll WITH_SSL=dll
 .ENDIF
 
 .IF "$(CPUNAME)"=="INTEL"
-OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-release-dll-ipv6-sspi-schannel/bin/libcurl.dll
-OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-release-dll-ipv6-sspi-schannel/lib/libcurl.lib
+OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-release-dll-ssl-dll-zlib-dll-ipv6-sspi/bin/libcurl.dll
+OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X86-release-dll-ssl-dll-zlib-dll-ipv6-sspi/lib/libcurl.lib
 .ELIF "$(CPUNAME)"=="X86_64"
-OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-release-dll-ipv6-sspi-schannel/bin/libcurl.dll
-OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-release-dll-ipv6-sspi-schannel/lib/libcurl.lib
+OUT2BIN=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-release-dll-ssl-dll-zlib-dll-ipv6-sspi/bin/libcurl.dll
+OUT2LIB=$(BUILD_DIR)$/../builds/libcurl-vc9-X64-release-dll-ssl-dll-zlib-dll-ipv6-sspi/lib/libcurl.lib
 .ENDIF
 
 .ENDIF
diff --git a/main/curl/prj/build.lst b/main/curl/prj/build.lst
index d3aab47811..46a7d3b613 100644
--- a/main/curl/prj/build.lst
+++ b/main/curl/prj/build.lst
@@ -1,3 +1,3 @@
-xc	curl	:	stlport external NULL
+xc	curl	:	stlport external OPENSSL:openssl ZLIB:zlib NULL
 xc	curl	usr1	-	all	xc_mkout NULL
 xc	curl	nmake	-	all	xc_curl NULL
diff --git a/main/external_deps.lst b/main/external_deps.lst
index 1ed310164e..072031667e 100644
--- a/main/external_deps.lst
+++ b/main/external_deps.lst
@@ -126,12 +126,6 @@ if ( true )
     URL1 = https://sourceforge.net/projects/icu/files/ICU4C/4.0.1/$(name)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
-if ( true )
-    SHA1 = f65fbbd72926c8e7cf0dbd4ada03b0d226f461fd
-    name = serf-1.2.1.tar.bz2
-    URL1 = https://archive.apache.org/dist/serf/serf-1.2.1.tar.bz2
-    URL2 = $(OOO_EXTRAS)$(SHA1)-$(name)
-
 if (SOLAR_JAVA==TRUE && (ENABLE_MEDIAWIKI==YES || ENABLE_REPORTBUILDER==YES))
     MD5 = e8e197d628436490886d17cffa108fe3
     name = commons-logging-1.1.3-src.tar.gz
@@ -162,18 +156,6 @@ if (SYSTEM_OPENSSL!=YES && DISABLE_OPENSSL!=TRUE)
     URL1 = https://www.openssl.org/source/old/1.0.2/$(name)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
-if ( true )
-    MD5 = 0759294408daace192c935b7c9e76e04
-    name = apr-1.6.5.tar.gz
-    URL1 = https://archive.apache.org/dist/apr/$(name)
-    URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
-
-if ( true )
-    MD5 = bd502b9a8670a8012c4d90c31a84955f
-    name = apr-util-1.6.1.tar.gz
-    URL1 = https://archive.apache.org/dist/apr/$(name)
-    URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
-
 if (SYSTEM_LIBXML != YES)
     MD5 = 10942a1dc23137a8aa07f0639cbfece5
     name = libxml2-2.9.10.tar.gz
diff --git a/main/scp2/prj/build.lst b/main/scp2/prj/build.lst
index 46b8008c6e..bc387ead46 100644
--- a/main/scp2/prj/build.lst
+++ b/main/scp2/prj/build.lst
@@ -1,4 +1,4 @@
-cp    scp2    :    L10N:l10n i18npool setup_native l10ntools PYTHON:python ICU:icu REDLAND:redland LIBXSLT:libxslt APR:apr apr-util SERF:serf NULL
+cp    scp2    :    L10N:l10n i18npool setup_native l10ntools PYTHON:python ICU:icu REDLAND:redland LIBXSLT:libxslt NULL
 cp    scp2                        usr1     -    all    cp_mkout NULL
 cp    scp2\macros                 nmake    -    all    cp_langmacros NULL
 cp    scp2\source\templates       nmake    -    all    cp_langtemplates NULL
diff --git a/main/scp2/source/ooo/file_library_ooo.scp b/main/scp2/source/ooo/file_library_ooo.scp
index f3435a8b6a..7e7c39d7ba 100644
--- a/main/scp2/source/ooo/file_library_ooo.scp
+++ b/main/scp2/source/ooo/file_library_ooo.scp
@@ -2010,64 +2010,3 @@ End
 #endif
 #endif
 
-// AF: is this still needed with explicit support for system apr,apr-util,serf ?
-#if !defined(OS2) // using system libs
-
-#ifdef APR_MAJOR 
-File gid_File_Lib_Apr
-     #ifdef WNT
-        Name = SPECIAL_NAME(libapr-1);
-     #else
-	// Looks like the major version number is part of the name, not
-	// part of the suffix.  An error?
-	#ifdef MACOSX
-            Name = STRING(CONCAT2(libapr-1,UNXSUFFIX));
-	#elif FREEBSD
-            Name = STRING(CONCAT3(libapr-1,UNXSUFFIX,.5));
-        #else
-            Name = STRING(CONCAT6(libapr-1,UNXSUFFIX,.0.,APR_MINOR,.,APR_MICRO));
-        #endif
-     #endif
-     PACKED_LIB_FILE_BODY;
-End
-#endif
-
-#ifdef APR_UTIL_MAJOR
-File gid_File_Lib_AprUtil
-    #ifdef WNT
-        Name = SPECIAL_NAME(apr-util);
-    #else
-	// Looks like the major version number is part of the name, not
-	// part of the suffix.  An error?
-	#ifdef MACOSX
-	    Name = STRING(CONCAT2(libaprutil-1,UNXSUFFIX));
-	#elif FREEBSD
-            Name = STRING(CONCAT3(libaprutil-1,UNXSUFFIX,.5));
-	#else
-            Name = STRING(CONCAT6(libaprutil-1,UNXSUFFIX,.0.,APR_UTIL_MINOR,.,APR_UTIL_MICRO));
-	#endif
-    #endif
-    PACKED_LIB_FILE_BODY;
-End
-#endif
-
-#ifdef SERF_MAJOR
-File gid_File_Lib_Serf
-    #ifdef WNT
-        Name = SPECIAL_NAME(serf);
-    #else
-	// Looks like the major version number is part of the name, not
-	// part of the suffix.  An error?
-	#ifdef MACOSX
-            Name = STRING(CONCAT3(libserf-,SERF_MAJOR,UNXSUFFIX));
-	#elif FREEBSD
-            Name = STRING(CONCAT3(libserf-1,UNXSUFFIX,.0));
-	#else
-            Name = STRING(CONCAT3(libserf-1,UNXSUFFIX,.0.0.0));
-	#endif
-    #endif
-    PACKED_LIB_FILE_BODY;
-End
-#endif
-
-#endif // !defined(OS2)
diff --git a/main/scp2/source/ooo/makefile.mk b/main/scp2/source/ooo/makefile.mk
index 10f4805b39..f5ce610c4a 100644
--- a/main/scp2/source/ooo/makefile.mk
+++ b/main/scp2/source/ooo/makefile.mk
@@ -231,29 +231,6 @@ SCPDEFS+=-DOPENSSL
 SCPDEFS+=-DDISABLE_ATL
 .ENDIF
 
-# Detect version numbers for apr, apr-util, serf.
-.IF "$(SYSTEM_APR)"!="YES"
-.INCLUDE : apr_version.mk
-SCPDEFS+=\
-    -DAPR_MAJOR=$(APR_MAJOR)		\
-    -DAPR_MINOR=$(APR_MINOR)		\
-    -DAPR_MICRO=$(APR_MICRO)
-.ENDIF
-.IF "$(SYSTEM_APR_UTIL)"!="YES"
-.INCLUDE : aprutil_version.mk
-SCPDEFS+=\
-    -DAPR_UTIL_MAJOR=$(APR_UTIL_MAJOR)	\
-    -DAPR_UTIL_MINOR=$(APR_UTIL_MINOR)	\
-    -DAPR_UTIL_MICRO=$(APR_UTIL_MICRO)
-.ENDIF
-.IF "$(SYSTEM_SERF)"!="YES"
-.INCLUDE : serf_version.mk
-SCPDEFS+=\
-    -DSERF_MAJOR=$(SERF_MAJOR)		\
-    -DSERF_MINOR=$(SERF_MINOR)		\
-    -DSERF_MICRO=$(SERF_MICRO)
-.ENDIF
-
 .IF "$(SYSTEM_PYTHON)" == "YES"
 SCPDEFS+=-DSYSTEM_PYTHON
 .ENDIF
diff --git a/main/scp2/source/ooo/shortcut_ooo.scp b/main/scp2/source/ooo/shortcut_ooo.scp
index 9fbc33f7f7..80bc4224b8 100644
--- a/main/scp2/source/ooo/shortcut_ooo.scp
+++ b/main/scp2/source/ooo/shortcut_ooo.scp
@@ -105,51 +105,4 @@ End
 
 #endif
 
-#ifdef UNX
-
-// Create links to the fully quantified libraries apr, apr-util, and serf.
-// The major version number is handled in a non-standard way (part of the name).
-// Therefore the hard-coded .0 suffix.
-
-#ifdef APR_MAJOR 
-Shortcut gid_Shortcut_Lib_Apr
-    FileID = gid_File_Lib_Apr;
-    Dir = SCP2_OOO_BIN_DIR;
-    #ifdef MACOSX
-        Name = STRING(CONCAT2(libapr-1.0,UNXSUFFIX));
-    #else
-        Name = STRING(CONCAT3(libapr-1,UNXSUFFIX,.0));
-    #endif
-    Styles = (NETWORK,RELATIVE,FORCE_INTO_UPDATE_PACKAGE);
-End
-#endif
-
-#ifdef APR_UTIL_MAJOR
-Shortcut gid_Shortcut_Lib_AprUtil
-    FileID = gid_File_Lib_AprUtil;
-    Dir = SCP2_OOO_BIN_DIR;
-    #ifdef MACOSX
-        Name = STRING(CONCAT2(libaprutil-1.0,UNXSUFFIX));
-    #else
-        Name = STRING(CONCAT3(libaprutil-1,UNXSUFFIX,.0));
-    #endif
-    Styles = (NETWORK,RELATIVE,FORCE_INTO_UPDATE_PACKAGE);
-End
-#endif
-
-#ifdef SERF_MAJOR
-Shortcut gid_Shortcut_Lib_Serf
-    FileID = gid_File_Lib_Serf;
-    Dir = SCP2_OOO_BIN_DIR;
-    #ifdef MACOSX
-        Name = STRING(CONCAT2(libserf-1.0,UNXSUFFIX));
-    #else
-        Name = STRING(CONCAT3(libserf-1,UNXSUFFIX,.0));
-    #endif
-    Styles = (NETWORK,RELATIVE,FORCE_INTO_UPDATE_PACKAGE);
-End
-#endif
-
-#endif
-
 //i44154 -end-
diff --git a/main/set_soenv.in b/main/set_soenv.in
index b57d46cf41..0af5fa2423 100644
--- a/main/set_soenv.in
+++ b/main/set_soenv.in
@@ -1983,15 +1983,6 @@ ToFile( "SYSTEM_SAXON",      "@SYSTEM_SAXON@",     "e" );
 ToFile( "SAXON_JAR",         "@SAXON_JAR@",        "e" );
 ToFile( "DISABLE_SAXON",     "@DISABLE_SAXON@",    "e" );
 ToFile( "ENABLE_JAVASCRIPT", "@ENABLE_JAVASCRIPT@","e" );
-ToFile( "SYSTEM_APR",        "@SYSTEM_APR@",       "e" );
-ToFile( "APR_CFLAGS",        "@APR_CFLAGS@",       "e" );
-ToFile( "APR_LIBS",          "@APR_LIBS@",         "e" );
-ToFile( "SYSTEM_APR_UTIL",   "@SYSTEM_APR_UTIL@",  "e" );
-ToFile( "APR_UTIL_CFLAGS",   "@APR_UTIL_CFLAGS@",  "e" );
-ToFile( "APR_UTIL_LIBS",     "@APR_UTIL_LIBS@",    "e" );
-ToFile( "SYSTEM_SERF",       "@SYSTEM_SERF@",      "e" );
-ToFile( "SERF_CFLAGS",       "@SERF_CFLAGS@",      "e" );
-ToFile( "SERF_LIBS",         "@SERF_LIBS@",        "e" );
 ToFile( "SYSTEM_COINMP",     "@SYSTEM_COINMP@",    "e" );
 ToFile( "ENABLE_COINMP",     "@ENABLE_COINMP@",    "e" );
 ToFile( "COINMP_CFLAGS",     "@COINMP_CFLAGS@",    "e" );
diff --git a/main/ucb/Library_ucpdav1.mk b/main/ucb/Library_ucpdav1.mk
index 1e074b7e28..697662fe25 100644
--- a/main/ucb/Library_ucpdav1.mk
+++ b/main/ucb/Library_ucpdav1.mk
@@ -65,11 +65,9 @@ $(eval $(call gb_Library_add_linked_libs,ucpdav1,\
 ))
 endif
 
-$(call gb_Library_use_external,ucpdav1,apr)
-$(call gb_Library_use_external,ucpdav1,apr_util)
+$(call gb_Library_use_external,ucpdav1,curl)
 $(call gb_Library_use_external,ucpdav1,libxml2)
 $(call gb_Library_use_external,ucpdav1,openssl)
-$(call gb_Library_use_external,ucpdav1,serf)
 
 $(eval $(call gb_Library_add_exception_objects,ucpdav1,\
 	ucb/source/ucp/webdav/webdavservices \
@@ -82,29 +80,15 @@ $(eval $(call gb_Library_add_exception_objects,ucpdav1,\
 	ucb/source/ucp/webdav/DAVProperties \
 	ucb/source/ucp/webdav/DAVSessionFactory \
 	ucb/source/ucp/webdav/DAVResourceAccess \
-	ucb/source/ucp/webdav/AprEnv \
 	ucb/source/ucp/webdav/webdavresponseparser \
-	ucb/source/ucp/webdav/SerfUri \
-	ucb/source/ucp/webdav/SerfRequestProcessor \
-	ucb/source/ucp/webdav/SerfRequestProcessorImpl \
-	ucb/source/ucp/webdav/SerfRequestProcessorImplFac \
-	ucb/source/ucp/webdav/SerfPropFindReqProcImpl \
-	ucb/source/ucp/webdav/SerfPropPatchReqProcImpl \
-	ucb/source/ucp/webdav/SerfGetReqProcImpl \
-	ucb/source/ucp/webdav/SerfHeadReqProcImpl \
-	ucb/source/ucp/webdav/SerfPutReqProcImpl \
-	ucb/source/ucp/webdav/SerfPostReqProcImpl \
-	ucb/source/ucp/webdav/SerfDeleteReqProcImpl \
-	ucb/source/ucp/webdav/SerfMkColReqProcImpl \
-	ucb/source/ucp/webdav/SerfCopyReqProcImpl \
-	ucb/source/ucp/webdav/SerfMoveReqProcImpl \
-	ucb/source/ucp/webdav/SerfLockReqProcImpl \
-	ucb/source/ucp/webdav/SerfLockRefreshProcImpl \
-	ucb/source/ucp/webdav/SerfUnlockProcImpl \
-	ucb/source/ucp/webdav/SerfLockStore \
-	ucb/source/ucp/webdav/SerfSession \
-	ucb/source/ucp/webdav/SerfCallbacks \
-	ucb/source/ucp/webdav/SerfInputStream \
+	ucb/source/ucp/webdav/CurlSession \
+	ucb/source/ucp/webdav/CurlRequest \
+	ucb/source/ucp/webdav/CurlLockStore \
+	ucb/source/ucp/webdav/LockRequest \
+	ucb/source/ucp/webdav/PropfindRequest \
+	ucb/source/ucp/webdav/ProppatchRequest \
+	ucb/source/ucp/webdav/CurlUri \
+	ucb/source/ucp/webdav/CurlInputStream \
 	ucb/source/ucp/webdav/DateTimeHelper \
 	ucb/source/ucp/webdav/UCBDeadPropertyValue \
 ))
diff --git a/main/ucb/prj/build.lst b/main/ucb/prj/build.lst
index 8272c9235c..3fba3fbe2a 100644
--- a/main/ucb/prj/build.lst
+++ b/main/ucb/prj/build.lst
@@ -1,3 +1,3 @@
-uc ucb : cppuhelper CURL:curl OPENSSL:openssl LIBXML2:libxml2 LIBXSLT:libxslt offapi sal salhelper ucbhelper udkapi comphelper SERF:serf tools NULL
+uc ucb : cppuhelper CURL:curl OPENSSL:openssl LIBXML2:libxml2 LIBXSLT:libxslt offapi sal salhelper ucbhelper udkapi comphelper tools NULL
 uc	ucb							usr1	-	all	uc_mkout NULL
 uc	ucb\prj					    nmake	-	all	uc_prj NULL
diff --git a/main/ucb/source/ucp/webdav/ContentProperties.cxx b/main/ucb/source/ucp/webdav/ContentProperties.cxx
index 0e5f86de42..a0c04e6f3a 100644
--- a/main/ucb/source/ucp/webdav/ContentProperties.cxx
+++ b/main/ucb/source/ucp/webdav/ContentProperties.cxx
@@ -31,7 +31,7 @@
  *************************************************************************/
 #include <osl/diagnose.h>
 #include <com/sun/star/util/DateTime.hpp>
-#include "SerfUri.hxx"
+#include "CurlUri.hxx"
 #include "DAVResource.hxx"
 #include "DAVProperties.hxx"
 #include "DateTimeHelper.hxx"
@@ -97,7 +97,7 @@ ContentProperties::ContentProperties( const DAVResource& rResource )
     // Title
     try
     {
-        SerfUri aURI( rResource.uri );
+        CurlUri aURI( rResource.uri );
         m_aEscapedTitle = aURI.GetPathBaseName();
 
         (*m_xProps)[ rtl::OUString::createFromAscii( "Title" ) ]
diff --git a/main/ucb/source/ucp/webdav/SerfInputStream.cxx b/main/ucb/source/ucp/webdav/CurlInputStream.cxx
similarity index 86%
rename from main/ucb/source/ucp/webdav/SerfInputStream.cxx
rename to main/ucb/source/ucp/webdav/CurlInputStream.cxx
index 32b7df3923..2d72b6a201 100644
--- a/main/ucb/source/ucp/webdav/SerfInputStream.cxx
+++ b/main/ucb/source/ucp/webdav/CurlInputStream.cxx
@@ -23,7 +23,7 @@
 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_webdav.hxx"
-#include "SerfInputStream.hxx"
+#include "CurlInputStream.hxx"
 #include <rtl/memory.h>
 
 using namespace cppu;
@@ -36,16 +36,17 @@ using namespace http_dav_ucp;
 // -------------------------------------------------------------------
 // Constructor
 // -------------------------------------------------------------------
-SerfInputStream::SerfInputStream( void )
+CurlInputStream::CurlInputStream( void )
 : mLen( 0 ),
-  mPos( 0 )
+  mPos( 0 ),
+  mCapacity( 0 )
 {
 }
 
 // -------------------------------------------------------------------
 // Destructor
 // -------------------------------------------------------------------
-SerfInputStream::~SerfInputStream( void )
+CurlInputStream::~CurlInputStream( void )
 {
 }
 
@@ -53,17 +54,24 @@ SerfInputStream::~SerfInputStream( void )
 // AddToStream
 // Allows the caller to add some data to the "end" of the stream
 // -------------------------------------------------------------------
-void SerfInputStream::AddToStream( const char * inBuf, sal_Int32 inLen )
+void CurlInputStream::AddToStream( const char * inBuf, sal_Int32 inLen )
 {
-    mInputBuffer.realloc( sal::static_int_cast<sal_Int32>(mLen) + inLen );
+    if ( mLen + inLen > mCapacity )
+    {
+        if ( 2*mCapacity >= ( mLen + inLen ) )
+            mCapacity *= 2;
+        else
+            mCapacity = mLen + inLen;
+        mInputBuffer.realloc( mCapacity );
+    }
     rtl_copyMemory( mInputBuffer.getArray() + mLen, inBuf, inLen );
-	mLen += inLen;
+    mLen += inLen;
 }
 
 // -------------------------------------------------------------------
 // queryInterface
 // -------------------------------------------------------------------
-Any SerfInputStream::queryInterface( const Type &type )
+Any CurlInputStream::queryInterface( const Type &type )
 						throw( RuntimeException )
 {
 	Any aRet = ::cppu::queryInterface( type,
@@ -76,7 +84,7 @@ Any SerfInputStream::queryInterface( const Type &type )
 // readBytes
 // "Reads" the specified number of bytes from the stream
 // -------------------------------------------------------------------
-sal_Int32 SAL_CALL SerfInputStream::readBytes(
+sal_Int32 SAL_CALL CurlInputStream::readBytes(
   ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead )
 		throw( ::com::sun::star::io::NotConnectedException,
 			   ::com::sun::star::io::BufferSizeExceededException,
@@ -105,7 +113,7 @@ sal_Int32 SAL_CALL SerfInputStream::readBytes(
 // -------------------------------------------------------------------
 // readSomeBytes
 // -------------------------------------------------------------------
-sal_Int32 SAL_CALL SerfInputStream::readSomeBytes(
+sal_Int32 SAL_CALL CurlInputStream::readSomeBytes(
  ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead )
         throw( ::com::sun::star::io::NotConnectedException,
                ::com::sun::star::io::BufferSizeExceededException,
@@ -120,7 +128,7 @@ sal_Int32 SAL_CALL SerfInputStream::readSomeBytes(
 // skipBytes
 // Moves the current stream position forward
 // -------------------------------------------------------------------
-void SAL_CALL SerfInputStream::skipBytes( sal_Int32 nBytesToSkip )
+void SAL_CALL CurlInputStream::skipBytes( sal_Int32 nBytesToSkip )
         throw( ::com::sun::star::io::NotConnectedException,
                ::com::sun::star::io::BufferSizeExceededException,
                ::com::sun::star::io::IOException,
@@ -135,7 +143,7 @@ void SAL_CALL SerfInputStream::skipBytes( sal_Int32 nBytesToSkip )
 // available
 // Returns the number of unread bytes currently remaining on the stream
 // -------------------------------------------------------------------
-sal_Int32 SAL_CALL SerfInputStream::available(  )
+sal_Int32 SAL_CALL CurlInputStream::available(  )
         throw( ::com::sun::star::io::NotConnectedException,
                ::com::sun::star::io::IOException,
                ::com::sun::star::uno::RuntimeException )
@@ -146,7 +154,7 @@ sal_Int32 SAL_CALL SerfInputStream::available(  )
 // -------------------------------------------------------------------
 // closeInput
 // -------------------------------------------------------------------
-void SAL_CALL SerfInputStream::closeInput( void )
+void SAL_CALL CurlInputStream::closeInput( void )
  		throw( ::com::sun::star::io::NotConnectedException,
        		   ::com::sun::star::io::IOException,
        		   ::com::sun::star::uno::RuntimeException )
@@ -156,7 +164,7 @@ void SAL_CALL SerfInputStream::closeInput( void )
 // -------------------------------------------------------------------
 // seek
 // -------------------------------------------------------------------
-void SAL_CALL SerfInputStream::seek( sal_Int64 location )
+void SAL_CALL CurlInputStream::seek( sal_Int64 location )
 		throw( ::com::sun::star::lang::IllegalArgumentException,
 			   ::com::sun::star::io::IOException,
 			   ::com::sun::star::uno::RuntimeException )
@@ -173,7 +181,7 @@ void SAL_CALL SerfInputStream::seek( sal_Int64 location )
 // -------------------------------------------------------------------
 // getPosition
 // -------------------------------------------------------------------
-sal_Int64 SAL_CALL SerfInputStream::getPosition()
+sal_Int64 SAL_CALL CurlInputStream::getPosition()
 		throw( ::com::sun::star::io::IOException,
 			   ::com::sun::star::uno::RuntimeException )
 {
@@ -183,7 +191,7 @@ sal_Int64 SAL_CALL SerfInputStream::getPosition()
 // -------------------------------------------------------------------
 // getLength
 // -------------------------------------------------------------------
-sal_Int64 SAL_CALL SerfInputStream::getLength()
+sal_Int64 SAL_CALL CurlInputStream::getLength()
 		throw( ::com::sun::star::io::IOException,
 			   ::com::sun::star::uno::RuntimeException )
 {
diff --git a/main/ucb/source/ucp/webdav/SerfInputStream.hxx b/main/ucb/source/ucp/webdav/CurlInputStream.hxx
similarity index 93%
rename from main/ucb/source/ucp/webdav/SerfInputStream.hxx
rename to main/ucb/source/ucp/webdav/CurlInputStream.hxx
index 1c38f2f4a9..24628ee14d 100644
--- a/main/ucb/source/ucp/webdav/SerfInputStream.hxx
+++ b/main/ucb/source/ucp/webdav/CurlInputStream.hxx
@@ -20,8 +20,8 @@
  *************************************************************/
 
 
-#ifndef INCLUDED_NEONINPUTSTREAM_HXX
-#define INCLUDED_NEONINPUTSTREAM_HXX
+#ifndef INCLUDED_CURLINPUTSTREAM_HXX
+#define INCLUDED_CURLINPUTSTREAM_HXX
 
 #include <sal/types.h>
 #include <rtl/ustring.hxx>
@@ -34,11 +34,11 @@ namespace http_dav_ucp
 {
 
 // -------------------------------------------------------------------
-// SerfInputStream
+// CurlInputStream
 // A simple XInputStream implementation provided specifically for use
 // by the DAVSession::GET method.
 // -------------------------------------------------------------------
-class SerfInputStream : public ::com::sun::star::io::XInputStream,
+class CurlInputStream : public ::com::sun::star::io::XInputStream,
 						public ::com::sun::star::io::XSeekable,
 						public ::cppu::OWeakObject
 {
@@ -46,10 +46,11 @@ class SerfInputStream : public ::com::sun::star::io::XInputStream,
 		com::sun::star::uno::Sequence< sal_Int8 > mInputBuffer;
 		sal_Int64 mLen;
 		sal_Int64 mPos;
+        sal_Int64 mCapacity;
 
 	public:
-				 SerfInputStream( void );
-		virtual ~SerfInputStream();
+				 CurlInputStream( void );
+		virtual ~CurlInputStream();
 
 		// Add some data to the end of the stream
 		void AddToStream( const char * inBuf, sal_Int32 inLen );
@@ -118,4 +119,4 @@ class SerfInputStream : public ::com::sun::star::io::XInputStream,
 
 } // namespace http_dav_ucp
 
-#endif // INCLUDED_NEONINPUTSTREAM_HXX
+#endif // INCLUDED_CURLINPUTSTREAM_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfLockStore.cxx b/main/ucb/source/ucp/webdav/CurlLockStore.cxx
similarity index 86%
rename from main/ucb/source/ucp/webdav/SerfLockStore.cxx
rename to main/ucb/source/ucp/webdav/CurlLockStore.cxx
index bbe409b685..a3f23a5626 100644
--- a/main/ucb/source/ucp/webdav/SerfLockStore.cxx
+++ b/main/ucb/source/ucp/webdav/CurlLockStore.cxx
@@ -27,9 +27,9 @@
 #include <rtl/ustring.hxx>
 #include <osl/time.h>
 #include <osl/thread.hxx>
-#include "SerfTypes.hxx"
-#include "SerfSession.hxx"
-#include "SerfLockStore.hxx"
+#include "CurlTypes.hxx"
+#include "CurlSession.hxx"
+#include "CurlLockStore.hxx"
 
 using namespace http_dav_ucp;
 
@@ -38,11 +38,11 @@ namespace http_dav_ucp {
 class TickerThread : public osl::Thread
 {
     bool m_bFinish;
-    SerfLockStore & m_rLockStore;
+    CurlLockStore & m_rLockStore;
 
 public:
 
-    TickerThread( SerfLockStore & rLockStore )
+    TickerThread( CurlLockStore & rLockStore )
     : osl::Thread(), m_bFinish( false ), m_rLockStore( rLockStore ) {}
 
     void finish() { m_bFinish = true; }
@@ -81,25 +81,25 @@ void TickerThread::run()
 }
 
 // -------------------------------------------------------------------
-SerfLockStore::SerfLockStore()
+CurlLockStore::CurlLockStore()
     : m_pTickerThread( 0 )
 {
 }
 
 // -------------------------------------------------------------------
-SerfLockStore::~SerfLockStore()
+CurlLockStore::~CurlLockStore()
 {
     stopTicker();
 
     // release active locks, if any.
     OSL_ENSURE( m_aLockInfoMap.size() == 0,
-                "SerfLockStore::~SerfLockStore - Releasing active locks!" );
+                "CurlLockStore::~CurlLockStore - Releasing active locks!" );
 
     LockInfoMap::const_iterator it( m_aLockInfoMap.begin() );
     const LockInfoMap::const_iterator end( m_aLockInfoMap.end() );
     while ( it != end )
     {
-        SerfLock * pLock = (*it).first;
+        CurlLock * pLock = (*it).first;
         try
         {
             (*it).second.xSession->UNLOCK( pLock );
@@ -112,7 +112,7 @@ SerfLockStore::~SerfLockStore()
 }
 
 // -------------------------------------------------------------------
-void SerfLockStore::startTicker()
+void CurlLockStore::startTicker()
 {
     osl::MutexGuard aGuard( m_aMutex );
 
@@ -124,7 +124,7 @@ void SerfLockStore::startTicker()
 }
 
 // -------------------------------------------------------------------
-void SerfLockStore::stopTicker()
+void CurlLockStore::stopTicker()
 {
     osl::MutexGuard aGuard( m_aMutex );
 
@@ -139,7 +139,7 @@ void SerfLockStore::stopTicker()
 
 #if 0       //not currently used
 // -------------------------------------------------------------------
-void SerfLockStore::registerSession( SerfSession /* aSession */ )
+void CurlLockStore::registerSession( CurlSession /* aSession */ )
 {
     osl::MutexGuard aGuard( m_aMutex );
 
@@ -147,7 +147,7 @@ void SerfLockStore::registerSession( SerfSession /* aSession */ )
 #endif
 
 // -------------------------------------------------------------------
-SerfLock * SerfLockStore::findByUri( rtl::OUString const & rUri)
+CurlLock * CurlLockStore::findByUri( rtl::OUString const & rUri)
 {
     osl::MutexGuard aGuard( m_aMutex );
 
@@ -156,7 +156,7 @@ SerfLock * SerfLockStore::findByUri( rtl::OUString const & rUri)
 
     while ( it != end )
     {
-        SerfLock * pLock = (*it).first;
+        CurlLock * pLock = (*it).first;
         if( pLock->getResourceUri().equals( rUri ) )
         {
             return pLock;
@@ -164,12 +164,12 @@ SerfLock * SerfLockStore::findByUri( rtl::OUString const & rUri)
         ++it;
     }
 
-    return static_cast<SerfLock*>(0);
+    return static_cast<CurlLock*>(0);
 }
 
 // -------------------------------------------------------------------
-void SerfLockStore::addLock( SerfLock * pLock,
-                             rtl::Reference< SerfSession > const & xSession,
+void CurlLockStore::addLock( CurlLock * pLock,
+                             rtl::Reference< CurlSession > const & xSession,
                              sal_Int32 nLastChanceToSendRefreshRequest )
 {
     osl::MutexGuard aGuard( m_aMutex );
@@ -184,7 +184,7 @@ void SerfLockStore::addLock( SerfLock * pLock,
     pLock->getLock().Owner >>= aOwner;
     rtl::OUString   aToken;
     aToken = pLock->getLock().LockTokens[0];
-    OSL_TRACE("SerfLockStore::addLock: new lock added aOwner '%s', token '%s'",
+    OSL_TRACE("CurlLockStore::addLock: new lock added aOwner '%s', token '%s'",
               rtl::OUStringToOString(aOwner, RTL_TEXTENCODING_UTF8).getStr(),
               rtl::OUStringToOString(aToken, RTL_TEXTENCODING_UTF8).getStr() );
 #endif
@@ -193,14 +193,14 @@ void SerfLockStore::addLock( SerfLock * pLock,
 
 #if 0       //not currently used
 // -------------------------------------------------------------------
-void SerfLockStore::updateLock( SerfLock * pLock,
+void CurlLockStore::updateLock( CurlLock * pLock,
                                 sal_Int32 nLastChanceToSendRefreshRequest )
 {
     osl::MutexGuard aGuard( m_aMutex );
 
     LockInfoMap::iterator it( m_aLockInfoMap.find( pLock ) );
     OSL_ENSURE( it != m_aLockInfoMap.end(),
-                "SerfLockStore::updateLock: lock not found!" );
+                "CurlLockStore::updateLock: lock not found!" );
 
     if ( it != m_aLockInfoMap.end() )
     {
@@ -211,7 +211,7 @@ void SerfLockStore::updateLock( SerfLock * pLock,
 #endif
 
 // -------------------------------------------------------------------
-void SerfLockStore::removeLock( SerfLock * pLock )
+void CurlLockStore::removeLock( CurlLock * pLock )
 {
     osl::MutexGuard aGuard( m_aMutex );
 
@@ -221,14 +221,14 @@ void SerfLockStore::removeLock( SerfLock * pLock )
         LockInfo & rInfo = (*it).second;
         rInfo.xSession->release();
         m_aLockInfoMap.erase( pLock );
-        //the caller should deallocate SerfLock class after the call!
+        //the caller should deallocate CurlLock class after the call!
         if ( m_aLockInfoMap.size() == 0 )
             stopTicker();
     }
 }
 
 // -------------------------------------------------------------------
-void SerfLockStore::refreshLocks()
+void CurlLockStore::refreshLocks()
 {
     osl::MutexGuard aGuard( m_aMutex );
 
@@ -252,7 +252,7 @@ void SerfLockStore::refreshLocks()
                 aLock.Owner >>= aOwner;
                 rtl::OUString   aToken;
                 aToken = aLock.LockTokens[0];
-                OSL_TRACE( "SerfLockStore::refreshLocks: refresh started for lock: aOwner '%s', token '%s'",
+                OSL_TRACE( "CurlLockStore::refreshLocks: refresh started for lock: aOwner '%s', token '%s'",
                     rtl::OUStringToOString(aOwner, RTL_TEXTENCODING_UTF8).getStr(),
                     rtl::OUStringToOString(aToken, RTL_TEXTENCODING_UTF8).getStr() );
 #endif
@@ -276,7 +276,7 @@ void SerfLockStore::refreshLocks()
                     // may be just ignore and go on, it's possible the net is temporary down?
                     rInfo.nLastChanceToSendRefreshRequest = -1;
 #if OSL_DEBUG_LEVEL > 0
-                    OSL_TRACE( "SerfLockStore::refreshLocks: Lock '%s' not refreshed! (error: DAVException.mStatusCode %d)",
+                    OSL_TRACE( "CurlLockStore::refreshLocks: Lock '%s' not refreshed! (error: DAVException.mStatusCode %d)",
                          rtl::OUStringToOString(aToken, RTL_TEXTENCODING_UTF8).getStr(), e.getStatus()  );
 #endif
                 }
diff --git a/main/ucb/source/ucp/webdav/SerfLockStore.hxx b/main/ucb/source/ucp/webdav/CurlLockStore.hxx
similarity index 71%
rename from main/ucb/source/ucp/webdav/SerfLockStore.hxx
rename to main/ucb/source/ucp/webdav/CurlLockStore.hxx
index 13ee204560..974d9c6597 100644
--- a/main/ucb/source/ucp/webdav/SerfLockStore.hxx
+++ b/main/ucb/source/ucp/webdav/CurlLockStore.hxx
@@ -20,24 +20,24 @@
  *************************************************************/
 
 
-#ifndef INCLUDED_SERFLOCKSTORE_HXX
-#define INCLUDED_SERFLOCKSTORE_HXX
+#ifndef INCLUDED_CURLLOCKSTORE_HXX
+#define INCLUDED_CURLLOCKSTORE_HXX
 
 #include <map>
 #include <osl/mutex.hxx>
 #include <rtl/ref.hxx>
-#include "SerfTypes.hxx"
-#include "SerfSession.hxx"
+#include "CurlTypes.hxx"
+#include "CurlSession.hxx"
 
 namespace http_dav_ucp
 {
 
 class TickerThread;
-class SerfSession;
+class CurlSession;
 
 struct ltptr
 {
-    bool operator()( const SerfLock * p1, const SerfLock * p2 ) const
+    bool operator()( const CurlLock * p1, const CurlLock * p2 ) const
     {
         return p1 < p2;
     }
@@ -45,45 +45,45 @@ struct ltptr
 
 typedef struct _LockInfo
 {
-    rtl::Reference< SerfSession > xSession;
+    rtl::Reference< CurlSession > xSession;
     sal_Int32 nLastChanceToSendRefreshRequest;
 
     _LockInfo()
         : nLastChanceToSendRefreshRequest( -1 ) {}
 
-    _LockInfo( rtl::Reference< SerfSession > const & _xSession,
+    _LockInfo( rtl::Reference< CurlSession > const & _xSession,
               sal_Int32 _nLastChanceToSendRefreshRequest )
         : xSession( _xSession )
         , nLastChanceToSendRefreshRequest( _nLastChanceToSendRefreshRequest ) {}
 
 } LockInfo;
 
-typedef std::map< SerfLock *, LockInfo, ltptr > LockInfoMap;
+typedef std::map< CurlLock *, LockInfo, ltptr > LockInfoMap;
 
-class SerfLockStore
+class CurlLockStore
 {
     osl::Mutex         m_aMutex;
     TickerThread     * m_pTickerThread;
     LockInfoMap        m_aLockInfoMap;
 
 public:
-    SerfLockStore();
-    ~SerfLockStore();
+    CurlLockStore();
+    ~CurlLockStore();
 
-    void registerSession( SerfSession aSession );
+    void registerSession( CurlSession aSession );
 
-    SerfLock * findByUri( rtl::OUString const & rUri );
+    CurlLock * findByUri( rtl::OUString const & rUri );
 
-    void addLock( SerfLock * pLock,
-                  rtl::Reference< SerfSession > const & xSession,
+    void addLock( CurlLock * pLock,
+                  rtl::Reference< CurlSession > const & xSession,
                   // time in seconds since Jan 1 1970
                   // -1: infinite lock, no refresh
                   sal_Int32 nLastChanceToSendRefreshRequest );
 
-    void updateLock( SerfLock * pLock,
+    void updateLock( CurlLock * pLock,
                      sal_Int32 nLastChanceToSendRefreshRequest );
 
-    void removeLock( SerfLock * pLock );
+    void removeLock( CurlLock * pLock );
 
     void refreshLocks();
 
@@ -94,4 +94,4 @@ private:
 
 } // namespace http_dav_ucp
 
-#endif // INCLUDED_SERFLOCKSTORE_HXX
+#endif // INCLUDED_CURLLOCKSTORE_HXX
diff --git a/main/ucb/source/ucp/webdav/CurlRequest.cxx b/main/ucb/source/ucp/webdav/CurlRequest.cxx
new file mode 100644
index 0000000000..ee6e906e99
--- /dev/null
+++ b/main/ucb/source/ucp/webdav/CurlRequest.cxx
@@ -0,0 +1,391 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_webdav.hxx"
+
+#include "CurlRequest.hxx"
+
+using namespace ::com::sun::star;
+using namespace http_dav_ucp;
+
+CurlRequest::CurlRequest( CURL *curl )
+    : curl( curl )
+    , curlUrl( NULL )
+    , requestHeaders( NULL )
+    , requestBody( NULL )
+    , requestBodyOffset( 0 )
+    , requestBodySize( 0 )
+    , useChunkedEncoding( false )
+    , provideCredentialsCallback( NULL )
+    , provideCredentialsUserdata( NULL )
+    , statusCode( 0 )
+    , responseBodyInputStream( new CurlInputStream() )
+{
+    curl_easy_setopt( curl, CURLOPT_HEADERFUNCTION, Curl_HeaderReceived );
+    curl_easy_setopt( curl, CURLOPT_HEADERDATA, this );
+    curl_easy_setopt( curl, CURLOPT_WRITEFUNCTION, Curl_MoreBodyReceived );
+    curl_easy_setopt( curl, CURLOPT_WRITEDATA, this );
+}
+
+CurlRequest::~CurlRequest()
+{
+    if ( curlUrl != NULL )
+        curl_url_cleanup( curlUrl );
+    curl_easy_setopt( curl, CURLOPT_CURLU, NULL );
+    
+    curl_easy_setopt( curl, CURLOPT_HTTPHEADER, NULL );
+    if ( requestHeaders != NULL )
+        curl_slist_free_all( requestHeaders );
+    curl_easy_setopt( curl, CURLOPT_READFUNCTION, NULL );
+    curl_easy_setopt( curl, CURLOPT_READDATA, NULL );
+    curl_easy_setopt( curl, CURLOPT_INFILESIZE, -1 );
+    curl_easy_setopt( curl, CURLOPT_SEEKFUNCTION, NULL );
+    curl_easy_setopt( curl, CURLOPT_SEEKDATA, NULL );
+    curl_easy_setopt( curl, CURLOPT_HEADERFUNCTION, NULL );
+    curl_easy_setopt( curl, CURLOPT_HEADERDATA, NULL );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, NULL );
+    curl_easy_setopt( curl, CURLOPT_WRITEFUNCTION, NULL );
+    curl_easy_setopt( curl, CURLOPT_WRITEDATA, NULL );
+}
+
+void CurlRequest::addHeader( const rtl::OString &name, const rtl::OString &value) throw (DAVException)
+{
+    rtl::OString line = name + ": " + value;
+    struct curl_slist *appended = curl_slist_append( requestHeaders, line.getStr() );
+    if ( appended != NULL )
+    {
+        requestHeaders = appended;
+        curl_easy_setopt( curl, CURLOPT_HTTPHEADER, requestHeaders );
+    }
+    else
+        throw DAVException( DAVException::DAV_SESSION_CREATE, rtl::OUString::createFromAscii( "Out of memory" ) );
+}
+
+void CurlRequest::setRequestBody( const char *body, size_t size )
+{
+    requestBody = body;
+    requestBodyOffset = 0;
+    requestBodySize = size;
+
+    curl_easy_setopt( curl, CURLOPT_READFUNCTION, Curl_SendMoreBody );
+    curl_easy_setopt( curl, CURLOPT_READDATA, this );
+    curl_easy_setopt( curl, CURLOPT_SEEKFUNCTION, Curl_SeekCallback );
+    curl_easy_setopt( curl, CURLOPT_SEEKDATA, this );
+    if ( useChunkedEncoding )
+        addHeader( "Transfer-Encoding", "chunked" );
+    else
+        curl_easy_setopt( curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)size );
+}
+
+int CurlRequest::Curl_SeekCallback( void *userdata, curl_off_t offset, int origin )
+{
+    CurlRequest *request = static_cast< CurlRequest* >( userdata );
+    if ( origin == SEEK_SET )
+        request->requestBodyOffset = (size_t) offset;
+    else if ( origin == SEEK_CUR )
+        request->requestBodyOffset += (size_t) offset;
+    else if ( origin == SEEK_END )
+        request->requestBodyOffset += (size_t) ((curl_off_t)request->requestBodySize + offset);
+    else
+        return CURL_SEEKFUNC_CANTSEEK;
+    if ( request->requestBodyOffset > request->requestBodySize )
+        request->requestBodyOffset = request->requestBodySize;
+    return CURL_SEEKFUNC_OK;
+}
+
+size_t CurlRequest::Curl_SendMoreBody( char *buffer, size_t size, size_t nitems, void *userdata )
+{
+    CurlRequest *request = static_cast< CurlRequest* >( userdata );
+    OSL_TRACE("Curl_SendMoreBody");
+    return request->curlSendMoreBody( buffer, nitems );
+}
+
+size_t CurlRequest::curlSendMoreBody( char *buffer, size_t len )
+{
+    size_t bytesToSend = requestBodySize - requestBodyOffset;
+    if ( bytesToSend > len )
+        bytesToSend = len;
+    memcpy( buffer, requestBody, bytesToSend );
+    requestBodyOffset += bytesToSend;
+    return bytesToSend;
+}
+
+void CurlRequest::setProvideCredentialsCallback( bool (*callback)(long statusCode, void *userdata) throw (DAVException), void *userdata )
+{
+    provideCredentialsCallback = callback;
+    provideCredentialsUserdata = userdata;
+}
+
+void CurlRequest::setURI( CurlUri uri, rtl::OUString path ) throw (DAVException)
+{
+    if ( curlUrl != NULL )
+    {
+        curl_url_cleanup( curlUrl );
+        curlUrl = NULL;
+    }
+
+    curlUrl = curl_url();
+    if ( curlUrl == NULL )
+        throw DAVException( DAVException::DAV_SESSION_CREATE, rtl::OUString::createFromAscii( "Out of memory" ) );
+
+    if ( CurlUri( path ).GetHost().isEmpty() )
+    {
+        // "path" is really a path, not a URI
+        curl_url_set( curlUrl, CURLUPART_URL, rtl::OUStringToOString( uri.GetURI(), RTL_TEXTENCODING_UTF8 ).getStr(), 0 );
+        curl_url_set( curlUrl, CURLUPART_PATH, rtl::OUStringToOString( path, RTL_TEXTENCODING_UTF8 ).getStr(), 0 );
+    }
+    else
+    {
+        // The "path" is a full URI
+        curl_url_set( curlUrl, CURLUPART_URL, rtl::OUStringToOString( path, RTL_TEXTENCODING_UTF8 ).getStr(), 0 );
+    }
+    curl_easy_setopt( curl, CURLOPT_CURLU, curlUrl );
+}
+
+CURLcode CurlRequest::copy( CurlUri uri, rtl::OUString path ) throw(DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "COPY" );
+    return perform();
+}
+
+CURLcode CurlRequest::delete_( CurlUri uri, rtl::OUString path ) throw (DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "DELETE" );
+    return perform();    
+}
+
+CURLcode CurlRequest::get( CurlUri uri, rtl::OUString path ) throw(DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "GET" );
+    return perform();
+}
+
+CURLcode CurlRequest::head( CurlUri uri, rtl::OUString path ) throw (DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_NOBODY, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "HEAD" );
+    return perform();
+}
+
+CURLcode CurlRequest::lock( CurlUri uri, rtl::OUString path ) throw (DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_UPLOAD, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "LOCK" );
+    return perform();
+}
+
+CURLcode CurlRequest::mkcol( CurlUri uri, rtl::OUString path ) throw (DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "MKCOL" );
+    return perform();
+}
+
+CURLcode CurlRequest::move( CurlUri uri, rtl::OUString path ) throw (DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "MOVE" );
+    return perform();
+}
+
+CURLcode CurlRequest::post( CurlUri uri, rtl::OUString path ) throw (DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_UPLOAD, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "POST" );
+    return perform();
+}
+
+CURLcode CurlRequest::propfind( CurlUri uri, rtl::OUString path ) throw (DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_UPLOAD, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "PROPFIND" );
+    return perform();
+}
+
+CURLcode CurlRequest::proppatch( CurlUri uri, rtl::OUString path ) throw (DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_UPLOAD, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "PROPPATCH" );
+    return perform();
+}
+
+CURLcode CurlRequest::put( CurlUri uri, rtl::OUString path ) throw (DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_UPLOAD, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "PUT" );
+    return perform();
+}
+
+CURLcode CurlRequest::unlock( CurlUri uri, rtl::OUString path ) throw (DAVException)
+{
+    setURI( uri, path );
+    curl_easy_setopt( curl, CURLOPT_HTTPGET, 1L );
+    curl_easy_setopt( curl, CURLOPT_CUSTOMREQUEST, "UNLOCK" );
+    return perform();
+}
+
+CURLcode CurlRequest::perform() throw (DAVException)
+{
+    CURLcode rc = curl_easy_perform( curl );
+    long statusCode = 0;
+    curl_easy_getinfo( curl, CURLINFO_RESPONSE_CODE, &statusCode );
+    if ( ( statusCode == 401 || statusCode == 407 ) && provideCredentialsCallback != NULL )
+    {
+        bool haveCredentials = provideCredentialsCallback( statusCode, provideCredentialsUserdata );
+        if ( haveCredentials )
+        {
+            // rewind body:
+            requestBodyOffset = 0;
+            // retry with credentials:
+            rc = curl_easy_perform( curl );
+            // If this was to authenticate with the proxy, we may need to authenticate
+            // with the destination host too:
+            if ( statusCode == 407 )
+            {
+                curl_easy_getinfo( curl, CURLINFO_RESPONSE_CODE, &statusCode );
+                if ( statusCode == 401 && provideCredentialsCallback != NULL )
+                {
+                    haveCredentials = provideCredentialsCallback( statusCode, provideCredentialsUserdata );
+                    if ( haveCredentials )
+                    {
+                        // rewind body:
+                        requestBodyOffset = 0;
+                        // retry with credentials:
+                        rc = curl_easy_perform( curl );
+                    }
+                }
+            }
+        }
+    }
+    return rc;
+}
+
+size_t CurlRequest::Curl_HeaderReceived( char *buffer, size_t size, size_t nitems, void *userdata )
+{
+    CurlRequest *request = static_cast< CurlRequest* >( userdata );
+    OSL_TRACE("Curl_HeaderReceived");
+    request->curlHeaderReceived( buffer, nitems );
+    return nitems;
+}
+
+void CurlRequest::curlHeaderReceived( const char *buffer, size_t size )
+{
+    rtl::OString lineCrLf( buffer, size );
+    sal_Int32 cr = lineCrLf.indexOf( "\r" );
+    if ( cr < 0 )
+        return;
+
+    rtl::OString line = lineCrLf.copy( 0, cr );
+    if ( line.indexOf( "HTTP/" ) == 0 )
+    {
+        // Status line
+        // Throw away any response headers from a prior response:
+        responseHeaders.clear();
+        sal_Int32 idxFirstSpace = line.indexOf( ' ' );
+        if ( idxFirstSpace > 0 )
+        {
+            int idxSecondSpace = line.indexOf( ' ', idxFirstSpace + 1 );
+            if ( idxSecondSpace > 0 )
+            {
+                reasonPhrase = line.copy( idxSecondSpace + 1 );
+                statusCode = line.copy( idxFirstSpace + 1, idxSecondSpace - idxFirstSpace - 1 ).toInt32();
+            }
+            else
+            {
+                reasonPhrase = "";
+                statusCode = line.copy( idxFirstSpace + 1 ).toInt32();
+            }
+        }
+    }
+    else
+    {
+        // Header line
+        if ( line.getLength() == 0 )
+        {
+            // End of HTTP header
+            // Discard any intermediate body from 100 Trying or 401 Authentication required:
+            responseBodyInputStream = new CurlInputStream();
+            return;
+        }
+        sal_Int32 colon = line.indexOf( ':' );
+        if ( colon < 0 )
+        {
+            OSL_TRACE("Non-empty HTTP line without a ':'. Folded header deprecated by RFC 7230?");
+            return;
+        }
+        Header header;
+        header.name = line.copy( 0, colon ).toAsciiLowerCase();
+        header.value = line.copy( colon + 1 ).trim();
+        responseHeaders.push_back(header);
+    }
+}
+
+const CurlRequest::Header *CurlRequest::findResponseHeader( const rtl::OString &name )
+{
+    std::vector< CurlRequest::Header >::const_iterator it( responseHeaders.begin() );
+    const std::vector< CurlRequest::Header >::const_iterator end( responseHeaders.end() );
+    for ( ; it != end; it++ )
+    {
+        if ( name.equalsIgnoreAsciiCase( it->name ) )
+            return &(*it);
+    }
+    return NULL;
+}
+
+void CurlRequest::saveResponseBodyTo( const uno::Reference< io::XOutputStream > & xOutStream)
+{
+    xOutputStream = xOutStream;
+}
+
+size_t CurlRequest::Curl_MoreBodyReceived( char *buffer, size_t size, size_t nitems, void *userdata )
+{
+    CurlRequest *request = static_cast< CurlRequest* >( userdata );
+    request->curlMoreBodyReceived( buffer, nitems );
+    return nitems;
+}
+
+void CurlRequest::curlMoreBodyReceived( const char *buffer, size_t size )
+{
+    if ( xOutputStream.is() )
+    {
+        const uno::Sequence< sal_Int8 > aDataSeq( (sal_Int8 *)buffer, size );
+        xOutputStream->writeBytes( aDataSeq );
+    }
+    else if ( responseBodyInputStream.is() )
+        responseBodyInputStream->AddToStream( buffer, size );
+}
\ No newline at end of file
diff --git a/main/ucb/source/ucp/webdav/CurlRequest.hxx b/main/ucb/source/ucp/webdav/CurlRequest.hxx
new file mode 100644
index 0000000000..3c7093e0c6
--- /dev/null
+++ b/main/ucb/source/ucp/webdav/CurlRequest.hxx
@@ -0,0 +1,130 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef INCLUDED_CURLREQUEST_HXX
+#define INCLUDED_CURLREQUEST_HXX
+
+#include <vector>
+#include "DAVException.hxx"
+#include <com/sun/star/io/XOutputStream.hpp>
+#include "CurlInputStream.hxx"
+#include "CurlTypes.hxx"
+#include "CurlUri.hxx"
+#include <curl/curl.h>
+
+namespace http_dav_ucp
+{
+
+/* Since Curl persists all settings for the duration of
+ * the CURL* structure, and we need some of them to only last for
+ * the duration of a request, use this class to reset the short-lived
+ * settings at the end of each request using RAII, and to capture
+ * some results in a convenient format.
+ *
+ * Features are opt-in to their non-default values.
+ *
+ * External pointers (CURL*, request body, etc.) are only shared with us,
+ * never copied, temporarily used by us, and never belong to us.
+ */
+class CurlRequest
+{
+public:
+    class Header
+    {
+    public:
+        rtl::OString name;
+        rtl::OString value;
+    };
+    
+    CurlRequest( CURL *curl );
+    ~CurlRequest();
+
+    // Request setup methods:
+    void addHeader( const rtl::OString &name, const rtl::OString &value ) throw (DAVException);
+    void setRequestBody( const char *body, size_t size );
+    bool isChunkedEncoding() { return useChunkedEncoding; }
+    void setChunkedEncoding( bool isChunkedEncoding ) { useChunkedEncoding = isChunkedEncoding; }
+    void saveResponseBodyTo( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xOutputStream );
+    void setProvideCredentialsCallback(
+        bool (*provideCredsCallback)(long statusCode, void *userdata) throw (DAVException),
+        void *credsUserdata );
+
+    // Requests
+    CURLcode copy( CurlUri uri, rtl::OUString path ) throw(DAVException);
+    CURLcode delete_( CurlUri uri, rtl::OUString path ) throw(DAVException);
+    CURLcode get( CurlUri uri, rtl::OUString path ) throw(DAVException);
+    CURLcode head( CurlUri uri, rtl::OUString path ) throw(DAVException);
+    CURLcode lock( CurlUri uri, rtl::OUString path ) throw(DAVException);
+    CURLcode mkcol( CurlUri uri, rtl::OUString path ) throw(DAVException);
+    CURLcode move( CurlUri uri, rtl::OUString path ) throw(DAVException);
+    CURLcode post( CurlUri uri, rtl::OUString path ) throw(DAVException);
+    CURLcode propfind( CurlUri uri, rtl::OUString path ) throw(DAVException);
+    CURLcode proppatch( CurlUri uri, rtl::OUString path ) throw(DAVException);
+    CURLcode put( CurlUri uri, rtl::OUString path ) throw(DAVException);
+    CURLcode unlock( CurlUri uri, rtl::OUString path ) throw(DAVException);
+
+    // Response methods:
+    int getStatusCode() { return statusCode; }
+    rtl::OString& getReasonPhrase() { return reasonPhrase; }
+    // TODO: a multimap would be O(n * log(m)) instead of O(n * m)
+    std::vector<Header>& getResponseHeaders() { return responseHeaders; }
+    const Header *findResponseHeader( const rtl::OString &name );
+    com::sun::star::uno::Reference < CurlInputStream > getResponseBody() { return responseBodyInputStream; }
+    
+private:
+    CurlRequest( const CurlRequest &curlRequest ); // No copy constructor.
+    void setURI( CurlUri uri, rtl::OUString path ) throw (DAVException);
+    CURLcode perform() throw (DAVException);
+    
+    static int Curl_SeekCallback(void *userp, curl_off_t offset, int origin);
+
+    static size_t Curl_SendMoreBody( char *buffer, size_t size, size_t nitems, void *userdata );
+    size_t curlSendMoreBody( char *buffer, size_t len );
+
+    static size_t Curl_HeaderReceived( char *buffer, size_t size, size_t nitems, void *userdata );
+    void curlHeaderReceived( const char *buffer, size_t len );
+
+    static size_t Curl_MoreBodyReceived( char *buffer, size_t size, size_t nitems, void *userdata );
+    void curlMoreBodyReceived( const char *buffer, size_t len );
+
+    CURL *curl;
+    CURLU *curlUrl;
+    
+    // Request values:
+    curl_slist *requestHeaders;
+    const char *requestBody;
+    size_t requestBodyOffset;
+    size_t requestBodySize;
+    bool useChunkedEncoding;
+    bool (*provideCredentialsCallback)( long statusCode, void *userdata ) throw (DAVException);
+    void *provideCredentialsUserdata;
+    
+    // Response values:
+    rtl::OString reasonPhrase;
+    int statusCode;
+    std::vector<Header> responseHeaders;
+    com::sun::star::uno::Reference < CurlInputStream > responseBodyInputStream;
+    com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > xOutputStream;
+};
+
+} // namespace http_dav_ucp
+
+#endif // INCLUDED_CURLREQUEST_HXX
\ No newline at end of file
diff --git a/main/ucb/source/ucp/webdav/CurlSession.cxx b/main/ucb/source/ucp/webdav/CurlSession.cxx
new file mode 100644
index 0000000000..5ca143273e
--- /dev/null
+++ b/main/ucb/source/ucp/webdav/CurlSession.cxx
@@ -0,0 +1,1959 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_webdav.hxx"
+
+#include <hash_map>
+#include <vector>
+#include <string.h>
+#include <rtl/string.h>
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <osl/time.h>
+#include "comphelper/sequence.hxx"
+#include "ucbhelper/simplecertificatevalidationrequest.hxx"
+
+#include "DAVAuthListener.hxx"
+#include "CurlTypes.hxx"
+#include "CurlSession.hxx"
+#include "LockRequest.hxx"
+#include "PropfindRequest.hxx"
+#include "ProppatchRequest.hxx"
+#include "CurlInputStream.hxx"
+#include "UCBDeadPropertyValue.hxx"
+#include "webdavuseragent.hxx"
+#include "webdavresponseparser.hxx"
+#include "webdavprovider.hxx"
+
+
+#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
+#include <com/sun/star/logging/LogLevel.hpp>
+#include <com/sun/star/security/XCertificate.hpp>
+#include <com/sun/star/security/CertificateValidity.hpp>
+#include <com/sun/star/security/CertificateContainerStatus.hpp>
+#include <com/sun/star/security/CertificateContainer.hpp>
+#include <com/sun/star/security/XCertificateContainer.hpp>
+#include <com/sun/star/security/CertAltNameEntry.hpp>
+#include <com/sun/star/security/XSanExtension.hpp>
+#include <com/sun/star/ucb/Lock.hpp>
+#include <com/sun/star/xml/crypto/XSEInitializer.hpp>
+
+using namespace com::sun::star;
+using namespace com::sun::star::logging;
+using namespace http_dav_ucp;
+
+#define OID_SUBJECT_ALTERNATIVE_NAME "2.5.29.17"
+
+struct CredentialsData
+{
+    CredentialsData( CurlSession *curlSession, CurlRequest &curlRequest, const DAVRequestEnvironment &requestEnvironment )
+    : session( curlSession)
+    , request( curlRequest )
+    , env( requestEnvironment )
+    {}
+
+    CurlSession *session;
+    CurlRequest &request;
+    const DAVRequestEnvironment &env;
+};
+
+// -------------------------------------------------------------------
+// static members!
+CurlLockStore CurlSession::m_aCurlLockStore;
+
+
+// -------------------------------------------------------------------
+// Constructor
+// -------------------------------------------------------------------
+CurlSession::CurlSession(
+        const rtl::Reference< DAVSessionFactory > & rSessionFactory,
+        const rtl::OUString& inUri,
+        const ucbhelper::InternetProxyDecider & rProxyDecider )
+    throw ( DAVException )
+    : DAVSession( rSessionFactory )
+    , m_aMutex()
+    , m_aContext( m_xFactory->getServiceFactory() )
+    , m_aLogger( m_aContext.getUNOContext(), WEBDAV_CONTENT_PROVIDER_SERVICE_NAME )
+    , m_aUri( inUri )
+    , m_aProxyName()
+    , m_nProxyPort( 0 )
+    , m_aServerHeaderField()
+    , m_pCurl( 0 )
+    , m_bUseChunkedEncoding( false )
+    , m_bTransferEncodingSwitched( false )
+    , m_rProxyDecider( rProxyDecider )
+    , m_aEnv()
+{
+    m_pCurl = curl_easy_init();
+    
+    curl_easy_setopt( m_pCurl, CURLOPT_HTTPAUTH, CURLAUTH_ANY );
+    curl_easy_setopt( m_pCurl, CURLOPT_PROXYAUTH, CURLAUTH_ANY );
+    
+    curl_easy_setopt( m_pCurl, CURLOPT_SSL_CTX_FUNCTION, Curl_SSLContextCallback );
+    curl_easy_setopt( m_pCurl, CURLOPT_SSL_CTX_DATA, this );
+
+    if ( m_aLogger.getLogLevel() == LogLevel::FINEST )
+    {
+        curl_easy_setopt( m_pCurl, CURLOPT_DEBUGFUNCTION, Curl_DebugCallback );
+        curl_easy_setopt( m_pCurl, CURLOPT_DEBUGDATA, this );
+        curl_easy_setopt( m_pCurl, CURLOPT_VERBOSE, 1L);
+    }
+    m_aLogger.log( LogLevel::INFO, "CurlSession::CurlSession with URL $1$",
+        rtl::OUStringToOString( inUri, RTL_TEXTENCODING_UTF8 ).getStr() );
+}
+
+// -------------------------------------------------------------------
+// Destructor
+// -------------------------------------------------------------------
+CurlSession::~CurlSession( )
+{
+    if ( m_pCurl )
+    {
+        curl_easy_cleanup( m_pCurl );
+        m_pCurl = 0;
+        m_aLogger.log( LogLevel::INFO, "CurlSession::~CurlSession: closed curl session");
+    }
+}
+
+// -------------------------------------------------------------------
+void CurlSession::Init( const DAVRequestEnvironment & rEnv )
+  throw ( DAVException )
+{
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+    m_aEnv = rEnv;
+    Init();
+}
+
+// -------------------------------------------------------------------
+void CurlSession::Init()
+    throw ( DAVException )
+{
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    const sal_Char *url = rtl::OUStringToOString( m_aUri.GetURI(), RTL_TEXTENCODING_UTF8 ).getStr();
+    CURLcode rc;
+    rc = curl_easy_setopt( m_pCurl, CURLOPT_URL, url );
+    if ( rc != CURLE_OK  )
+        throw DAVException( DAVException::DAV_SESSION_CREATE,
+                            CurlUri::makeConnectionEndPointString( m_aUri.GetHost(), m_aUri.GetPort() ) );
+
+    const ucbhelper::InternetProxyServer & rProxyCfg = getProxySettings();
+    if ( ( rProxyCfg.aName != m_aProxyName )
+        || ( rProxyCfg.nPort != m_nProxyPort ) )
+    {
+        m_aProxyName = rProxyCfg.aName;
+        m_nProxyPort = rProxyCfg.nPort;
+        if ( !m_aProxyName.isEmpty() )
+        {
+            m_aLogger.log( LogLevel::INFO, "Using $1$ proxy server at $2$:$3$",
+                m_aUri.GetScheme(), m_aProxyName, m_nProxyPort );
+            curl_easy_setopt( m_pCurl, CURLOPT_PROXY, rtl::OUStringToOString( m_aProxyName, RTL_TEXTENCODING_UTF8 ).getStr() );
+            curl_easy_setopt( m_pCurl, CURLOPT_PROXYPORT, (long)m_nProxyPort );
+            if ( m_aUri.GetScheme().equalsAscii( "https" ) )
+                curl_easy_setopt( m_pCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTPS );
+            else
+                curl_easy_setopt( m_pCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP );
+            // no other proxy types are implemented by AOO
+        }
+        else
+        {
+            // Empty string as opposed to NULL, means don't use the default curl proxy.
+            m_aLogger.log( LogLevel::INFO, "Not using a proxy server" );
+            curl_easy_setopt( m_pCurl, CURLOPT_PROXY, "" );
+        }
+        // if we change the proxy settings, clear the credentials for the previous proxy too
+        curl_easy_setopt( m_pCurl, CURLOPT_PROXYUSERNAME, "" );
+        curl_easy_setopt( m_pCurl, CURLOPT_PROXYPASSWORD, "" );
+    }
+}
+
+bool CurlSession::isSSLNeeded()
+{
+    return m_aUri.GetScheme().equalsIgnoreAsciiCase( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "https" ) ) );
+}
+
+// -------------------------------------------------------------------
+// helper function
+// it composes the uri for lockstore registration
+rtl::OUString CurlSession::composeCurrentUri(const rtl::OUString & inPath)
+{
+    rtl::OUString aScheme( m_aUri.GetScheme() );
+    rtl::OUStringBuffer aBuf( aScheme );
+    aBuf.appendAscii( "://" );
+    if ( m_aUri.GetUserName().getLength() > 0 )
+    {
+        aBuf.append( m_aUri.GetUserName() );
+        if ( m_aUri.GetPassword().getLength() > 0 )
+        {
+            aBuf.appendAscii( ":" );
+            aBuf.append( m_aUri.GetPassword() );
+        }
+        aBuf.appendAscii( "@" );
+    }
+    // Is host a numeric IPv6 address?
+    if ( ( m_aUri.GetHost().indexOf( ':' ) != -1 ) &&
+         ( m_aUri.GetHost()[ 0 ] != sal_Unicode( '[' ) ) )
+    {
+        aBuf.appendAscii( "[" );
+        aBuf.append( m_aUri.GetHost() );
+        aBuf.appendAscii( "]" );
+    }
+    else
+    {
+        aBuf.append( m_aUri.GetHost() );
+    }
+
+    // append port, but only, if not default port.
+    bool bAppendPort = true;
+    sal_Int32 aPort = m_aUri.GetPort();
+    switch ( aPort )
+    {
+    case DEFAULT_HTTP_PORT:
+        bAppendPort = aScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "http" ) );
+        break;
+
+    case DEFAULT_HTTPS_PORT:
+        bAppendPort = !aScheme.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) );
+        break;
+    }
+    if ( bAppendPort )
+    {
+        aBuf.appendAscii( ":" );
+        aBuf.append( rtl::OUString::valueOf( aPort ) );
+    }
+    aBuf.append( inPath );
+
+    rtl::OUString   aUri(aBuf.makeStringAndClear() );
+    return aUri;
+}
+
+// -------------------------------------------------------------------
+// virtual
+sal_Bool CurlSession::CanUse( const rtl::OUString & inUri )
+{
+    try
+    {
+        CurlUri theUri( inUri );
+        if ( ( theUri.GetPort() == m_aUri.GetPort() ) &&
+             ( theUri.GetHost() == m_aUri.GetHost() ) &&
+             ( theUri.GetScheme() == m_aUri.GetScheme() ) )
+        {
+            return sal_True;
+        }
+    }
+    catch ( DAVException const & )
+    {
+        return sal_False;
+    }
+    return sal_False;
+}
+
+// -------------------------------------------------------------------
+// virtual
+sal_Bool CurlSession::UsesProxy()
+{
+    Init();
+    return ( m_aProxyName.getLength() > 0 );
+}
+
+int CurlSession::Curl_DebugCallback( CURL *, curl_infotype type, unsigned char *data, size_t size, void* userdata )
+{
+    CurlSession *session = static_cast< CurlSession* >( userdata );
+    return session->curlDebugOutput( type, reinterpret_cast<char*>( data ), size );
+}
+
+int CurlSession::curlDebugOutput( curl_infotype type, char *data, int size )
+{
+    const char *prefix;
+    switch ( type )
+    {
+        case CURLINFO_TEXT:
+            prefix = "[CurlINFO  ]";
+            break;
+        case CURLINFO_HEADER_IN:
+            prefix = "[CurlHDR <-]";
+            break;
+        case CURLINFO_HEADER_OUT:
+            prefix = "[CurlHDR ->]";
+            break;
+        case CURLINFO_DATA_IN:
+            prefix = "[CurlData<-]";
+            break;
+        case CURLINFO_DATA_OUT:
+            prefix = "[CurlData->]";
+            break;
+        default:
+            return 0;
+    }
+
+    // Trim the trailing \r\n
+    if ( size >= 1 && ( data[size - 1] == '\r' || data[size - 1] == '\n' ) )
+        --size;
+    if ( size >= 1 && ( data[size - 1] == '\r' || data[size - 1] == '\n' ) )
+        --size;
+    rtl::OString message( data, size );
+    m_aLogger.log( LogLevel::FINEST, "$1$ $2$", prefix, message );
+    return 0;
+}
+
+CURLcode CurlSession::Curl_SSLContextCallback( CURL *, void *ssl_ctx, void *userptr )
+{
+    CurlSession *session = static_cast<CurlSession*>( userptr );
+    SSL_CTX *context = static_cast<SSL_CTX*>( ssl_ctx );
+    SSL_CTX_set_app_data( context, session );
+    SSL_CTX_set_verify( context, SSL_VERIFY_PEER, OPENSSL_ValidateServerCertificate );
+    return CURLE_OK;
+}
+
+int CurlSession::OPENSSL_ValidateServerCertificate( int preverify_ok, X509_STORE_CTX *x509_ctx )
+{
+    SSL *ssl = static_cast<SSL*> (
+        X509_STORE_CTX_get_ex_data( x509_ctx, SSL_get_ex_data_X509_STORE_CTX_idx() ) );
+    SSL_CTX *ssl_ctx = SSL_get_SSL_CTX( ssl );
+    CurlSession *session = static_cast<CurlSession*>( SSL_CTX_get_app_data( ssl_ctx ) );
+    int verifyOk = session->validateServerX509Certificate( x509_ctx, preverify_ok );
+    // When a certificate's verification fails within OpenSSL, yet passes from the
+    // SSL_CTX_set_verify() callback (ie. this function) (by returning 1),
+    // OpenSSL allows the connection to proceed, yet stores that last verification
+    // error and allows it to be retrieved using SSL_get_verify_result(3).
+    //
+    // Unfortunately, Curl calls SSL_get_verify_result(3) internally, and treats
+    // errors as terminal, disconnecting with an error even when we return 1 here.
+    // Therefore, to approve a certificate that OpenSSL would reject, we have to
+    // both return 1, and overwrite the X509_STORE_CTX's last error with X509_V_OK:
+    if ( verifyOk )
+        X509_STORE_CTX_set_error( x509_ctx, X509_V_OK );
+    return verifyOk;
+}
+
+static uno::Sequence< sal_Int8 > convertCertificateToAsn1Der( X509 *certificate )
+{
+    uno::Sequence< sal_Int8 > asn1DerCertificate;
+    int len = i2d_X509( certificate, NULL );
+    if ( len < 0 )
+        return asn1DerCertificate;
+    asn1DerCertificate.realloc( len );
+    unsigned char *end = reinterpret_cast< unsigned char *>( asn1DerCertificate.getArray() );
+    len = i2d_X509( certificate, &end );
+    if ( len >= 0 )
+        return asn1DerCertificate;
+    else
+        return uno::Sequence< sal_Int8 >();
+}
+
+int CurlSession::validateServerX509Certificate( X509_STORE_CTX *x509StoreContext, int verifyOk )
+{
+    X509 *serverCertificate = X509_STORE_CTX_get_current_cert( x509StoreContext );
+    int depth = X509_STORE_CTX_get_error_depth( x509StoreContext );
+    STACK_OF(X509) *chain =
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+         X509_STORE_CTX_get0_chain( x509StoreContext );
+#else
+         X509_STORE_CTX_get_chain( x509StoreContext );
+#endif
+    
+    if ( depth == 0 ) {
+        std::vector< uno::Sequence< sal_Int8 > > asn1DerCertificates;
+        if ( chain != NULL ) {
+            int nCertificates = sk_X509_num( chain );
+            for ( int i = 0; i < nCertificates; i++ ) {
+                X509 *certificate = sk_X509_value( chain, i );
+                uno::Sequence< sal_Int8 > asn1DerCertificate = convertCertificateToAsn1Der( certificate );
+                if ( asn1DerCertificate.getLength() == 0 )
+                    return 0;
+                asn1DerCertificates.push_back( asn1DerCertificate );
+            }
+        } else {
+            uno::Sequence< sal_Int8 > asn1DerCertificate = convertCertificateToAsn1Der( serverCertificate );
+            if ( asn1DerCertificate.getLength() == 0 )
+                return 0;
+            asn1DerCertificates.push_back( asn1DerCertificate );
+        }
+        verifyOk = verifyCertificateChain( asn1DerCertificates );
+    }
+    m_aLogger.log( LogLevel::FINE, "validateServerX509Certificate() returning $1$ at depth $2$",
+        (sal_Int32)verifyOk, (sal_Int32)depth );
+    return verifyOk;
+}
+
+int CurlSession::verifyCertificateChain (
+    std::vector< uno::Sequence< sal_Int8 > > &asn1DerCertificates )
+{
+    // Check arguments.
+    if (asn1DerCertificates.size()<=0)
+    {
+        OSL_ASSERT(asn1DerCertificates.size()>0);
+        return 0;
+    }
+
+    // Create some crypto objects to decode and handle the base64
+    // encoded certificate chain.
+    uno::Reference< xml::crypto::XSEInitializer > xSEInitializer;
+    uno::Reference< security::XCertificateContainer > xCertificateContainer;
+    uno::Reference< xml::crypto::XXMLSecurityContext > xSecurityContext;
+    uno::Reference< xml::crypto::XSecurityEnvironment > xSecurityEnv;
+    try
+    {
+        // Create a certificate container.
+        xCertificateContainer = uno::Reference< security::XCertificateContainer >(
+            getMSF()->createInstance(
+                rtl::OUString::createFromAscii(
+                    "com.sun.star.security.CertificateContainer" ) ),
+            uno::UNO_QUERY_THROW);
+
+        xSEInitializer = uno::Reference< xml::crypto::XSEInitializer >(
+            getMSF()->createInstance(
+                rtl::OUString::createFromAscii( "com.sun.star.xml.crypto.SEInitializer" ) ),
+            uno::UNO_QUERY_THROW);
+
+        xSecurityContext = xSEInitializer->createSecurityContext( rtl::OUString() );
+        if (xSecurityContext.is())
+            xSecurityEnv = xSecurityContext->getSecurityEnvironment();
+
+        if ( ! xSecurityContext.is() || ! xSecurityEnv.is())
+        {
+            // Do we have to dispose xSEInitializer or xCertificateContainer?
+            m_aLogger.log( LogLevel::WARNING, "Failure creating security services for certificate verification" );
+            return 0;
+        }
+    }
+    catch ( uno::Exception const &e)
+    {
+        m_aLogger.log( LogLevel::WARNING, "Error creating security services: $1$", e.Message );
+        return 0;
+    }
+
+    // Decode the server certificate.
+    uno::Reference< security::XCertificate > xServerCertificate(
+        xSecurityEnv->createCertificateFromRaw( asn1DerCertificates[0] ) );
+    if ( ! xServerCertificate.is())
+    {
+        m_aLogger.log( LogLevel::WARNING, "Failed to create XCertificate" );
+        return 0;
+    }
+
+    // Get the subject from the server certificate.
+    ::rtl::OUString sServerCertificateSubject (xServerCertificate->getSubjectName());
+    sal_Int32 nIndex = 0;
+    while (nIndex >= 0)
+    {
+        const ::rtl::OUString sToken (sServerCertificateSubject.getToken(0, ',', nIndex));
+        if (sToken.compareToAscii("CN=", 3) == 0)
+        {
+            sServerCertificateSubject = sToken.copy(3);
+            break;
+        }
+        else if (sToken.compareToAscii(" CN=", 4) == 0)
+        {
+            sServerCertificateSubject = sToken.copy(4);
+            break;
+        }
+    }
+
+    // When the certificate container already contains a (trusted)
+    // entry for the server then we do not have to authenticate any
+    // certificate.
+    const security::CertificateContainerStatus eStatus (
+        xCertificateContainer->hasCertificate(
+            getHostName(), sServerCertificateSubject ) );
+    if (eStatus != security::CertificateContainerStatus_NOCERT)
+    {
+        m_aLogger.log( LogLevel::FINER, "Cached certificate found with status=$1$",
+                eStatus == security::CertificateContainerStatus_TRUSTED ? "trusted" : "untrusted" );
+        return eStatus == security::CertificateContainerStatus_TRUSTED
+               ? 1
+               : 0;
+    }
+
+    // The shortcut failed, so try to verify the whole chain. This is
+    // done outside the isDomainMatch() block because the result is
+    // used by the interaction handler.
+    std::vector< uno::Reference< security::XCertificate > > aChain;
+    for (nIndex=0; nIndex < asn1DerCertificates.size(); ++nIndex)
+    {
+        uno::Reference< security::XCertificate > xCertificate(
+            xSecurityEnv->createCertificateFromRaw( asn1DerCertificates[ nIndex ] ) );
+        if ( ! xCertificate.is())
+        {
+            m_aLogger.log( LogLevel::FINE, "Failed to create XCertificate $1$", nIndex );
+            return 0;
+        }
+        aChain.push_back(xCertificate);
+    }
+    const sal_Int64 nVerificationResult (xSecurityEnv->verifyCertificate(
+            xServerCertificate,
+            ::comphelper::containerToSequence(aChain)));
+
+    // When the certificate matches the host name then we can use the
+    // result of the verification.
+    bool bHostnameMatchesCertHostnames = false;
+    {
+        uno::Sequence< uno::Reference< security::XCertificateExtension > > extensions = xServerCertificate->getExtensions();
+        uno::Sequence< security::CertAltNameEntry > altNames;
+        for (sal_Int32 i = 0 ; i < extensions.getLength(); ++i)
+        {
+            uno::Reference< security::XCertificateExtension >element = extensions[i];
+
+            const rtl::OString aId ( (const sal_Char *)element->getExtensionId().getArray(), element->getExtensionId().getLength());
+            if ( aId.equals( OID_SUBJECT_ALTERNATIVE_NAME ) )
+            {
+                uno::Reference< security::XSanExtension > sanExtension ( element, uno::UNO_QUERY );
+                altNames = sanExtension->getAlternativeNames();
+                break;
+            }
+        }
+
+        uno::Sequence< ::rtl::OUString > certHostNames(altNames.getLength() + 1);
+        certHostNames[0] = sServerCertificateSubject;
+        for( int n = 0; n < altNames.getLength(); ++n )
+        {
+            if (altNames[n].Type == security::ExtAltNameType_DNS_NAME)
+            {
+                altNames[n].Value >>= certHostNames[n+1];
+            }
+        }
+
+        for ( int i = 0; i < certHostNames.getLength() && !bHostnameMatchesCertHostnames; ++i )
+        {
+            bHostnameMatchesCertHostnames = isDomainMatch( certHostNames[i] );
+        }
+
+    }
+    m_aLogger.log( LogLevel::FINE, "URL hostname $1$ certificate hostname",
+        bHostnameMatchesCertHostnames ? "matches" : "DOESN'T MATCH" );
+    if ( bHostnameMatchesCertHostnames )
+    {
+        if (nVerificationResult == 0)
+        {
+            m_aLogger.log( LogLevel::FINE, "Certificate (chain) is valid" );
+            xCertificateContainer->addCertificate(getHostName(), sServerCertificateSubject, sal_True);
+            return 1;
+        }
+        else if ((nVerificationResult & security::CertificateValidity::CHAIN_INCOMPLETE) != 0)
+        {
+            // We do not have enough information for verification,
+            // neither automatically (as we just discovered) nor
+            // manually (so there is no point in showing any dialog.)
+            m_aLogger.log( LogLevel::WARNING, "Certificate (chain) is incomplete" );
+            return 0;
+        }
+        else if ((nVerificationResult & security::CertificateValidity::REVOKED) != 0)
+        {
+            // Certificate (chain) is invalid.
+            m_aLogger.log( LogLevel::WARNING, "Certificate (chain) is revoked" );
+            xCertificateContainer->addCertificate(getHostName(), sServerCertificateSubject,  sal_False);
+            return 0;
+        }
+        else
+        {
+            // For all other we have to ask the user.
+            m_aLogger.log( LogLevel::FINE, "Promping user to validate the certificate" );
+        }
+    }
+
+    // We have not been able to automatically verify (or falsify) the
+    // certificate chain. To resolve this we have to ask the user.
+    const uno::Reference< ucb::XCommandEnvironment > xEnv( getRequestEnvironment().m_xEnv );
+    if ( xEnv.is() )
+    {
+        uno::Reference< task::XInteractionHandler > xIH( xEnv->getInteractionHandler() );
+        if ( xIH.is() )
+        {
+            rtl::Reference< ucbhelper::SimpleCertificateValidationRequest >
+                xRequest( new ucbhelper::SimpleCertificateValidationRequest(
+                        static_cast<sal_Int32>(nVerificationResult), xServerCertificate, getHostName() ) );
+            xIH->handle( xRequest.get() );
+
+            rtl::Reference< ucbhelper::InteractionContinuation > xSelection
+                = xRequest->getSelection();
+
+            if ( xSelection.is() )
+            {
+                uno::Reference< task::XInteractionApprove > xApprove( xSelection.get(), uno::UNO_QUERY );
+                if ( xApprove.is() )
+                {
+                    m_aLogger.log( LogLevel::FINE, "The user approved the certificate" );
+                    xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_True );
+                    return 1;
+                }
+                else
+                {
+                    // Don't trust cert
+                    m_aLogger.log( LogLevel::FINE, "The user REJECTED the certificate" );
+                    xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_False );
+                    return 0;
+                }
+            }
+        }
+        else
+        {
+            // Don't trust cert
+            m_aLogger.log( LogLevel::WARNING, "Couldn't create the interaction handler for user feedback, rejecting the certificate" );
+            xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_False );
+            return 0;
+        }
+    }
+    m_aLogger.log( LogLevel::WARNING, "No XCommandEnvironment, rejecting the certificate" );
+
+    return 0;
+}
+
+bool CurlSession::Curl_ProvideCredentials( long statusCode, void *userdata ) throw (DAVException)
+{
+    CredentialsData *credentialsData = (CredentialsData*)userdata;
+    return credentialsData->session->provideCredentials( credentialsData->env, credentialsData->request, statusCode );
+}
+
+bool CurlSession::provideCredentials( const DAVRequestEnvironment &env, CurlRequest &request, long statusCode ) throw (DAVException)
+{
+    DAVAuthListener * pListener = env.m_xAuthListener.get();
+    if ( !pListener )
+    {
+        // abort
+        m_aLogger.log( LogLevel::FINE, "No DAVAuthListener found, failing credentials entry" );
+        return false;
+    }
+
+    rtl::OUString theUserName;
+    rtl::OUString thePassWord;
+    try
+    {
+        CurlUri uri( env.m_aRequestURI );
+        theUserName = uri.GetUserName();
+        thePassWord = uri.GetPassword();
+    }
+    catch ( DAVException const &e )
+    {
+        // abort
+        m_aLogger.log(
+            LogLevel::WARNING,
+            "Error extracing userinfo from URI: exceptionCode=$1$, status=$2$, data=$3$, owner=$4$, extendedError=$5%",
+            (sal_Int32)e.getError(), e.getStatus(), e.getData(), e.getOwner(), e.getExtendedError()
+        );
+        return false;
+    }
+    
+    bool canUseSystemCreds = false;
+    long authMethods = 0;
+    CURLcode rc = CURLE_OK;
+    if ( statusCode == 401 )
+        rc = curl_easy_getinfo( m_pCurl, CURLINFO_HTTPAUTH_AVAIL, &authMethods );
+    else if ( statusCode == 407 )
+        rc = curl_easy_getinfo( m_pCurl, CURLINFO_PROXYAUTH_AVAIL, &authMethods );
+    if ( rc == 0 )
+        canUseSystemCreds = (authMethods & CURLAUTH_NEGOTIATE) || (authMethods & CURLAUTH_NTLM);
+    m_aLogger.log( LogLevel::FINE, "authMethods=$1$, canUseSystemCreds=$2$",
+        (sal_Int64)authMethods, (sal_Int32)canUseSystemCreds );
+    
+    const CurlRequest::Header *authHeader = NULL;
+    if ( statusCode == 401 )
+        authHeader = request.findResponseHeader( "WWW-Authenticate" );
+    else if ( statusCode == 407 )
+        authHeader = request.findResponseHeader( "Proxy-Authenticate" );
+    rtl::OUString realm;
+    if ( authHeader != NULL )
+    {
+        int realmStart = authHeader->value.indexOf( "realm=\"" );
+        if ( realmStart >= 0 )
+        {
+            realmStart += 7;
+            int realmEnd = authHeader->value.indexOf( "\"", realmStart );
+            if ( realmEnd > 0 )
+                realm = rtl::OStringToOUString( authHeader->value.copy( realmStart, realmEnd - realmStart ), RTL_TEXTENCODING_UTF8 );
+        }
+    }
+    
+    int theRetVal = pListener->authenticate( realm,
+                                             getHostName(),
+                                             theUserName,
+                                             thePassWord,
+                                             canUseSystemCreds,
+                                             // Authenticating with both the proxy
+                                             // and the destination server requires sal_True here,
+                                             // and needs filling out 2 x password dialogs.
+                                             sal_True );
+
+    if ( theRetVal == 0 )
+    {
+        m_aLogger.log( LogLevel::FINEST, "got credentials for user=$1$ on realm=$2$", theUserName, realm );
+        // "System credentials" means username and password are empty
+        const char *curlUsername = NULL;
+        const char *curlPassword = NULL;
+        if ( !theUserName.isEmpty() )
+            curlUsername = rtl::OUStringToOString( theUserName, RTL_TEXTENCODING_UTF8 ).getStr();
+        if ( !thePassWord.isEmpty() )
+            curlPassword = rtl::OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ).getStr();
+        if ( statusCode == 401 )
+        {
+            curl_easy_setopt( m_pCurl, CURLOPT_USERNAME, curlUsername );
+            curl_easy_setopt( m_pCurl, CURLOPT_PASSWORD, curlPassword );
+        }
+        else
+        {
+            curl_easy_setopt( m_pCurl, CURLOPT_PROXYUSERNAME, curlUsername );
+            curl_easy_setopt( m_pCurl, CURLOPT_PROXYPASSWORD, curlPassword );
+        }
+        return true;
+    }
+    m_aLogger.log( LogLevel::WARNING, "credentials entry cancelled or failed" );
+
+    return false;
+}
+
+void CurlSession::addEnvironmentRequestHeaders( CurlRequest &curlRequest, const DAVRequestEnvironment &env )
+    throw ( DAVException )
+{
+    bool bHasUserAgent( false );
+    DAVRequestHeaders::const_iterator aHeaderIter( env.m_aRequestHeaders.begin() );
+    const DAVRequestHeaders::const_iterator aEnd( env.m_aRequestHeaders.end() );
+
+    while ( aHeaderIter != aEnd )
+    {
+        const rtl::OString aHeader = rtl::OUStringToOString( aHeaderIter->first,
+                                                             RTL_TEXTENCODING_UTF8 );
+        const rtl::OString aValue = rtl::OUStringToOString( aHeaderIter->second,
+                                                            RTL_TEXTENCODING_UTF8 );
+
+        if ( !bHasUserAgent )
+            bHasUserAgent = aHeaderIter->first.equalsAsciiL(
+                RTL_CONSTASCII_STRINGPARAM( "User-Agent" ) );
+
+        curlRequest.addHeader( aHeader, aValue );
+        
+        ++aHeaderIter;
+    }
+
+    if ( !bHasUserAgent )
+    {
+        const rtl::OUString &rUserAgent = WebDAVUserAgent::get();
+        curlRequest.addHeader( "User-Agent", rtl::OUStringToOString( rUserAgent, RTL_TEXTENCODING_UTF8 ) );
+    }
+}
+
+void CurlSession::processResponse( CurlRequest &curlRequest, CURLcode curlCode )
+    throw( DAVException )
+{
+    long statusCode = 0;
+    CURLcode curlRes;
+    curlRes = curl_easy_getinfo( m_pCurl, CURLINFO_RESPONSE_CODE, &statusCode );
+    if ( curlRes != 0 || statusCode == 0 )
+        statusCode = curlRequest.getStatusCode();
+
+    // check header according:
+    // http://tools.ietf.org/html/rfc7231#section-7.4.2
+    // need to do this so we can adjust the protocol accordingly
+    const CurlRequest::Header *server = curlRequest.findResponseHeader( "server" );
+    if ( server != NULL )
+        m_aServerHeaderField = server->value;
+
+    if ( curlCode != 0 )
+    {
+        m_aLogger.log( LogLevel::WARNING, "Curl request failed with CURLcode $1$", (sal_Int64)curlCode );
+        throw DAVException( DAVException::DAV_HTTP_LOOKUP,
+                            CurlUri::makeConnectionEndPointString( getHostName(),
+                                                                   getPort() ) );
+    }
+    
+    rtl::OUString reasonPhrase = rtl::OStringToOUString( curlRequest.getReasonPhrase(), RTL_TEXTENCODING_UTF8 );
+    if ( statusCode != 0 && statusCode / 100 != 2 )
+    {
+        switch (statusCode)
+        {
+            case SC_MOVED_PERMANENTLY:             // 301
+            case SC_MOVED_TEMPORARILY:             // 302
+            case SC_SEE_OTHER:                     // 303
+            case SC_TEMPORARY_REDIRECT:            // 307
+            {
+                // new location for certain redirections
+                
+                const CurlRequest::Header *location = curlRequest.findResponseHeader( "location" );
+                if ( location != NULL )
+                {
+                    m_aLogger.log( LogLevel::FINE, "HTTP $1$ response with new location = $2$",
+                        statusCode, location->value );
+                    throw DAVException( DAVException::DAV_HTTP_REDIRECT,
+                                        rtl::OStringToOUString( location->value, RTL_TEXTENCODING_UTF8 ) );
+                }
+                break;
+            }
+            case SC_UNAUTHORIZED:                  // 401
+            case SC_PROXY_AUTHENTICATION_REQUIRED: // 407
+            {
+                throw DAVException( DAVException::DAV_HTTP_ERROR,
+                                    reasonPhrase,
+                                    statusCode );
+                break;
+            }
+            case SC_REQUEST_ENTITY_TOO_LARGE:      // 413
+            {
+                if ( m_bTransferEncodingSwitched )
+                    throw DAVException( DAVException::DAV_HTTP_ERROR,
+                                        reasonPhrase,
+                                        statusCode );
+                m_bTransferEncodingSwitched = true;
+                curlRequest.setChunkedEncoding( !curlRequest.isChunkedEncoding() );
+                break;
+            }
+            case SC_LOCKED:                        // 423
+                throw DAVException( DAVException::DAV_LOCKED,
+                                    reasonPhrase,
+                                    statusCode );
+            default:
+                throw DAVException( DAVException::DAV_HTTP_ERROR,
+                                    reasonPhrase,
+                                    statusCode );
+        }
+    }
+}
+
+static void responseHeadersToDAVResource( const std::vector< CurlRequest::Header> &responseHeaders,
+                                          const std::vector< ::rtl::OUString > &inHeaderNames,
+                                          DAVResource &ioResource )
+{
+    std::vector< CurlRequest::Header >::const_iterator it( responseHeaders.begin() );
+    const std::vector< CurlRequest::Header >::const_iterator end( responseHeaders.end() );
+    while ( it != end )
+    {
+        bool storeHeader = false;
+        if ( inHeaderNames.size() == 0 )
+            storeHeader = true;
+        else
+        {
+            std::vector< ::rtl::OUString >::const_iterator reqIt( inHeaderNames.begin() );
+            const std::vector< ::rtl::OUString >::const_iterator reqEnd( inHeaderNames.end() );
+            while ( reqIt != reqEnd )
+            {
+                // header names are case insensitive
+                if ( (*reqIt).equalsIgnoreAsciiCase( rtl::OStringToOUString( (*it).name, RTL_TEXTENCODING_UTF8 ) ) )
+                {
+                    storeHeader = true;
+                    break;
+                }
+                else
+                {
+                    ++reqIt;
+                }
+            }
+        }
+        
+        if ( storeHeader )
+        {
+            DAVPropertyValue thePropertyValue;
+            thePropertyValue.IsCaseSensitive = false;
+            thePropertyValue.Name = rtl::OStringToOUString( (*it).name, RTL_TEXTENCODING_UTF8 );
+            thePropertyValue.Value <<= rtl::OStringToOUString( (*it).value, RTL_TEXTENCODING_UTF8 );
+            ioResource.properties.push_back( thePropertyValue );
+        }
+        
+        it++;
+    }
+}
+
+// -------------------------------------------------------------------
+// PROPFIND - allprop & named
+// -------------------------------------------------------------------
+
+void CurlSession::propfind( CurlRequest &curlRequest,
+                            const rtl::OUString &inPath,
+                            const Depth inDepth,
+                            const std::vector< ::rtl::OUString > * inPropNames,
+                            const bool onlyPropertyNames,
+                            const DAVRequestEnvironment & rEnv )
+{
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+
+    if ( inDepth == DAVZERO )
+        curlRequest.addHeader( "Depth", "0" );
+    else if ( inDepth == DAVONE )
+        curlRequest.addHeader( "Depth", "1" );
+    else if ( inDepth == DAVINFINITY )
+        curlRequest.addHeader( "Depth", "infinity" );
+
+    rtl::OString xml = PropfindRequest::generatePROPFINDRequestBody( inPropNames, onlyPropertyNames );
+    if ( xml.getLength() > 0 )
+    {
+        curlRequest.addHeader( "Content-Type", "application/xml" );
+        curlRequest.setRequestBody( xml.getStr(), xml.getLength() );
+    }
+
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+    
+    CURLcode rc = curlRequest.propfind( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+}
+
+void CurlSession::PROPFIND( const rtl::OUString & inPath,
+                            const Depth inDepth,
+                            const std::vector< rtl::OUString > & inPropNames,
+                            std::vector< DAVResource > & ioResources,
+                            const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "PROPFIND line $1$", (sal_Int32)__LINE__ );
+    
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+    
+    propfind( curlRequest, inPath, inDepth, &inPropNames, false, rEnv );
+
+    const std::vector< DAVResource > rResources( parseWebDAVPropFindResponse( curlRequest.getResponseBody().get() ) );
+    std::vector< DAVResource > *pIoResources = &ioResources;
+    *pIoResources = rResources;
+}
+
+// -------------------------------------------------------------------
+// PROPFIND - propnames
+// -------------------------------------------------------------------
+void CurlSession::PROPFIND( const rtl::OUString & inPath,
+                            const Depth inDepth,
+                            std::vector< DAVResourceInfo > & ioResInfo,
+                            const DAVRequestEnvironment & rEnv )
+    throw( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "PROPFIND line $1$", (sal_Int32)__LINE__ );
+    
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+    
+    propfind( curlRequest, inPath, inDepth, NULL, true, rEnv );
+
+    const std::vector< DAVResourceInfo > rResInfo( parseWebDAVPropNameResponse( curlRequest.getResponseBody().get() ) );
+    std::vector< DAVResourceInfo > *pIoResInfo = &ioResInfo;
+    *pIoResInfo = rResInfo;
+}
+
+// -------------------------------------------------------------------
+// PROPPATCH
+// -------------------------------------------------------------------
+void CurlSession::PROPPATCH( const rtl::OUString & inPath,
+                             const std::vector< ProppatchValue > & inValues,
+                             const DAVRequestEnvironment & rEnv )
+    throw( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "PROPPATCH line $1$", (sal_Int32)__LINE__ );
+
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+    
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+
+    // check whether a lock on this resource is already owned
+    rtl::OUString aUri( composeCurrentUri( inPath ) );
+    ucb::Lock inLock;
+    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
+    if ( pLock )
+    {
+        inLock = pLock->getLock();
+    }
+    if ( inLock.LockTokens.getLength() > 0 )
+    {
+        curlRequest.addHeader( "If",
+            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
+    }
+    
+    rtl::OString xml = ProppatchRequest::generatePROPPATCHRequestBody( inValues );
+    if ( xml.getLength() > 0 )
+    {
+        curlRequest.addHeader( "Content-Type", "application/xml" );
+        curlRequest.setRequestBody( xml.getStr(), xml.getLength() );
+    }
+
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    CURLcode rc = curlRequest.proppatch( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+}
+
+// -------------------------------------------------------------------
+// HEAD
+// -------------------------------------------------------------------
+void CurlSession::HEAD( const ::rtl::OUString & inPath,
+                        const std::vector< ::rtl::OUString > & inHeaderNames,
+                        DAVResource & ioResource,
+                        const DAVRequestEnvironment & rEnv )
+    throw( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "HEAD line $1$", (sal_Int32)__LINE__ );
+    
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    Init(rEnv );
+    CurlRequest curlRequest( m_pCurl );
+
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+
+    ioResource.uri = inPath;
+    ioResource.properties.clear();
+
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    CURLcode rc = curlRequest.head( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+    responseHeadersToDAVResource( curlRequest.getResponseHeaders(), inHeaderNames, ioResource );
+}
+
+// -------------------------------------------------------------------
+// GET
+// -------------------------------------------------------------------
+uno::Reference< io::XInputStream >
+CurlSession::GET( const rtl::OUString & inPath,
+                  const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "GET line $1$", (sal_Int32)__LINE__ );
+
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    CURLcode rc = curlRequest.get( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+
+    return uno::Reference< io::XInputStream >( curlRequest.getResponseBody().get() );
+}
+
+// -------------------------------------------------------------------
+// GET
+// -------------------------------------------------------------------
+void CurlSession::GET( const rtl::OUString & inPath,
+                       uno::Reference< io::XOutputStream > & ioOutputStream,
+                       const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "GET line $1$", (sal_Int32)__LINE__ );
+
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    curlRequest.saveResponseBodyTo( ioOutputStream );
+    CURLcode rc = curlRequest.get( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+}
+
+// -------------------------------------------------------------------
+// GET
+// -------------------------------------------------------------------
+uno::Reference< io::XInputStream >
+CurlSession::GET( const rtl::OUString & inPath,
+                  const std::vector< ::rtl::OUString > & inHeaderNames,
+                  DAVResource & ioResource,
+                  const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "GET line $1$", (sal_Int32)__LINE__ );
+
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    CURLcode rc = curlRequest.get( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+    responseHeadersToDAVResource( curlRequest.getResponseHeaders(), inHeaderNames, ioResource );
+
+    return uno::Reference< io::XInputStream >( curlRequest.getResponseBody().get() );
+}
+
+
+// -------------------------------------------------------------------
+// GET
+// -------------------------------------------------------------------
+void CurlSession::GET( const rtl::OUString & inPath,
+                       uno::Reference< io::XOutputStream > & ioOutputStream,
+                       const std::vector< ::rtl::OUString > & inHeaderNames,
+                       DAVResource & ioResource,
+                       const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "GET line $1$", (sal_Int32)__LINE__ );
+
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    curlRequest.saveResponseBodyTo( ioOutputStream );
+    CURLcode rc = curlRequest.get( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+    responseHeadersToDAVResource( curlRequest.getResponseHeaders(), inHeaderNames, ioResource );
+}
+
+// -------------------------------------------------------------------
+// PUT
+// -------------------------------------------------------------------
+void CurlSession::PUT( const rtl::OUString & inPath,
+                       const uno::Reference< io::XInputStream > & inInputStream,
+                       const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "PUT line $1$", (sal_Int32)__LINE__ );
+    
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+    
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+    
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+    
+    uno::Sequence< sal_Int8 > aDataToSend;
+    if ( !getDataFromInputStream( inInputStream, aDataToSend, false ) )
+        throw DAVException( DAVException::DAV_INVALID_ARG );
+    curlRequest.setRequestBody( reinterpret_cast< const char * >( aDataToSend.getConstArray() ),
+                                aDataToSend.getLength() );
+    
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    // check whether a lock on this resource is already owned
+    rtl::OUString aUri( composeCurrentUri( inPath ) );
+    ucb::Lock inLock;
+    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
+    if ( pLock )
+    {
+        inLock = pLock->getLock();
+    }
+    if ( inLock.LockTokens.getLength() > 0 )
+    {
+        curlRequest.addHeader( "If",
+            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
+    }
+
+    CURLcode rc = curlRequest.put( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+}
+
+// -------------------------------------------------------------------
+// POST
+// -------------------------------------------------------------------
+uno::Reference< io::XInputStream >
+CurlSession::POST( const rtl::OUString & inPath,
+                   const rtl::OUString & rContentType,
+                   const rtl::OUString & rReferer,
+                   const uno::Reference< io::XInputStream > & inInputStream,
+                   const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "POST line $1$", (sal_Int32)__LINE__ );
+    
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+    
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+    
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+    
+    uno::Sequence< sal_Int8 > aDataToSend;
+    if ( !getDataFromInputStream( inInputStream, aDataToSend, false ) )
+        throw DAVException( DAVException::DAV_INVALID_ARG );
+    curlRequest.setRequestBody( reinterpret_cast< const char * >( aDataToSend.getConstArray() ),
+                                aDataToSend.getLength() );
+
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    if ( !rContentType.isEmpty() )
+        curlRequest.addHeader( "Content-Type", rtl::OUStringToOString( rContentType, RTL_TEXTENCODING_UTF8 ).getStr() );
+    if ( !rReferer.isEmpty() )
+        curlRequest.addHeader( "Referer", rtl::OUStringToOString( rReferer, RTL_TEXTENCODING_UTF8 ).getStr() );
+
+    // check whether a lock on this resource is already owned
+    rtl::OUString aUri( composeCurrentUri( inPath ) );
+    ucb::Lock inLock;
+    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
+    if ( pLock )
+    {
+        inLock = pLock->getLock();
+    }
+    if ( inLock.LockTokens.getLength() > 0 )
+    {
+        curlRequest.addHeader( "If",
+            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
+    }
+
+    CURLcode rc = curlRequest.post( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+    return uno::Reference< io::XInputStream >( curlRequest.getResponseBody().get() );
+}
+
+// -------------------------------------------------------------------
+// POST
+// -------------------------------------------------------------------
+void CurlSession::POST( const rtl::OUString & inPath,
+                        const rtl::OUString & rContentType,
+                        const rtl::OUString & rReferer,
+                        const uno::Reference< io::XInputStream > & inInputStream,
+                        uno::Reference< io::XOutputStream > & oOutputStream,
+                        const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "POST line $1$", (sal_Int32)__LINE__ );
+    
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+    
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+    
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+    
+    uno::Sequence< sal_Int8 > aDataToSend;
+    if ( !getDataFromInputStream( inInputStream, aDataToSend, false ) )
+        throw DAVException( DAVException::DAV_INVALID_ARG );
+    curlRequest.setRequestBody( reinterpret_cast< const char * >( aDataToSend.getConstArray() ),
+                                aDataToSend.getLength() );
+
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    if ( !rContentType.isEmpty() )
+        curlRequest.addHeader( "Content-Type", rtl::OUStringToOString( rContentType, RTL_TEXTENCODING_UTF8 ).getStr() );
+    if ( !rReferer.isEmpty() )
+        curlRequest.addHeader( "Referer", rtl::OUStringToOString( rReferer, RTL_TEXTENCODING_UTF8 ).getStr() );
+
+    // check whether a lock on this resource is already owned
+    rtl::OUString aUri( composeCurrentUri( inPath ) );
+    ucb::Lock inLock;
+    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
+    if ( pLock )
+    {
+        inLock = pLock->getLock();
+    }
+    if ( inLock.LockTokens.getLength() > 0 )
+    {
+        curlRequest.addHeader( "If",
+            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
+    }
+
+    curlRequest.saveResponseBodyTo( oOutputStream );
+    CURLcode rc = curlRequest.post( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+}
+
+// -------------------------------------------------------------------
+// MKCOL
+// -------------------------------------------------------------------
+void CurlSession::MKCOL( const rtl::OUString & inPath,
+                         const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "MKCOL line $1$", (sal_Int32)__LINE__ );
+    
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+    
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+    
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+    
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    // check whether a lock on this resource is already owned
+    rtl::OUString aUri( composeCurrentUri( inPath ) );
+    ucb::Lock inLock;
+    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
+    if ( pLock )
+    {
+        inLock = pLock->getLock();
+    }
+    if ( inLock.LockTokens.getLength() > 0 )
+    {
+        curlRequest.addHeader( "If",
+            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
+    }
+
+    CURLcode rc = curlRequest.mkcol( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+}
+
+// -------------------------------------------------------------------
+// COPY
+// -------------------------------------------------------------------
+void CurlSession::COPY( const rtl::OUString & inSourceURL,
+                        const rtl::OUString & inDestinationURL,
+                        const DAVRequestEnvironment & rEnv,
+                        sal_Bool inOverWrite )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "COPY line $1$", (sal_Int32)__LINE__ );
+
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+    
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+    
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+    
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    curlRequest.addHeader( "Destination", rtl::OUStringToOString( inDestinationURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+    curlRequest.addHeader( "Overwrite", inOverWrite? "T" : "F" );
+    
+    // check whether a lock on the destination resource is already owned
+    rtl::OUString aUri( composeCurrentUri( inDestinationURL ) );
+    ucb::Lock inLock;
+    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
+    if ( pLock )
+    {
+        inLock = pLock->getLock();
+    }
+    if ( inLock.LockTokens.getLength() > 0 )
+    {
+        curlRequest.addHeader( "If",
+            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
+    }
+
+    CURLcode rc = curlRequest.copy( m_aUri, CurlUri( inSourceURL ).GetPath() );
+    processResponse( curlRequest, rc );
+}
+
+// -------------------------------------------------------------------
+// MOVE
+// -------------------------------------------------------------------
+void CurlSession::MOVE( const rtl::OUString & inSourceURL,
+                        const rtl::OUString & inDestinationURL,
+                        const DAVRequestEnvironment & rEnv,
+                        sal_Bool inOverWrite )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "MOVE line $1$", (sal_Int32)__LINE__ );
+    
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+    
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+    
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+    
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    curlRequest.addHeader( "Destination", rtl::OUStringToOString( inDestinationURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+    curlRequest.addHeader( "Overwrite", inOverWrite? "T" : "F" );
+    
+    // check whether a lock on the destination resource is already owned
+    rtl::OUString aUri( composeCurrentUri( inDestinationURL ) );
+    ucb::Lock inLock;
+    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
+    if ( pLock )
+    {
+        inLock = pLock->getLock();
+    }
+    if ( inLock.LockTokens.getLength() > 0 )
+    {
+        curlRequest.addHeader( "If",
+            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
+    }
+
+    CURLcode rc = curlRequest.copy( m_aUri, CurlUri( inSourceURL ).GetPath() );
+    processResponse( curlRequest, rc );
+}
+
+// -------------------------------------------------------------------
+// DESTROY
+// -------------------------------------------------------------------
+void CurlSession::DESTROY( const rtl::OUString & inPath,
+                           const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "DESTROY line $1$", (sal_Int32)__LINE__ );
+    
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+    
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+    
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+    
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    // check whether a lock on this resource is already owned
+    rtl::OUString aUri( composeCurrentUri( inPath ) );
+    ucb::Lock inLock;
+    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
+    if ( pLock )
+    {
+        inLock = pLock->getLock();
+    }
+    if ( inLock.LockTokens.getLength() > 0 )
+    {
+        curlRequest.addHeader( "If",
+            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
+    }
+
+    CURLcode rc = curlRequest.delete_( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+}
+
+// -------------------------------------------------------------------
+
+namespace
+{
+    sal_Int32 lastChanceToSendRefreshRequest( TimeValue const & rStart,
+                                              sal_Int32 timeout )
+    {
+        TimeValue aEnd;
+        osl_getSystemTime( &aEnd );
+
+        // Try to estimate a safe absolute time for sending the
+        // lock refresh request.
+        sal_Int32 lastChanceToSendRefreshRequest = DAVINFINITY;
+        if ( timeout != DAVINFINITY )
+        {
+            sal_Int32 calltime = aEnd.Seconds - rStart.Seconds;
+            if ( calltime <= timeout )
+            {
+                lastChanceToSendRefreshRequest
+                    = aEnd.Seconds + timeout - calltime;
+            }
+            else
+            {
+                OSL_TRACE( "No chance to refresh lock before timeout!" );
+            }
+        }
+        return lastChanceToSendRefreshRequest;
+    }
+
+} // namespace
+
+// -------------------------------------------------------------------
+// LOCK (set new lock)
+// -------------------------------------------------------------------
+void CurlSession::LOCK( const ::rtl::OUString & inPath,
+                        ucb::Lock & inLock,
+                        const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "LOCK line $1$", (sal_Int32)__LINE__ );
+
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    // before locking, search in the lock store if we already own a lock for this resource
+    // if present, return with exception DAV_LOCKED_SELF
+    rtl::OUString   aUri( composeCurrentUri( inPath ) );
+    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
+    if ( pLock )
+    {
+// already present, meaning already locked by the same AOO session and already in the lockstore
+// just return, nothing to do
+        return;
+    }
+
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+    
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+    
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    if ( inLock.Timeout == -1 )
+        curlRequest.addHeader( "Timeout", "Infinite" );
+    else
+        curlRequest.addHeader( "Timeout", "Second-" + rtl::OString::valueOf( inLock.Timeout ) );
+
+    switch ( inLock.Depth )
+    {
+        //i126305 TODO investigate on this case...
+    case ucb::LockDepth_MAKE_FIXED_SIZE:
+
+    case ucb::LockDepth_ZERO:
+        curlRequest.addHeader( "Depth", "0" );
+        break;
+    case ucb::LockDepth_ONE:
+        curlRequest.addHeader( "Depth", "1" );
+        break;
+    case ucb::LockDepth_INFINITY:
+        curlRequest.addHeader( "Depth", "infinity" );
+        break;
+    }
+    
+    rtl::OString xml = LockRequest::generateRequestBody( inLock );
+    curlRequest.addHeader( "Content-Type", "application/xml" );
+    curlRequest.setRequestBody( xml.getStr(), xml.getLength() );
+
+    TimeValue startCall;
+    osl_getSystemTime( &startCall );
+    
+    CURLcode rc = curlRequest.lock( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+
+    // the returned property, a sequence of locks
+    // only the first is used
+    const DAVPropertyValue outLock( parseWebDAVLockResponse( curlRequest.getResponseBody().get() ) );
+    if(outLock.Name.compareToAscii(RTL_CONSTASCII_STRINGPARAM( "DAV:lockdiscovery" )) == 0 )
+    {
+        // got a lock, use only the first returned
+        uno::Sequence< ucb::Lock >      aLocks;
+        outLock.Value >>= aLocks;
+        ucb::Lock aLock = aLocks[0];
+
+        CurlLock* aNewLock = new CurlLock( aLock, aUri, inPath );
+        // add the store the new lock
+        m_aCurlLockStore.addLock(aNewLock,this,
+                                 lastChanceToSendRefreshRequest(
+                                     startCall, static_cast< sal_Int32 >(aLock.Timeout) ) );
+    }
+}
+
+// -------------------------------------------------------------------
+// LOCK (refresh existing lock from DAVResourceAccess)
+// -------------------------------------------------------------------
+sal_Int64 CurlSession::LOCK( const ::rtl::OUString & /*inPath*/,
+                             sal_Int64 nTimeout,
+                             const DAVRequestEnvironment & /*rEnv*/ )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "LOCK line $1$", (sal_Int32)__LINE__ );
+
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    return nTimeout;
+    /*
+    // Try to get the neon lock from lock store
+    CurlLock * theLock
+        = m_aCurlLockStore.findByUri( makeAbsoluteURL( inPath ) );
+    if ( !theLock )
+         throw DAVException( DAVException::DAV_NOT_LOCKED );
+
+    Init( rEnv );
+
+    // refresh existing lock.
+    theLock->timeout = static_cast< long >( nTimeout );
+
+    TimeValue startCall;
+    osl_getSystemTime( &startCall );
+
+    int theRetVal = ne_lock_refresh( m_pHttpSession, theLock );
+
+    if ( theRetVal == NE_OK )
+    {
+        m_aCurlLockStore.updateLock( theLock,
+                                     lastChanceToSendRefreshRequest(
+                                         startCall, theLock->timeout ) );
+    }
+
+    HandleError( theRetVal, inPath, rEnv );
+
+    return theLock->timeout;
+    */
+}
+
+// -------------------------------------------------------------------
+// LOCK (refresh existing lock from CurlLockStore)
+// -------------------------------------------------------------------
+bool CurlSession::LOCK( CurlLock * pLock,
+                        sal_Int32 & rlastChanceToSendRefreshRequest )
+{
+    m_aLogger.log( LogLevel::INFO, "LOCK line $1$", (sal_Int32)__LINE__ );
+    
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+    
+    Init();
+    CurlRequest curlRequest( m_pCurl );
+    
+    const ucb::Lock & inLock = pLock->getLock();
+    rtl::OUString inPath = pLock->getResourcePath();
+    
+    if ( inLock.Timeout == -1 )
+        curlRequest.addHeader( "Timeout", "Infinite" );
+    else
+        curlRequest.addHeader( "Timeout", "Second-" + rtl::OString::valueOf( inLock.Timeout ) );
+
+    switch ( inLock.Depth )
+    {
+        //i126305 TODO investigate on this case...
+    case ucb::LockDepth_MAKE_FIXED_SIZE:
+
+    case ucb::LockDepth_ZERO:
+        curlRequest.addHeader( "Depth", "0" );
+        break;
+    case ucb::LockDepth_ONE:
+        curlRequest.addHeader( "Depth", "1" );
+        break;
+    case ucb::LockDepth_INFINITY:
+        curlRequest.addHeader( "Depth", "infinity" );
+        break;
+    }
+
+    if ( inLock.LockTokens.getLength() > 0 )
+    {
+        curlRequest.addHeader( "If",
+            ( "(<" + rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">)" ).getStr() );
+    }
+
+    rtl::OString xml = LockRequest::generateRequestBody( inLock );
+    curlRequest.addHeader( "Content-Type", "application/xml" );
+    curlRequest.setRequestBody( xml.getStr(), xml.getLength() );
+    
+    TimeValue startCall;
+    osl_getSystemTime( &startCall );
+
+    CURLcode rc = curlRequest.lock( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+
+    // the returned property, a sequence of locks
+    // only the first is used
+    const DAVPropertyValue outLock( parseWebDAVLockResponse( curlRequest.getResponseBody().get() ) );
+    uno::Sequence< ucb::Lock >      aLocks;
+    outLock.Value >>= aLocks;
+    ucb::Lock aLock = aLocks[0];
+
+    // if ok, update the lastchance refresh time in lock
+    rlastChanceToSendRefreshRequest
+        = lastChanceToSendRefreshRequest( startCall, static_cast< sal_Int32 >(aLock.Timeout) );
+
+    return true;
+}
+
+// -------------------------------------------------------------------
+// UNLOCK called from external (DAVResourceAccess)
+// -------------------------------------------------------------------
+void CurlSession::UNLOCK( const ::rtl::OUString & inPath,
+                          const DAVRequestEnvironment & rEnv )
+    throw ( DAVException )
+{
+    m_aLogger.log( LogLevel::INFO, "UNLOCK line $1$", (sal_Int32)__LINE__ );
+
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+
+    rtl::OUString aUri( composeCurrentUri( inPath ) );
+    CurlLock * pLock = m_aCurlLockStore.findByUri( aUri );
+    if ( !pLock )
+    {
+        throw DAVException( DAVException::DAV_NOT_LOCKED );
+    }
+
+    Init( rEnv );
+    CurlRequest curlRequest( m_pCurl );
+
+    addEnvironmentRequestHeaders( curlRequest, rEnv );
+
+    CredentialsData credsData( this, curlRequest, rEnv );
+    curlRequest.setProvideCredentialsCallback( Curl_ProvideCredentials, &credsData );
+
+    ucb::Lock inLock = pLock->getLock();
+    curlRequest.addHeader( "Lock-Token",
+            ( "<" + rtl::OUStringToOString( inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">" ).getStr() );
+
+    // remove lock from lockstore
+    // so, if something goes wrong, we don't refresh it anymore
+    m_aCurlLockStore.removeLock( pLock );
+    delete pLock;
+    
+    CURLcode rc = curlRequest.unlock( m_aUri, inPath );
+    processResponse( curlRequest, rc );    
+}
+
+// -------------------------------------------------------------------
+// UNLOCK (called from CurlLockStore)
+// -------------------------------------------------------------------
+bool CurlSession::UNLOCK( CurlLock * pLock )
+{
+    m_aLogger.log( LogLevel::INFO, "UNLOCK line $1$", (sal_Int32)__LINE__ );
+    
+    osl::Guard< osl::Mutex > theGuard( m_aMutex );
+    
+    Init();
+    CurlRequest curlRequest( m_pCurl );
+
+    rtl::OUString inPath = pLock->getResourcePath();
+    ucb::Lock inLock = pLock->getLock();
+    curlRequest.addHeader( "Lock-Token",
+            ( "<" + rtl::OUStringToOString( inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ) + ">" ).getStr() );
+
+    CURLcode rc = curlRequest.unlock( m_aUri, inPath );
+    processResponse( curlRequest, rc );
+    return true;
+}
+
+// -------------------------------------------------------------------
+void CurlSession::abort()
+    throw ( DAVException )
+{
+    // 11.11.09 (tkr): The following code lines causing crashes if
+    // closing a ongoing connection. It turned out that this existing
+    // solution doesn't work in multi-threading environments.
+    // So I disabled them in 3.2. . Issue #73893# should fix it in OOo 3.3.
+    //if ( m_pHttpSession )
+    //    ne_close_connection( m_pHttpSession );
+}
+
+// -------------------------------------------------------------------
+const ucbhelper::InternetProxyServer & CurlSession::getProxySettings() const
+{
+    if ( m_aUri.GetScheme().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "http" ) ) ||
+         m_aUri.GetScheme().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ) )
+    {
+        return m_rProxyDecider.getProxy( m_aUri.GetScheme(),
+                                         m_aUri.GetHost(),
+                                         m_aUri.GetPort() );
+    }
+    else
+    {
+        // TODO: figure out, if this case can occur
+        return m_rProxyDecider.getProxy( m_aUri.GetScheme(),
+                                         rtl::OUString() /* not used */,
+                                         -1 /* not used */ );
+    }
+}
+
+/*
+// -------------------------------------------------------------------
+namespace {
+
+bool containsLocktoken( const uno::Sequence< ucb::Lock > & rLocks,
+                        const char * token )
+{
+    for ( sal_Int32 n = 0; n < rLocks.getLength(); ++n )
+    {
+        const uno::Sequence< rtl::OUString > & rTokens
+            = rLocks[ n ].LockTokens;
+        for ( sal_Int32 m = 0; m < rTokens.getLength(); ++m )
+        {
+            if ( rTokens[ m ].equalsAscii( token ) )
+                return true;
+        }
+    }
+    return false;
+}
+
+} // namespace
+*/
+
+// -------------------------------------------------------------------
+// This method doesn't seem to be used.
+// In any case the default behavior is to ask a lock with a life of 3 minutes
+// it will then be refreshed automatically (see CurlLockStore class)
+// In case of AOO crash the lock will expire by itself
+bool CurlSession::removeExpiredLocktoken( const rtl::OUString & /*inURL*/,
+                                          const DAVRequestEnvironment & /*rEnv*/ )
+{
+    return true;
+    /*
+    CurlLock * theLock = m_aCurlLockStore.findByUri( inURL );
+    if ( !theLock )
+        return false;
+
+    // do a lockdiscovery to check whether this lock is still valid.
+    try
+    {
+        // @@@ Alternative: use ne_lock_discover() => less overhead
+
+        std::vector< DAVResource > aResources;
+        std::vector< rtl::OUString > aPropNames;
+        aPropNames.push_back( DAVProperties::LOCKDISCOVERY );
+
+        PROPFIND( rEnv.m_aRequestURI, DAVZERO, aPropNames, aResources, rEnv );
+
+        if ( aResources.size() == 0 )
+            return false;
+
+        std::vector< DAVPropertyValue >::const_iterator it
+            = aResources[ 0 ].properties.begin();
+        std::vector< DAVPropertyValue >::const_iterator end
+            = aResources[ 0 ].properties.end();
+
+        while ( it != end )
+        {
+            if ( (*it).Name.equals( DAVProperties::LOCKDISCOVERY ) )
+            {
+                uno::Sequence< ucb::Lock > aLocks;
+                if ( !( (*it).Value >>= aLocks ) )
+                    return false;
+
+                if ( !containsLocktoken( aLocks, theLock->token ) )
+                {
+                    // expired!
+                    break;
+                }
+
+                // still valid.
+                return false;
+            }
+            ++it;
+        }
+
+        // No lockdiscovery prop in propfind result / locktoken not found
+        // in propfind result -> not locked
+        OSL_TRACE( "CurlSession::removeExpiredLocktoken: Removing "
+                   " expired lock token for %s. token: %s",
+                   rtl::OUStringToOString( inURL,
+                                           RTL_TEXTENCODING_UTF8 ).getStr(),
+                   theLock->token );
+
+        m_aCurlLockStore.removeLock( theLock );
+        ne_lock_destroy( theLock );
+        return true;
+    }
+    catch ( DAVException const & )
+    {
+    }
+    return false;
+    */
+}
+
+// -------------------------------------------------------------------
+// static
+bool
+CurlSession::getDataFromInputStream(
+    const uno::Reference< io::XInputStream > & xStream,
+    uno::Sequence< sal_Int8 > & rData,
+    bool bAppendTrailingZeroByte )
+{
+    if ( xStream.is() )
+    {
+        uno::Reference< io::XSeekable > xSeekable( xStream, uno::UNO_QUERY );
+        if ( xSeekable.is() )
+        {
+            try
+            {
+                sal_Int32 nSize
+                    = sal::static_int_cast<sal_Int32>(xSeekable->getLength());
+                sal_Int32 nRead
+                    = xStream->readBytes( rData, nSize );
+
+                if ( nRead == nSize )
+                {
+                    if ( bAppendTrailingZeroByte )
+                    {
+                        rData.realloc( nSize + 1 );
+                        rData[ nSize ] = sal_Int8( 0 );
+                    }
+                    return true;
+                }
+            }
+            catch ( io::NotConnectedException const & )
+            {
+                // readBytes
+            }
+            catch ( io::BufferSizeExceededException const & )
+            {
+                // readBytes
+            }
+            catch ( io::IOException const & )
+            {
+                // getLength, readBytes
+            }
+        }
+        else
+        {
+            try
+            {
+                uno::Sequence< sal_Int8 > aBuffer;
+                sal_Int32 nPos = 0;
+
+                sal_Int32 nRead = xStream->readSomeBytes( aBuffer, 65536 );
+                while ( nRead > 0 )
+                {
+                    if ( rData.getLength() < ( nPos + nRead ) )
+                        rData.realloc( nPos + nRead );
+
+                    aBuffer.realloc( nRead );
+                    rtl_copyMemory( (void*)( rData.getArray() + nPos ),
+                                    (const void*)aBuffer.getConstArray(),
+                                    nRead );
+                    nPos += nRead;
+
+                    aBuffer.realloc( 0 );
+                    nRead = xStream->readSomeBytes( aBuffer, 65536 );
+                }
+
+                if ( bAppendTrailingZeroByte )
+                {
+                    rData.realloc( nPos + 1 );
+                    rData[ nPos ] = sal_Int8( 0 );
+                }
+                return true;
+            }
+            catch ( io::NotConnectedException const & )
+            {
+                // readBytes
+            }
+            catch ( io::BufferSizeExceededException const & )
+            {
+                // readBytes
+            }
+            catch ( io::IOException const & )
+            {
+                // readBytes
+            }
+        }
+    }
+    return false;
+}
+
+// ---------------------------------------------------------------------
+sal_Bool
+CurlSession::isDomainMatch( rtl::OUString certHostName )
+{
+    rtl::OUString hostName = getHostName();
+
+    if (hostName.equalsIgnoreAsciiCase( certHostName ) )
+        return sal_True;
+
+    if ( 0 == certHostName.indexOf( rtl::OUString::createFromAscii( "*" ) ) &&
+         hostName.getLength() >= certHostName.getLength() )
+    {
+        rtl::OUString cmpStr = certHostName.copy( 1 );
+
+        if ( hostName.matchIgnoreAsciiCase(
+                cmpStr, hostName.getLength() - cmpStr.getLength() ) )
+            return sal_True;
+    }
+    return sal_False;
+}
diff --git a/main/ucb/source/ucp/webdav/SerfSession.hxx b/main/ucb/source/ucp/webdav/CurlSession.hxx
similarity index 71%
rename from main/ucb/source/ucp/webdav/SerfSession.hxx
rename to main/ucb/source/ucp/webdav/CurlSession.hxx
index 6d4438cb34..091b304324 100644
--- a/main/ucb/source/ucp/webdav/SerfSession.hxx
+++ b/main/ucb/source/ucp/webdav/CurlSession.hxx
@@ -21,103 +21,103 @@
 
 
 
-#ifndef INCLUDED_SERFSESSION_HXX
-#define INCLUDED_SERFSESSION_HXX
+#ifndef INCLUDED_CURLSESSION_HXX
+#define INCLUDED_CURLSESSION_HXX
 
 #include <vector>
 #include <boost/shared_ptr.hpp>
 #include <osl/mutex.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/logging.hxx>
 #include "DAVResource.hxx"
 #include "DAVSession.hxx"
-#include "SerfTypes.hxx"
-#include "SerfLockStore.hxx"
-#include "SerfUri.hxx"
+#include "CurlTypes.hxx"
+#include "CurlRequest.hxx"
+#include "CurlLockStore.hxx"
+#include "CurlUri.hxx"
+#include "CurlInputStream.hxx"
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <curl/curl.h>
+#include <openssl/ssl.h>
 
 namespace ucbhelper { class ProxyDecider; }
 
 namespace http_dav_ucp
 {
 
-class SerfRequestProcessor;
-
 // -------------------------------------------------------------------
-// SerfSession
-// A DAVSession implementation using the neon/expat library
+// CurlSession
+// A DAVSession implementation using the Curl library
 // -------------------------------------------------------------------
 
-class SerfSession : public DAVSession
+class CurlSession : public DAVSession
 {
 private:
-    osl::Mutex              m_aMutex;
+    osl::Mutex                      m_aMutex;
+    ::comphelper::ComponentContext  m_aContext;
+    ::comphelper::EventLogger       m_aLogger;
+
+    CurlUri                 m_aUri;
 
-    SerfUri                 m_aUri;
-    
     rtl::OUString           m_aProxyName;
     sal_Int32               m_nProxyPort;
     // The server, according RFC7231
     // http://tools.ietf.org/html/rfc7231#section-7.4.2
-    rtl::OUString           m_aServerHeaderField;
-    
-    SerfConnection*         m_pSerfConnection;
-    serf_context_t*         m_pSerfContext;
-    serf_bucket_alloc_t*    m_pSerfBucket_Alloc;
-    bool                    m_bIsHeadRequestInProgress;
+    rtl::OString            m_aServerHeaderField;
+
+    CURL*                   m_pCurl;
     bool                    m_bUseChunkedEncoding;
-    sal_Int16               m_bNoOfTransferEncodingSwitches;
+    bool                    m_bTransferEncodingSwitched;
 
     const ucbhelper::InternetProxyDecider & m_rProxyDecider;
 
     DAVRequestEnvironment m_aEnv;
 
-    static SerfLockStore m_aSerfLockStore;
+    static CurlLockStore m_aCurlLockStore;
 
-    char* getHostinfo();
     bool isSSLNeeded();
 
-    SerfRequestProcessor*   createReqProc( const rtl::OUString & inPath );
 
     rtl::OUString           composeCurrentUri( const rtl::OUString & inPath );
+    void                    addEnvironmentRequestHeaders( CurlRequest &curlRequest,
+                                                          const DAVRequestEnvironment &env )
+                                throw ( DAVException );
+    void                    processResponse( CurlRequest &curlRequest,
+                                             CURLcode curlCode )
+                                throw ( DAVException );
+
+    static CURLcode         Curl_SSLContextCallback( CURL *curl,
+                                                     void *ssl_ctx,
+                                                     void *userptr );
+    static int              OPENSSL_ValidateServerCertificate( int preverify_ok,
+                                                               X509_STORE_CTX *x509_ctx );
+    int                     validateServerX509Certificate( X509_STORE_CTX *x509StoreContext,
+                                                           int preverifyOk );
+    int                     verifyCertificateChain (
+                                std::vector< uno::Sequence< sal_Int8 > > &asn1DerCertificates );
+
+    static int              Curl_DebugCallback( CURL *,
+                                                curl_infotype type,
+                                                unsigned char *data,
+                                                size_t size,
+                                                void* userdata );
+    int                     curlDebugOutput( curl_infotype type, char *data, int size );
+
+    static bool             Curl_ProvideCredentials( long statusCode,
+                                                     void *userdata ) throw (DAVException);
+    bool                    provideCredentials( const DAVRequestEnvironment &env,
+                                                CurlRequest &request,
+                                                long statusCode ) throw (DAVException);
 
 protected:
-    virtual ~SerfSession();
+    virtual ~CurlSession();
 
 public:
-    SerfSession( const rtl::Reference< DAVSessionFactory > & rSessionFactory,
+    CurlSession( const rtl::Reference< DAVSessionFactory > & rSessionFactory,
                  const rtl::OUString& inUri,
                  const ucbhelper::InternetProxyDecider & rProxyDecider )
         throw ( DAVException );
 
-    // Serf library callbacks
-    apr_status_t setupSerfConnection( apr_socket_t * inAprSocket,
-                                      serf_bucket_t **outSerfInputBucket,
-                                      serf_bucket_t **outSerfOutputBucket,
-                                      apr_pool_t* inAprPool );
-
-    apr_status_t provideSerfCredentials( bool bGiveProvidedCredentialsASecondTry,
-                                         char ** outUsername, 
-                                         char ** outPassword,
-                                         serf_request_t * inRequest, 
-                                         int inCode, 
-                                         const char *inAuthProtocol,
-                                         const char *inRealm,
-                                         apr_pool_t *inAprPool );
-
-    apr_status_t verifySerfCertificateChain (
-        int nFailures,
-        const serf_ssl_certificate_t * const * pCertificateChainBase64Encoded,
-        int nCertificateChainLength);
-
-    serf_bucket_t* acceptSerfResponse( serf_request_t * inSerfRequest,
-                                       serf_bucket_t * inSerfStreamBucket,
-                                       apr_pool_t* inAprPool );
-
-    // Serf-related data structures
-    apr_pool_t* getAprPool();
-    serf_bucket_alloc_t* getSerfBktAlloc();
-    serf_context_t* getSerfContext();
-    SerfConnection* getSerfConnection();
-
     // DAVSession methods
     virtual sal_Bool CanUse( const ::rtl::OUString & inUri );
 
@@ -156,8 +156,6 @@ public:
           const DAVRequestEnvironment & rEnv )
         throw ( DAVException );
 
-    bool isHeadRequestInProgress();
-
     virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream >
     GET( const ::rtl::OUString & inPath,
          const DAVRequestEnvironment & rEnv )
@@ -264,12 +262,10 @@ public:
 
     sal_Bool isDomainMatch( rtl::OUString certHostName );
 
-    const rtl::OUString & getServerHeaderField() { return m_aServerHeaderField; };
-
-    void setServerHeaderField( rtl::OUString aServerHeaderField ) { m_aServerHeaderField = aServerHeaderField; };
+    const rtl::OString & getServerHeaderField() { return m_aServerHeaderField; };
 
 private:
-    friend class SerfLockStore;
+    friend class CurlLockStore;
 
     void Init( void )
         throw ( DAVException );
@@ -277,24 +273,28 @@ private:
     void Init( const DAVRequestEnvironment & rEnv )
         throw ( DAVException );
 
-    void HandleError( boost::shared_ptr<SerfRequestProcessor> rReqProc )
-        throw ( DAVException );
-
     const ucbhelper::InternetProxyServer & getProxySettings() const;
+    
+    void propfind( CurlRequest &curlRequest,
+                   const rtl::OUString &inPath,
+                   const Depth inDepth,
+                   const std::vector< ::rtl::OUString > * propNames,
+                   const bool onlyPropertyNames,
+                   const DAVRequestEnvironment & rEnv );
 
     bool removeExpiredLocktoken( const rtl::OUString & inURL,
                                  const DAVRequestEnvironment & rEnv );
 
-    // refresh lock, called by SerfLockStore::refreshLocks
-    bool LOCK( SerfLock * pLock,
+    // refresh lock, called by CurlLockStore::refreshLocks
+    bool LOCK( CurlLock * pLock,
                sal_Int32 & rlastChanceToSendRefreshRequest );
 
-    // unlock, called by SerfLockStore::~SerfLockStore
-    bool UNLOCK( SerfLock * pLock );
+    // unlock, called by CurlLockStore::~CurlLockStore
+    bool UNLOCK( CurlLock * pLock );
 
     /*
     // low level GET implementation, used by public GET implementations
-    static int GET( SerfConnection * sess,
+    static int GET( CurlConnection * sess,
                     const char * uri,
                     //ne_block_reader reader,
                     bool getheaders,
@@ -302,14 +302,14 @@ private:
 
     // Buffer-based PUT implementation. Serf only has file descriptor-
     // based API.
-    static int PUT( SerfConnection * sess,
+    static int PUT( CurlConnection * sess,
                     const char * uri,
                     const char * buffer,
                     size_t size );
 
     // Buffer-based POST implementation. Serf only has file descriptor-
     // based API.
-    int POST( SerfConnection * sess,
+    int POST( CurlConnection * sess,
               const char * uri,
               const char * buffer,
               //ne_block_reader reader,
@@ -332,4 +332,4 @@ private:
 
 } // namespace http_dav_ucp
 
-#endif // INCLUDED_SERFSESSION_HXX
+#endif // INCLUDED_CURLSESSION_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfTypes.hxx b/main/ucb/source/ucp/webdav/CurlTypes.hxx
similarity index 86%
rename from main/ucb/source/ucp/webdav/SerfTypes.hxx
rename to main/ucb/source/ucp/webdav/CurlTypes.hxx
index 7b28225dd0..fb014106c8 100644
--- a/main/ucb/source/ucp/webdav/SerfTypes.hxx
+++ b/main/ucb/source/ucp/webdav/CurlTypes.hxx
@@ -21,10 +21,9 @@
 
 
 
-#ifndef INCLUDED_SERFTYPES_HXX
-#define INCLUDED_SERFTYPES_HXX
+#ifndef INCLUDED_CURLTYPES_HXX
+#define INCLUDED_CURLTYPES_HXX
 
-#include <serf.h>
 #include <com/sun/star/ucb/Lock.hpp>
 #include "DAVTypes.hxx"
 #include "DAVRequestEnvironment.hxx"
@@ -34,9 +33,7 @@ using namespace com::sun::star;
 namespace http_dav_ucp
 {
 
-typedef serf_connection_t SerfConnection;
-
-class SerfLock
+class CurlLock
 {
 private:
     ucb::Lock               mLock;
@@ -45,7 +42,7 @@ private:
     // const DAVRequestEnvironment& mrRequestEnvironment;
 public:
 
-    SerfLock(const ucb::Lock inLock, rtl::OUString inUri, rtl::OUString inPath)
+    CurlLock(const ucb::Lock inLock, rtl::OUString inUri, rtl::OUString inPath)
         : mLock( inLock )
         , mResourceUri( inUri )
         , mPathStr( inPath )
@@ -60,7 +57,7 @@ public:
 };
 
 // TODO, check if we need it later on
-typedef struct { const char *nspace, *name; } SerfPropName;
+typedef struct { const char *nspace, *name; } CurlPropName;
 
 };
-#endif // INCLUDED_SERFTYPES_HXX
+#endif // INCLUDED_CURLTYPES_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfUri.cxx b/main/ucb/source/ucp/webdav/CurlUri.cxx
similarity index 54%
rename from main/ucb/source/ucp/webdav/SerfUri.cxx
rename to main/ucb/source/ucp/webdav/CurlUri.cxx
index 43a26bd8c4..2d08fa63e7 100644
--- a/main/ucb/source/ucp/webdav/SerfUri.cxx
+++ b/main/ucb/source/ucp/webdav/CurlUri.cxx
@@ -26,9 +26,10 @@
 #include <rtl/uri.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/ustrbuf.hxx>
-#include "SerfUri.hxx"
+#include "CurlUri.hxx"
 #include "DAVException.hxx"
-#include "AprEnv.hxx"
+
+#include <curl/curl.h>
 
 #include "../inc/urihelper.hxx"
 
@@ -54,43 +55,71 @@ inline bool matchIgnoreAsciiCase(rtl::OString const & rStr1,
             == 0;
 }
 
+inline rtl::OUString getURLStringPart( const CURLU *curlUrl, CURLUPart part, unsigned int flags )
+{
+    char *value = NULL;
+    CURLUcode rc = curl_url_get( const_cast<CURLU*>( curlUrl ), part, &value, flags );
+    if ( rc == CURLUE_OK )
+    {
+        rtl::OUString str = rtl::OStringToOUString( value, RTL_TEXTENCODING_UTF8 );
+        curl_free( value );
+        return str;
+    }
+    return rtl::OUString();
 }
 
-SerfUri::SerfUri( const apr_uri_t * inUri )
+}
+
+CurlUri::CurlUri( const CURLU * inUri )
     throw ( DAVException )
-    : mAprUri( *inUri )
-    , mURI()
+    : mURI()
     , mScheme()
-    , mUserInfo()
+    , mUserName()
+    , mPassword()
     , mHostName()
     , mPort()
     , mPath()
 {
     if ( inUri == 0 )
         throw DAVException( DAVException::DAV_INVALID_ARG );
-
-    char * uri = apr_uri_unparse( apr_environment::AprEnv::getAprEnv()->getAprPool(), &mAprUri, 0 );
-
-    if ( uri == 0 )
+    mCurlUri = curl_url_dup( const_cast<CURLU *>(inUri) );
+    if ( mCurlUri == NULL )
+         throw DAVException( DAVException::DAV_HTTP_ERROR,
+                             rtl::OUString::createFromAscii( "Out of memory" ),
+                             SC_INSUFFICIENT_STORAGE );
+
+    char * uri;
+    CURLUcode rc = curl_url_get( mCurlUri, CURLUPART_URL, &uri, 0 );
+    if ( rc != CURLUE_OK )
+    {
+        curl_url_cleanup( mCurlUri );
         throw DAVException( DAVException::DAV_INVALID_ARG );
+    }
+    curl_free( uri );
 
-    init( &mAprUri );
+    init( mCurlUri );
 
     calculateURI();
 }
 
-SerfUri::SerfUri( const rtl::OUString & inUri )
+CurlUri::CurlUri( const rtl::OUString & inUri )
     throw ( DAVException )
-    : mAprUri()
+    : mCurlUri( 0 )
     , mURI()
     , mScheme()
-    , mUserInfo()
+    , mUserName()
+    , mPassword()
     , mHostName()
-    , mPort()
+    , mPort( 0 )
     , mPath()
 {
     if ( inUri.getLength() <= 0 )
         throw DAVException( DAVException::DAV_INVALID_ARG );
+    mCurlUri = curl_url();
+    if ( mCurlUri == NULL )
+         throw DAVException( DAVException::DAV_HTTP_ERROR,
+                             rtl::OUString::createFromAscii( "Out of memory" ),
+                             SC_INSUFFICIENT_STORAGE );
 
     // #i77023#
     rtl::OUString aEscapedUri( ucb_impl::urihelper::encodeURI( inUri ) );
@@ -98,57 +127,112 @@ SerfUri::SerfUri( const rtl::OUString & inUri )
     rtl::OString theInputUri(
         aEscapedUri.getStr(), aEscapedUri.getLength(), RTL_TEXTENCODING_UTF8 );
 
-    if ( apr_uri_parse( apr_environment::AprEnv::getAprEnv()->getAprPool(), 
-                        theInputUri.getStr(), &mAprUri ) != APR_SUCCESS )
+    if ( curl_url_set( mCurlUri, CURLUPART_URL, theInputUri.getStr(), 0 ) != CURLUE_OK )
     {
-        throw DAVException( DAVException::DAV_INVALID_ARG );
+        // I kid you not:
+        // Sometimes, we are just given a URL's path part,
+        // and CREATING THE URL ABSOLUTELY MUST SUCCEED, even though the resulting URL
+        // of "/path/to/file.txt" will be the terrible "://:0/path/to/file.txt" !!!
+        // (Such input usually comes from the callers of GetPathBaseName() and the like.)
+        if ( !theInputUri.isEmpty() && theInputUri[0] == '/' &&
+                curl_url_set( mCurlUri, CURLUPART_PATH, theInputUri.getStr(), 0 ) != CURLUE_OK )
+        {
+            throw DAVException( DAVException::DAV_INVALID_ARG );
+        }
     }
-    if ( !mAprUri.port ) 
+
+    rtl::OUString portString = getURLStringPart( mCurlUri, CURLUPART_PORT, 0 );
+    if ( portString.isEmpty() )
     {
-        mAprUri.port = apr_uri_port_of_scheme( mAprUri.scheme );
+        rtl::OUString defaultPortW = getURLStringPart( mCurlUri, CURLUPART_PORT, CURLU_DEFAULT_PORT );
+        rtl::OString defaultPortA = OUStringToOString( defaultPortW, RTL_TEXTENCODING_UTF8 );
+        if ( !defaultPortA.isEmpty() )
+            curl_url_set( mCurlUri, CURLUPART_PORT, defaultPortA.getStr(), 0 );
     }
-    if ( !mAprUri.path ) 
+    rtl::OUString path = getURLStringPart( mCurlUri, CURLUPART_PATH, 0 );
+    if ( path.isEmpty() )
+        curl_url_set( mCurlUri, CURLUPART_PATH, "/", 0);
+
+    init( mCurlUri );
+
+    calculateURI();
+}
+
+CurlUri::CurlUri( const CurlUri &curlUri )
+    throw ( DAVException )
+    : mURI()
+    , mScheme()
+    , mUserName()
+    , mPassword()
+    , mHostName()
+    , mPort()
+    , mPath()
+{
+    mCurlUri = curl_url_dup( curlUri.mCurlUri );
+    if ( mCurlUri == NULL )
+         throw DAVException( DAVException::DAV_HTTP_ERROR,
+                             rtl::OUString::createFromAscii( "Out of memory" ),
+                             SC_INSUFFICIENT_STORAGE );
+
+    char * uri;
+    CURLUcode rc = curl_url_get( mCurlUri, CURLUPART_URL, &uri, 0 );
+    if ( rc != CURLUE_OK )
     {
-        mAprUri.path = "/";
+        curl_url_cleanup( mCurlUri );
+        throw DAVException( DAVException::DAV_INVALID_ARG );
     }
+    curl_free( uri );
 
-    init( &mAprUri );
+    init( mCurlUri );
 
     calculateURI();
 }
 
-void SerfUri::init( const apr_uri_t * pUri )
+void CurlUri::init( const CURLU * pUri )
 {
-    mScheme   = rtl::OStringToOUString( pUri->scheme, RTL_TEXTENCODING_UTF8 );
-    mUserInfo = rtl::OStringToOUString( pUri->user, RTL_TEXTENCODING_UTF8 );
-    mHostName = rtl::OStringToOUString( pUri->hostname, RTL_TEXTENCODING_UTF8 );
-    mPort     = pUri->port;
-    mPath     = rtl::OStringToOUString( pUri->path, RTL_TEXTENCODING_UTF8 );
-
-    if ( pUri->query )
+    mScheme   = getURLStringPart( pUri, CURLUPART_SCHEME, 0 );
+    mUserName = getURLStringPart( pUri, CURLUPART_USER, 0 );
+    mPassword = getURLStringPart( pUri, CURLUPART_PASSWORD, 0 );
+    mHostName = getURLStringPart( pUri, CURLUPART_HOST, 0 );
+    rtl::OUString portString = getURLStringPart( pUri, CURLUPART_PORT, 0);
+    mPort     = 0;
+    if ( !portString.isEmpty() )
+        mPort = portString.toInt32();
+    mPath     = getURLStringPart( pUri, CURLUPART_PATH, 0 );
+
+    rtl::OUString query = getURLStringPart( pUri, CURLUPART_QUERY, 0 );
+    if ( !query.isEmpty() )
     {
         mPath += rtl::OUString::createFromAscii( "?" );
-        mPath += rtl::OStringToOUString( pUri->query,  RTL_TEXTENCODING_UTF8 );
+        mPath += query;
     }
 
-    if ( pUri->fragment )
+    rtl::OUString fragment = getURLStringPart( pUri, CURLUPART_FRAGMENT, 0 );
+    if ( !fragment.isEmpty() )
     {
         mPath += rtl::OUString::createFromAscii( "#" );
-        mPath += rtl::OStringToOUString( pUri->fragment,  RTL_TEXTENCODING_UTF8 );
+        mPath += fragment;
     }
 }
 
-SerfUri::~SerfUri( )
+CurlUri::~CurlUri( )
 {
+    if ( mCurlUri )
+        curl_url_cleanup( mCurlUri );
 }
 
-void SerfUri::calculateURI ()
+void CurlUri::calculateURI ()
 {
     rtl::OUStringBuffer aBuf( mScheme );
     aBuf.appendAscii( "://" );
-    if ( mUserInfo.getLength() > 0 )
+    if ( mUserName.getLength() > 0 )
     {
-        aBuf.append( mUserInfo );
+        aBuf.append( mUserName );
+        if ( mPassword.getLength() > 0 )
+        {
+             aBuf.appendAscii( ":" );
+             aBuf.append( mPassword );
+        }
         aBuf.appendAscii( "@" );
     }
     // Is host a numeric IPv6 address?
@@ -186,7 +270,7 @@ void SerfUri::calculateURI ()
     mURI = aBuf.makeStringAndClear();
 }
 
-::rtl::OUString SerfUri::GetPathBaseName () const
+::rtl::OUString CurlUri::GetPathBaseName () const
 {
     sal_Int32 nPos = mPath.lastIndexOf ('/');
     sal_Int32 nTrail = 0;
@@ -215,17 +299,17 @@ void SerfUri::calculateURI ()
         return rtl::OUString::createFromAscii ("/");
 }
 
-bool SerfUri::operator== ( const SerfUri & rOther ) const
+bool CurlUri::operator== ( const CurlUri & rOther ) const
 {
     return ( mURI == rOther.mURI );
 }
 
-::rtl::OUString SerfUri::GetPathBaseNameUnescaped () const
+::rtl::OUString CurlUri::GetPathBaseNameUnescaped () const
 {
     return unescape( GetPathBaseName() );
 }
 
-void SerfUri::AppendPath (const rtl::OUString& rPath)
+void CurlUri::AppendPath (const rtl::OUString& rPath)
 {
     if (mPath.lastIndexOf ('/') != mPath.getLength () - 1)
         mPath += rtl::OUString::createFromAscii ("/");
@@ -235,7 +319,7 @@ void SerfUri::AppendPath (const rtl::OUString& rPath)
 };
 
 // static
-rtl::OUString SerfUri::escapeSegment( const rtl::OUString& segment )
+rtl::OUString CurlUri::escapeSegment( const rtl::OUString& segment )
 {
     return rtl::Uri::encode( segment,
                              rtl_UriCharClassPchar,
@@ -244,7 +328,7 @@ rtl::OUString SerfUri::escapeSegment( const rtl::OUString& segment )
 }
 
 // static
-rtl::OUString SerfUri::unescape( const rtl::OUString& segment )
+rtl::OUString CurlUri::unescape( const rtl::OUString& segment )
 {
     return rtl::Uri::decode( segment,
                              rtl_UriDecodeWithCharset,
@@ -252,7 +336,7 @@ rtl::OUString SerfUri::unescape( const rtl::OUString& segment )
 }
 
 // static
-rtl::OUString SerfUri::makeConnectionEndPointString(
+rtl::OUString CurlUri::makeConnectionEndPointString(
                                 const rtl::OUString & rHostName, int nPort )
 {
     rtl::OUStringBuffer aBuf;
diff --git a/main/ucb/source/ucp/webdav/SerfUri.hxx b/main/ucb/source/ucp/webdav/CurlUri.hxx
similarity index 76%
rename from main/ucb/source/ucp/webdav/SerfUri.hxx
rename to main/ucb/source/ucp/webdav/CurlUri.hxx
index 1f2eebfe5d..ce0137c110 100644
--- a/main/ucb/source/ucp/webdav/SerfUri.hxx
+++ b/main/ucb/source/ucp/webdav/CurlUri.hxx
@@ -20,10 +20,10 @@
  *************************************************************/
 
 
-#ifndef INCLUDED_SERFURI_HXX
-#define INCLUDED_SERFURI_HXX
+#ifndef INCLUDED_CURLURI_HXX
+#define INCLUDED_CURLURI_HXX
 
-#include <apr_uri.h>
+#include <curl/curl.h>
 #include <rtl/ustring.hxx>
 #include "DAVException.hxx"
 
@@ -34,42 +34,42 @@ namespace http_dav_ucp
 #define DEFAULT_HTTPS_PORT      443
 
 // -------------------------------------------------------------------
-// SerfUri
-// A URI implementation for use with the neon/expat library
+// CurlUri
+// A URI implementation for use with the Curl library
 // -------------------------------------------------------------------
-class SerfUri
+class CurlUri
 {
 	private:
-        apr_uri_t mAprUri;
+        CURLU *mCurlUri;
 		::rtl::OUString	mURI;
 		::rtl::OUString	mScheme;
-		::rtl::OUString	mUserInfo;
+		::rtl::OUString	mUserName;
+		::rtl::OUString	mPassword;
 		::rtl::OUString	mHostName;
 		sal_Int32		mPort;
 		::rtl::OUString	mPath;
 
-        void init( const apr_uri_t * pUri );
+        void init( const CURLU * pUri );
 		void calculateURI ();
 
 	public:
-        SerfUri( const ::rtl::OUString & inUri ) throw ( DAVException );
-        SerfUri( const apr_uri_t * inUri ) throw ( DAVException );
-		~SerfUri( );
+        CurlUri( const ::rtl::OUString & inUri ) throw ( DAVException );
+        CurlUri( const CURLU * inUri ) throw ( DAVException );
+        CurlUri( const CurlUri &curlUri ) throw ( DAVException );
+		~CurlUri( );
 
-        bool operator== ( const SerfUri & rOther ) const;
-        bool operator!= ( const SerfUri & rOther ) const
+        bool operator== ( const CurlUri & rOther ) const;
+        bool operator!= ( const CurlUri & rOther ) const
         { return !operator==( rOther ); }
 
-        apr_uri_t* getAprUri()
-        {
-            return &mAprUri;
-        }
 		const ::rtl::OUString & GetURI( void ) const
 											{ return mURI; };
 		const ::rtl::OUString & GetScheme( void ) const
 											{ return mScheme; };
-		const ::rtl::OUString & GetUserInfo( void ) const
-											{ return mUserInfo; };
+		const ::rtl::OUString & GetUserName( void ) const
+											{ return mUserName; };
+		const ::rtl::OUString & GetPassword( void ) const
+											{ return mPassword; };
 		const ::rtl::OUString & GetHost( void ) const
 											{ return mHostName; };
 		sal_Int32		GetPort( void )		const
@@ -99,4 +99,4 @@ class SerfUri
 
 } // namespace http_dav_ucp
 
-#endif // INCLUDED_SERFURI_HXX
+#endif // INCLUDED_CURLURI_HXX
diff --git a/main/ucb/source/ucp/webdav/DAVProperties.cxx b/main/ucb/source/ucp/webdav/DAVProperties.cxx
index 12e131a150..134be44a20 100644
--- a/main/ucb/source/ucp/webdav/DAVProperties.cxx
+++ b/main/ucb/source/ucp/webdav/DAVProperties.cxx
@@ -57,8 +57,8 @@ const ::rtl::OUString DAVProperties::EXECUTABLE =
 
 // -------------------------------------------------------------------
 // static
-void DAVProperties::createSerfPropName( const rtl::OUString & rFullName,
-                                        SerfPropName & rName )
+void DAVProperties::createCurlPropName( const rtl::OUString & rFullName,
+                                        CurlPropName & rName )
 {
     if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "DAV:" ) ) == 0 )
     {
@@ -186,7 +186,7 @@ void DAVProperties::createUCBPropName( const char * nspace,
 
 // -------------------------------------------------------------------
 // static
-bool DAVProperties::isUCBDeadProperty( const SerfPropName & rName )
+bool DAVProperties::isUCBDeadProperty( const CurlPropName & rName )
 {
     return ( rName.nspace &&
              ( rtl_str_compareIgnoreAsciiCase(
diff --git a/main/ucb/source/ucp/webdav/DAVProperties.hxx b/main/ucb/source/ucp/webdav/DAVProperties.hxx
index 2a79d7e8d7..25a681fe95 100644
--- a/main/ucb/source/ucp/webdav/DAVProperties.hxx
+++ b/main/ucb/source/ucp/webdav/DAVProperties.hxx
@@ -24,7 +24,7 @@
 #define _DAVPROPERTIES_HXX_
 
 #include <rtl/ustring.hxx>
-#include "SerfTypes.hxx"
+#include "CurlTypes.hxx"
 
 namespace http_dav_ucp
 {
@@ -43,13 +43,13 @@ struct DAVProperties
 	static const ::rtl::OUString SUPPORTEDLOCK;
 	static const ::rtl::OUString EXECUTABLE;
 
-	static void createSerfPropName( const rtl::OUString & rFullName,
-									SerfPropName & rName );
+	static void createCurlPropName( const rtl::OUString & rFullName,
+									CurlPropName & rName );
 	static void createUCBPropName ( const char * nspace,
 									const char * name,
 									rtl::OUString & rFullName );
 
-	static bool isUCBDeadProperty( const SerfPropName & rName );
+	static bool isUCBDeadProperty( const CurlPropName & rName );
     static bool isUCBSpecialProperty( const rtl::OUString & rFullName,
                                       rtl::OUString & rParsedName );
 };
diff --git a/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx
index ba02c36075..a5e1ade152 100644
--- a/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx
+++ b/main/ucb/source/ucp/webdav/DAVResourceAccess.cxx
@@ -1058,7 +1058,7 @@ void DAVResourceAccess::initialize()
     osl::Guard< osl::Mutex > aGuard( m_aMutex );
     if ( m_aPath.getLength() == 0 )
     {
-        SerfUri aURI( m_aURL );
+        CurlUri aURI( m_aURL );
         rtl::OUString aPath( aURI.GetPath() );
 
         /* #134089# - Check URI */
@@ -1140,10 +1140,10 @@ sal_Bool DAVResourceAccess::detectRedirectCycle(
 {
     osl::Guard< osl::Mutex > aGuard( m_aMutex );
 
-    SerfUri aUri( rRedirectURL );
+    CurlUri aUri( rRedirectURL );
 
-    std::vector< SerfUri >::const_iterator it  = m_aRedirectURIs.begin();
-    std::vector< SerfUri >::const_iterator end = m_aRedirectURIs.end();
+    std::vector< CurlUri >::const_iterator it  = m_aRedirectURIs.begin();
+    std::vector< CurlUri >::const_iterator end = m_aRedirectURIs.end();
 
     while ( it != end )
     {
@@ -1162,9 +1162,9 @@ void DAVResourceAccess::resetUri()
     osl::Guard< osl::Mutex > aGuard( m_aMutex );
     if ( m_aRedirectURIs.size() > 0 )
     {
-        std::vector< SerfUri >::const_iterator it  = m_aRedirectURIs.begin();
+        std::vector< CurlUri >::const_iterator it  = m_aRedirectURIs.begin();
 
-        SerfUri aUri( (*it) );
+        CurlUri aUri( (*it) );
         m_aRedirectURIs.clear();
         setURL ( aUri.GetURI() );
         initialize();
diff --git a/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx
index 4f84afd96f..c690663a79 100644
--- a/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx
+++ b/main/ucb/source/ucp/webdav/DAVResourceAccess.hxx
@@ -38,7 +38,7 @@
 #include "DAVSession.hxx"
 #include "DAVResource.hxx"
 #include "DAVTypes.hxx"
-#include "SerfUri.hxx"
+#include "CurlUri.hxx"
 
 namespace http_dav_ucp
 {
@@ -54,7 +54,7 @@ class DAVResourceAccess
     rtl::Reference< DAVSessionFactory > m_xSessionFactory;
     com::sun::star::uno::Reference<
         com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
-    std::vector< SerfUri > m_aRedirectURIs;
+    std::vector< CurlUri > m_aRedirectURIs;
 
 public:
     DAVResourceAccess() : m_xSessionFactory( 0 ) {}
diff --git a/main/ucb/source/ucp/webdav/DAVSessionFactory.cxx b/main/ucb/source/ucp/webdav/DAVSessionFactory.cxx
index c98803e993..97e6711a21 100644
--- a/main/ucb/source/ucp/webdav/DAVSessionFactory.cxx
+++ b/main/ucb/source/ucp/webdav/DAVSessionFactory.cxx
@@ -24,8 +24,8 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_webdav.hxx"
 #include "DAVSessionFactory.hxx"
-#include "SerfSession.hxx"
-#include "SerfUri.hxx"
+#include "CurlSession.hxx"
+#include "CurlUri.hxx"
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 
 using namespace http_dav_ucp;
@@ -60,10 +60,10 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession(
 
     if ( aIt == aEnd )
     {
-        SerfUri aURI( inUri );
+        CurlUri aURI( inUri );
 
         std::auto_ptr< DAVSession > xElement(
-            new SerfSession( this, inUri, *m_xProxyDecider.get() ) );
+            new CurlSession( this, inUri, *m_xProxyDecider.get() ) );
 
         aIt = m_aMap.insert( Map::value_type( inUri, xElement.get() ) ).first;
         aIt->second->m_aContainerIt = aIt;
@@ -84,9 +84,9 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession(
         // If URL scheme is different from http or https we definitely
         // have to use a proxy and therefore can optimize the getProxy
         // call a little:
-        SerfUri aURI( inUri );
+        CurlUri aURI( inUri );
 
-        aIt->second = new SerfSession( this, inUri, *m_xProxyDecider.get() );
+        aIt->second = new CurlSession( this, inUri, *m_xProxyDecider.get() );
         aIt->second->m_aContainerIt = aIt;
         return aIt->second;
     }
diff --git a/main/ucb/source/ucp/webdav/LockRequest.cxx b/main/ucb/source/ucp/webdav/LockRequest.cxx
new file mode 100644
index 0000000000..86150c5c4c
--- /dev/null
+++ b/main/ucb/source/ucp/webdav/LockRequest.cxx
@@ -0,0 +1,61 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_webdav.hxx"
+
+#include <rtl/ustrbuf.hxx>
+#include "LockRequest.hxx"
+
+using namespace http_dav_ucp;
+
+#define LOCK_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><lockinfo xmlns=\"DAV:\">"
+#define LOCK_TYPE "<locktype><write/></locktype>"
+#define LOCK_TRAILER "</lockinfo>"
+
+rtl::OString LockRequest::generateRequestBody( const ucb::Lock& inLock )
+{
+    const char *lockScope = NULL;
+    switch ( inLock.Scope )
+    {
+        //i126305 TODO investigate on this case...
+    case ucb::LockScope_MAKE_FIXED_SIZE:
+
+    case ucb::LockScope_EXCLUSIVE:
+        lockScope = "<lockscope><exclusive/></lockscope>";
+        break;
+    case ucb::LockScope_SHARED:
+        lockScope = "<lockscope><shared/></lockscope>";
+        break;
+    }
+
+    rtl::OUStringBuffer aBuffer;
+    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_HEADER ));
+    aBuffer.appendAscii( lockScope );
+    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_TYPE ));
+    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<owner>" ));
+    rtl::OUString aStr;
+    inLock.Owner >>= aStr;
+    aBuffer.appendAscii( rtl::OUStringToOString( aStr, RTL_TEXTENCODING_UTF8 ).getStr() );
+    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</owner>" ));
+    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_TRAILER ));
+    return rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
+}
diff --git a/main/ucb/source/ucp/webdav/AprEnv.cxx b/main/ucb/source/ucp/webdav/LockRequest.hxx
similarity index 64%
rename from main/ucb/source/ucp/webdav/AprEnv.cxx
rename to main/ucb/source/ucp/webdav/LockRequest.hxx
index 2fdec85f86..4a4d4162e7 100644
--- a/main/ucb/source/ucp/webdav/AprEnv.cxx
+++ b/main/ucb/source/ucp/webdav/LockRequest.hxx
@@ -19,40 +19,18 @@
  * 
  *************************************************************/
 
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
+#ifndef INCLUDED_LOCKREQUEST_HXX
+#define INCLUDED_LOCKREQUEST_HXX
 
-#include "AprEnv.hxx"
+#include "CurlTypes.hxx"
 
-namespace apr_environment
+namespace http_dav_ucp
 {
-
-AprEnv::AprEnv()
-    : mpAprPool( 0 )
-{
-    apr_initialize();
-
-    apr_pool_create(&mpAprPool, NULL);
-}
-
-AprEnv::~AprEnv()
-{
-    apr_pool_destroy(mpAprPool);
-
-    apr_terminate();
-}
-
-/* static */
-AprEnv* AprEnv::getAprEnv()
-{
-    static AprEnv rAprEnv;
-
-    return &rAprEnv;
-}
-
-apr_pool_t* AprEnv::getAprPool()
-{
-    return mpAprPool;
+    class LockRequest
+    {
+    public:
+        static rtl::OString generateRequestBody( const ucb::Lock& inLock );
+    };
 }
 
-} // namespace apr_environment
+#endif // INCLUDED_LOCKREQUEST_HXX
\ No newline at end of file
diff --git a/main/ucb/source/ucp/webdav/PropfindRequest.cxx b/main/ucb/source/ucp/webdav/PropfindRequest.cxx
new file mode 100644
index 0000000000..27e3be5a9e
--- /dev/null
+++ b/main/ucb/source/ucp/webdav/PropfindRequest.cxx
@@ -0,0 +1,81 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_webdav.hxx"
+
+#include <rtl/ustrbuf.hxx>
+#include "DAVProperties.hxx"
+#include "PropfindRequest.hxx"
+
+using namespace http_dav_ucp;
+
+rtl::OString PropfindRequest::generatePROPFINDRequestBody(
+            const std::vector< ::rtl::OUString > * propNames,
+            const bool onlyPropertyNames )
+{
+#define PROPFIND_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><propfind xmlns=\"DAV:\">"
+#define PROPFIND_TRAILER "</propfind>"
+
+    // TODO is it really needed a Unicode string buffer?
+    // All properties and property names aren't supposed to be ASCII?
+    rtl::OUStringBuffer aBuffer;
+    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPFIND_HEADER ));
+
+    // create and fill body with requested properties
+    const int nPropCount = ( !onlyPropertyNames && propNames )
+                           ? propNames->size() 
+                           : 0;
+    if ( nPropCount > 0 )
+    {
+        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<prop>" ) );
+        CurlPropName thePropName;
+        for ( int theIndex = 0; theIndex < nPropCount; theIndex ++ )
+        {
+            // split fullname into namespace and name!
+            DAVProperties::createCurlPropName( (*propNames)[ theIndex ], 
+                                               thePropName );
+
+            /* <*propname* xmlns="*propns*" /> */
+            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
+            aBuffer.appendAscii( thePropName.name );
+            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " xmlnx=\"" ));
+            aBuffer.appendAscii( thePropName.nspace );
+            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\"/>" ));
+        }
+
+        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop>" ));
+    }
+    else
+    {
+        if ( onlyPropertyNames )
+        {
+            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<propname/>" ));
+        }
+        else
+        {
+            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<allprop/>" ));
+        }
+    }
+
+    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPFIND_TRAILER ));
+    return rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
+}
diff --git a/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.hxx b/main/ucb/source/ucp/webdav/PropfindRequest.hxx
similarity index 55%
rename from main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.hxx
rename to main/ucb/source/ucp/webdav/PropfindRequest.hxx
index ade9602b98..505072fda0 100644
--- a/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.hxx
+++ b/main/ucb/source/ucp/webdav/PropfindRequest.hxx
@@ -19,36 +19,21 @@
  * 
  *************************************************************/
 
-#ifndef INCLUDED_SERFMKCOLREQPROCIMPL_HXX
-#define INCLUDED_SERFMKCOLREQPROCIMPL_HXX
+#ifndef INCLUDED_PROPFINDREQUEST_HXX
+#define INCLUDED_PROPFINDREQUEST_HXX
 
-#include "SerfRequestProcessorImpl.hxx"
+#include <vector>
+#include "CurlTypes.hxx"
 
 namespace http_dav_ucp
 {
-
-class SerfMkColReqProcImpl : public SerfRequestProcessorImpl
-{
-private:
-    const char* mpLockToken;
-public:
-    SerfMkColReqProcImpl( const char* inPath,
-                          const DAVRequestHeaders& inRequestHeaders,
-                          const char* inLockToken );
-
-    virtual ~SerfMkColReqProcImpl();
-
-    virtual
-    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-
-protected:
-    virtual
-    void processChunkOfResponseData( const char* data, apr_size_t len );
-
-    virtual
-    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
-};
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFMKCOLREQPROCIMPL_HXX
+    class PropfindRequest
+    {
+    public:
+        static rtl::OString generatePROPFINDRequestBody(
+            const std::vector< ::rtl::OUString > * propNames,
+            const bool onlyPropertyNames);
+    };
+}
+
+#endif // INCLUDED_PROPFINDREQUEST_HXX
\ No newline at end of file
diff --git a/main/ucb/source/ucp/webdav/ProppatchRequest.cxx b/main/ucb/source/ucp/webdav/ProppatchRequest.cxx
new file mode 100644
index 0000000000..007d354849
--- /dev/null
+++ b/main/ucb/source/ucp/webdav/ProppatchRequest.cxx
@@ -0,0 +1,126 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_webdav.hxx"
+
+#include <rtl/ustrbuf.hxx>
+#include "DAVProperties.hxx"
+#include "ProppatchRequest.hxx"
+#include "UCBDeadPropertyValue.hxx"
+
+using namespace http_dav_ucp;
+
+#define PROPPATCH_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><propertyupdate xmlns=\"DAV:\">"
+#define PROPPATCH_TRAILER "</propertyupdate>"
+
+rtl::OString ProppatchRequest::generatePROPPATCHRequestBody(
+            const std::vector< ProppatchValue > & inProperties )
+{
+    rtl::OString aBodyText;
+    static const struct
+    {
+        const char *str;
+        sal_Int32   len;
+    }
+    OpCode [] = {
+        { RTL_CONSTASCII_STRINGPARAM( "set" ) },
+        { RTL_CONSTASCII_STRINGPARAM( "remove" ) }
+    };
+    if ( inProperties.size() > 0 )
+    {
+        rtl::OUStringBuffer aBuffer;
+        // add PropPatch xml header in front
+        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPPATCH_HEADER ));
+
+        // <*operation code*><prop>
+
+        ProppatchOperation lastOp = inProperties[ 0 ].operation;
+        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
+        aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
+        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><prop>" ));
+
+        CurlPropName thePropName;
+        for ( unsigned long n = 0; n < inProperties.size(); ++n )
+        {
+            const ProppatchValue & rProperty = inProperties[ n ];
+            // split fullname into namespace and name!
+            DAVProperties::createCurlPropName( rProperty.name, 
+                                               thePropName );
+
+            if ( rProperty.operation != lastOp )
+            {
+                // </prop></*last operation code*><*operation code><prop>
+                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop></" ));
+                aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
+                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><" ));
+                aBuffer.appendAscii( OpCode[rProperty.operation].str, OpCode[rProperty.operation].len );
+                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><prop>" ));
+            }
+
+            // <*propname* xmlns="*propns*"
+            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
+            aBuffer.appendAscii( thePropName.name );
+            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " xmlns=\"" ));
+            aBuffer.appendAscii( thePropName.nspace );
+            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\"" ));
+
+            if ( rProperty.operation == PROPSET )
+            {
+                // >*property value*</*propname*>
+                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
+
+                rtl::OUString aStringValue;
+                if ( DAVProperties::isUCBDeadProperty( thePropName ) )
+                {
+                    UCBDeadPropertyValue::toXML( rProperty.value,
+                                                 aStringValue );
+                }
+                else
+                {
+                    rProperty.value >>= aStringValue;
+                }
+                aBuffer.append( aStringValue );
+                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</" ));
+                aBuffer.appendAscii( thePropName.name );
+                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
+            }
+            else
+            {
+                // />
+                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/>" ));
+            }
+
+            lastOp = rProperty.operation;
+        }
+
+        // </prop></*last operation code*>
+        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop></" ));
+        aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
+        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
+
+        // add PropPatch xml trailer at end
+        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPPATCH_TRAILER ));
+
+        return rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
+    }
+    return rtl::OString();
+}
diff --git a/main/ucb/source/ucp/webdav/AprEnv.hxx b/main/ucb/source/ucp/webdav/ProppatchRequest.hxx
similarity index 70%
rename from main/ucb/source/ucp/webdav/AprEnv.hxx
rename to main/ucb/source/ucp/webdav/ProppatchRequest.hxx
index c6835b2e41..6fbeef3e52 100644
--- a/main/ucb/source/ucp/webdav/AprEnv.hxx
+++ b/main/ucb/source/ucp/webdav/ProppatchRequest.hxx
@@ -19,32 +19,21 @@
  * 
  *************************************************************/
 
+#ifndef INCLUDED_PROPPATCHREQUEST_HXX
+#define INCLUDED_PROPPATCHREQUEST_HXX
 
-#ifndef INCLUDED_APRENV_HXX
-#define INCLUDED_APRENV_HXX
+#include <vector>
+#include "CurlTypes.hxx"
 
-#include <apr_pools.h>
-
-namespace apr_environment
+namespace http_dav_ucp
 {
 
-// singleton class providing environment for APR libraries
-class AprEnv
-{
+    class ProppatchRequest
+    {
     public:
-        ~AprEnv();
-
-        static AprEnv* getAprEnv();
-
-        apr_pool_t* getAprPool();
-
-    private:
-        apr_pool_t* mpAprPool;
-
-        AprEnv();
-
-};
-
-} // namespace apr_environment
+        static rtl::OString generatePROPPATCHRequestBody(
+            const std::vector< ProppatchValue > & inProperties );
+    };
+}
 
-#endif // INCLUDED_APRENV_HXX
+#endif // INCLUDED_PROPPATCHREQUEST_HXX
\ No newline at end of file
diff --git a/main/ucb/source/ucp/webdav/SerfCallbacks.cxx b/main/ucb/source/ucp/webdav/SerfCallbacks.cxx
deleted file mode 100644
index 20693dab30..0000000000
--- a/main/ucb/source/ucp/webdav/SerfCallbacks.cxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfCallbacks.hxx"
-
-#include "SerfSession.hxx"
-#include "SerfRequestProcessor.hxx"
-
-using namespace http_dav_ucp;
-
-extern "C" apr_status_t Serf_ConnectSetup( apr_socket_t *skt,
-                                           serf_bucket_t **read_bkt,
-                                           serf_bucket_t **write_bkt,
-                                           void *setup_baton,
-                                           apr_pool_t *pool )
-{
-    SerfSession* pSerfSession = static_cast< SerfSession* >( setup_baton );
-    OSL_TRACE("Serf_ConnectSetup");
-    return pSerfSession->setupSerfConnection( skt,
-                                              read_bkt,
-                                              write_bkt,
-                                              pool );
-}
-
-extern "C" apr_status_t Serf_Credentials( char **username, 
-                                          char **password,
-                                          serf_request_t *request,
-                                          void *baton,
-                                          int code, 
-                                          const char *authn_type,
-                                          const char *realm,
-                                          apr_pool_t *pool )
-{
-    SerfRequestProcessor* pReqProc = static_cast< SerfRequestProcessor* >( baton );
-    OSL_TRACE("Serf_Credential");
-    return pReqProc->provideSerfCredentials( username, 
-                                             password,
-                                             request,
-                                             code,
-                                             authn_type,
-                                             realm,
-                                             pool );
-}
-
-extern "C" apr_status_t Serf_CertificateChainValidation(
-    void* pSerfSession,
-    int nFailures,
-    int nErrorCode,
-    const serf_ssl_certificate_t * const * pCertificateChainBase64Encoded,
-    apr_size_t nCertificateChainLength)
-{
-    OSL_TRACE("Serf_CertificateChainValidation");
-    return static_cast<SerfSession*>(pSerfSession)
-        ->verifySerfCertificateChain(nFailures, pCertificateChainBase64Encoded, nCertificateChainLength);
-}
-
-extern "C" apr_status_t Serf_SetupRequest( serf_request_t *request,
-                                           void *setup_baton,
-                                           serf_bucket_t **req_bkt,
-                                           serf_response_acceptor_t *acceptor,
-                                           void **acceptor_baton,
-                                           serf_response_handler_t *handler,
-                                           void **handler_baton,
-                                           apr_pool_t * pool )
-{
-    SerfRequestProcessor* pReqProc = static_cast< SerfRequestProcessor* >( setup_baton );
-    OSL_TRACE("Serf_SetupRequest");
-    return pReqProc->setupSerfRequest( request, 
-                                       req_bkt,
-                                       acceptor,
-                                       acceptor_baton,
-                                       handler,
-                                       handler_baton,
-                                       pool );
-}
-
-extern "C" serf_bucket_t* Serf_AcceptResponse( serf_request_t *request,
-                                               serf_bucket_t *stream,
-                                               void *acceptor_baton,
-                                               apr_pool_t *pool )
-{
-    SerfRequestProcessor* pReqProc = static_cast< SerfRequestProcessor* >( acceptor_baton );
-    OSL_TRACE("Serf_AcceptResponse");
-    return pReqProc->acceptSerfResponse( request,
-                                         stream,
-                                         pool );
-}
-
-extern "C" apr_status_t Serf_HandleResponse( serf_request_t *request,
-                                             serf_bucket_t *response,
-                                             void *handler_baton,
-                                             apr_pool_t *pool )
-{
-    SerfRequestProcessor* pReqProc = static_cast< SerfRequestProcessor* >( handler_baton );
-    OSL_TRACE("Serf_HandleResponse");
-    return pReqProc->handleSerfResponse( request,
-                                         response,
-                                         pool );
-}
-
diff --git a/main/ucb/source/ucp/webdav/SerfCallbacks.hxx b/main/ucb/source/ucp/webdav/SerfCallbacks.hxx
deleted file mode 100644
index 85245bb7e4..0000000000
--- a/main/ucb/source/ucp/webdav/SerfCallbacks.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-#ifndef INCLUDED_CALLBACKS_HXX
-#define INCLUDED_CALLBACKS_HXX
-
-#include <serf.h>
-
-extern "C" apr_status_t Serf_ConnectSetup( apr_socket_t *skt,
-                                           serf_bucket_t **read_bkt,
-                                           serf_bucket_t **write_bkt,
-                                           void *setup_baton,
-                                           apr_pool_t *pool );
-
-extern "C" apr_status_t Serf_Credentials( char **username, 
-                                          char **password,
-                                          serf_request_t *request,
-                                          void *baton,
-                                          int code, 
-                                          const char *authn_type,
-                                          const char *realm,
-                                          apr_pool_t *pool );
-
-extern "C" apr_status_t Serf_CertificateChainValidation(
-    void* pSerfSession,
-    int nFailures,
-    int error_depth,
-    const serf_ssl_certificate_t * const * pCertificateChainBase64Encoded,
-    apr_size_t nCertificateChainLength);
-
-extern "C" apr_status_t Serf_SetupRequest( serf_request_t *request,
-                                           void *setup_baton,
-                                           serf_bucket_t **req_bkt,
-                                           serf_response_acceptor_t *acceptor,
-                                           void **acceptor_baton,
-                                           serf_response_handler_t *handler,
-                                           void **handler_baton,
-                                           apr_pool_t * pool );
-
-extern "C" serf_bucket_t* Serf_AcceptResponse( serf_request_t *request,
-                                               serf_bucket_t *stream,
-                                               void *acceptor_baton,
-                                               apr_pool_t *pool );
-
-extern "C" apr_status_t Serf_HandleResponse( serf_request_t *request,
-                                             serf_bucket_t *response,
-                                             void *handler_baton,
-                                             apr_pool_t *pool );
-
-#endif // INCLUDED_CALLBACKS_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx
deleted file mode 100644
index 711cbbe61b..0000000000
--- a/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfCopyReqProcImpl.hxx"
-
-#include <serf.h>
-
-namespace http_dav_ucp
-{
-
-SerfCopyReqProcImpl::SerfCopyReqProcImpl( const char* inSourcePath,
-                                          const DAVRequestHeaders& inRequestHeaders,
-                                          const char* inDestinationPath,
-                                          const bool inOverwrite,
-                                          const char* inLockToken )
-    : SerfRequestProcessorImpl( inSourcePath, inRequestHeaders )
-    , mDestPathStr( inDestinationPath )
-    , mbOverwrite( inOverwrite )
-    , mpLockToken( inLockToken )
-{
-}
-
-SerfCopyReqProcImpl::~SerfCopyReqProcImpl()
-{
-}
-
-serf_bucket_t * SerfCopyReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
-                                                                 "COPY",
-                                                                 getPathStr(),
-                                                                 0,
-                                                                 serf_request_get_alloc( inSerfRequest ) );
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    // general header fields provided by caller
-    setRequestHeaders( hdrs_bkt );
-    
-    // COPY specific header fields
-    serf_bucket_headers_set( hdrs_bkt, "Destination", mDestPathStr );
-    if ( mbOverwrite )
-    {
-        serf_bucket_headers_set( hdrs_bkt, "Overwrite", "T" );
-    }
-    else
-    {
-        serf_bucket_headers_set( hdrs_bkt, "Overwrite", "F" );
-    }
-    if(mpLockToken)
-    {
-        serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
-    }
-
-    return req_bkt;
-}
-
-void SerfCopyReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
-                                                      apr_size_t /*len*/ )
-{
-    // nothing to do;
-}
-
-void SerfCopyReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
-{
-    // nothing to do;
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx
deleted file mode 100644
index 029968e2a7..0000000000
--- a/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-#ifndef INCLUDED_SERFCOPYREQPROCIMPL_HXX
-#define INCLUDED_SERFCOPYREQPROCIMPL_HXX
-
-#include "SerfRequestProcessorImpl.hxx"
-
-namespace http_dav_ucp
-{
-
-class SerfCopyReqProcImpl : public SerfRequestProcessorImpl
-{
-public:
-    SerfCopyReqProcImpl( const char* inSourcePath,
-                         const DAVRequestHeaders& inRequestHeaders,
-                         const char* inDestinationPath,
-                         const bool inOverwrite,
-                         const char*  inLockToken );
-
-    virtual ~SerfCopyReqProcImpl();
-
-    virtual
-    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-
-protected:
-    virtual
-    void processChunkOfResponseData( const char* data, apr_size_t len );
-
-    virtual
-    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
-
-private:
-    const char* mDestPathStr;
-    const bool mbOverwrite;
-    const char* mpLockToken;
-};
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFCOPYREQPROCIMPL_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx
deleted file mode 100644
index 123239516c..0000000000
--- a/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfDeleteReqProcImpl.hxx"
-
-#include <serf.h>
-
-namespace http_dav_ucp
-{
-
-SerfDeleteReqProcImpl::SerfDeleteReqProcImpl( const char* inPath,
-                                              const DAVRequestHeaders& inRequestHeaders,
-                                              const char* inLockToken )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , mpLockToken( inLockToken )
-{
-}
-
-SerfDeleteReqProcImpl::~SerfDeleteReqProcImpl()
-{
-}
-
-serf_bucket_t * SerfDeleteReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
-                                                                 "DELETE",
-                                                                 getPathStr(),
-                                                                 0,
-                                                                 serf_request_get_alloc( inSerfRequest ) );
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    // general header fields provided by caller
-    setRequestHeaders( hdrs_bkt );
-    // specific header field
-    if(mpLockToken)
-    {
-        serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
-    }
-
-    return req_bkt;
-}
-
-void SerfDeleteReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
-                                                        apr_size_t /*len*/ )
-{
-    // nothing to do;
-}
-
-void SerfDeleteReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
-{
-    // nothing to do;
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.hxx
deleted file mode 100644
index 9cb4f920ad..0000000000
--- a/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-#ifndef INCLUDED_SERFDELETEREQPROCIMPL_HXX
-#define INCLUDED_SERFDELETEREQPROCIMPL_HXX
-
-#include "SerfRequestProcessorImpl.hxx"
-
-namespace http_dav_ucp
-{
-
-class SerfDeleteReqProcImpl : public SerfRequestProcessorImpl
-{
-private:
-    const char* mpLockToken;
-public:
-    SerfDeleteReqProcImpl( const char* inPath,
-                           const DAVRequestHeaders& inRequestHeaders,
-                           const char* inLockRToken );
-
-    virtual ~SerfDeleteReqProcImpl();
-
-    virtual
-    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-
-protected:
-    virtual
-    void processChunkOfResponseData( const char* data, apr_size_t len );
-
-    virtual
-    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
-
-};
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFDELETEREQPROCIMPL_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx
deleted file mode 100644
index 315272b4ee..0000000000
--- a/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx
+++ /dev/null
@@ -1,187 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfGetReqProcImpl.hxx"
-
-using namespace com::sun::star;
-
-namespace http_dav_ucp
-{
-
-SerfGetReqProcImpl::SerfGetReqProcImpl( const char* inPath,
-                                        const DAVRequestHeaders& inRequestHeaders,
-                                        const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , xInputStream( xioInStrm )
-    , xOutputStream()
-    , mpHeaderNames( 0 )
-    , mpResource( 0 )
-{
-}
-
-SerfGetReqProcImpl::SerfGetReqProcImpl( const char* inPath,
-                                        const DAVRequestHeaders& inRequestHeaders,
-                                        const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm,
-                                        const std::vector< ::rtl::OUString > & inHeaderNames,
-                                        DAVResource & ioResource )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , xInputStream( xioInStrm )
-    , xOutputStream()
-    , mpHeaderNames( &inHeaderNames )
-    , mpResource( &ioResource )
-{
-}
-
-SerfGetReqProcImpl::SerfGetReqProcImpl( const char* inPath,
-                                        const DAVRequestHeaders& inRequestHeaders,
-                                        const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , xInputStream()
-    , xOutputStream( xioOutStrm )
-    , mpHeaderNames( 0 )
-    , mpResource( 0 )
-{
-}
-
-SerfGetReqProcImpl::SerfGetReqProcImpl( const char* inPath,
-                                        const DAVRequestHeaders& inRequestHeaders,
-                                        const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm,
-                                        const std::vector< ::rtl::OUString > & inHeaderNames,
-                                        DAVResource & ioResource )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , xInputStream()
-    , xOutputStream( xioOutStrm )
-    , mpHeaderNames( &inHeaderNames )
-    , mpResource( &ioResource )
-{
-}
-
-SerfGetReqProcImpl::~SerfGetReqProcImpl()
-{
-}
-
-serf_bucket_t * SerfGetReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
-                                                                 "GET",
-                                                                 getPathStr(),
-                                                                 0,
-                                                                 serf_request_get_alloc( inSerfRequest ) );
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    // general header fields provided by caller
-    setRequestHeaders( hdrs_bkt );
-
-    return req_bkt;
-}
-
-void SerfGetReqProcImpl::processChunkOfResponseData( const char* data, 
-                                                     apr_size_t len )
-{
-    if ( xInputStream.is() )
-    {
-        xInputStream->AddToStream( data, len );
-    }
-    else if ( xOutputStream.is() )
-    {
-        const uno::Sequence< sal_Int8 > aDataSeq( (sal_Int8 *)data, len );
-        xOutputStream->writeBytes( aDataSeq );
-    }
-}
-
-namespace
-{
-    apr_status_t Serf_ProcessResponseHeader( void* inUserData,
-                                             const char* inHeaderName,
-                                             const char* inHeaderValue )
-    {
-        SerfGetReqProcImpl* pReqProcImpl = static_cast< SerfGetReqProcImpl* >( inUserData );
-        pReqProcImpl->processSingleResponseHeader( inHeaderName,
-                                                   inHeaderValue );
-
-        return APR_SUCCESS;
-    }
-} // end of anonymous namespace
-
-void SerfGetReqProcImpl::handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket )
-{
-    // read response header, if requested
-    if ( mpHeaderNames != 0 && mpResource != 0 )
-    {
-        serf_bucket_t* SerfHeaderBucket = serf_bucket_response_get_headers( inSerfResponseBucket );
-        if ( SerfHeaderBucket != 0 )
-        {
-            serf_bucket_headers_do( SerfHeaderBucket, 
-                                    Serf_ProcessResponseHeader,
-                                    this );
-        }
-    }
-}
-
-void SerfGetReqProcImpl::processSingleResponseHeader( const char* inHeaderName,
-                                                      const char* inHeaderValue )
-{
-    rtl::OUString aHeaderName( rtl::OUString::createFromAscii( inHeaderName ) );
-
-    bool bStoreHeaderField = false;
-
-    if ( mpHeaderNames->size() == 0 )
-    {
-        // store all header fields
-        bStoreHeaderField = true;
-    }
-    else
-    {
-        // store only header fields which are requested
-        std::vector< ::rtl::OUString >::const_iterator it( mpHeaderNames->begin() );
-        const std::vector< ::rtl::OUString >::const_iterator end( mpHeaderNames->end() );
-
-        while ( it != end )
-        {
-            // header names are case insensitive
-            if ( (*it).equalsIgnoreAsciiCase( aHeaderName ) )
-            {
-                bStoreHeaderField = true;
-                break;
-            }
-            else
-            {
-                ++it;
-            }
-        }
-    }
-
-    if ( bStoreHeaderField )
-    {
-        DAVPropertyValue thePropertyValue;
-        thePropertyValue.IsCaseSensitive = false;
-        thePropertyValue.Name = aHeaderName;
-        thePropertyValue.Value <<= rtl::OUString::createFromAscii( inHeaderValue );
-        mpResource->properties.push_back( thePropertyValue );
-    }
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx
deleted file mode 100644
index 2d853f6bf2..0000000000
--- a/main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-#ifndef INCLUDED_SERFGETREQPROCIMPL_HXX
-#define INCLUDED_SERFGETREQPROCIMPL_HXX
-
-#include "SerfRequestProcessorImpl.hxx"
-
-#include <vector>
-#include <rtl/ustring.hxx>
-#include "DAVResource.hxx"
-
-#include "SerfInputStream.hxx"
-#include <com/sun/star/io/XOutputStream.hpp>
-
-namespace http_dav_ucp
-{
-
-class SerfGetReqProcImpl : public SerfRequestProcessorImpl
-{
-public:
-    SerfGetReqProcImpl( const char* inPath,
-                        const DAVRequestHeaders& inRequestHeaders,
-                        const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm );
-
-    SerfGetReqProcImpl( const char* inPath,
-                        const DAVRequestHeaders& inRequestHeaders,
-                        const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm,
-                        const std::vector< ::rtl::OUString > & inHeaderNames,
-                        DAVResource & ioResource );
-
-    SerfGetReqProcImpl( const char* inPath,
-                        const DAVRequestHeaders& inRequestHeaders,
-                        const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm );
-
-    SerfGetReqProcImpl( const char* inPath,
-                        const DAVRequestHeaders& inRequestHeaders,
-                        const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm,
-                        const std::vector< ::rtl::OUString > & inHeaderNames,
-                        DAVResource & ioResource );
-
-    virtual ~SerfGetReqProcImpl();
-
-    virtual
-    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-
-    void processSingleResponseHeader( const char* inHeaderName,
-                                      const char* inHeaderValue );
-
-protected:
-    virtual
-    void processChunkOfResponseData( const char* data, apr_size_t len );
-
-    virtual
-    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
-
-private:
-    com::sun::star::uno::Reference< SerfInputStream > xInputStream;
-    com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > xOutputStream;
-    const std::vector< ::rtl::OUString > * mpHeaderNames;
-    DAVResource* mpResource;
-};
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFGETREQPROCIMPL_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx
deleted file mode 100644
index 263f255ebd..0000000000
--- a/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx
+++ /dev/null
@@ -1,141 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfHeadReqProcImpl.hxx"
-
-using namespace com::sun::star;
-
-namespace http_dav_ucp
-{
-
-SerfHeadReqProcImpl::SerfHeadReqProcImpl( const char* inPath,
-                                          const DAVRequestHeaders& inRequestHeaders,
-                                          const std::vector< ::rtl::OUString > & inHeaderNames,
-                                          DAVResource & ioResource )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , mpHeaderNames( &inHeaderNames )
-    , mpResource( &ioResource )
-{
-}
-
-SerfHeadReqProcImpl::~SerfHeadReqProcImpl()
-{
-}
-
-serf_bucket_t * SerfHeadReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
-                                                                 "HEAD",
-                                                                 getPathStr(),
-                                                                 0,
-                                                                 serf_request_get_alloc( inSerfRequest ) );
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    // general header fields provided by caller
-    setRequestHeaders( hdrs_bkt );
-
-    return req_bkt;
-}
-
-void SerfHeadReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
-                                                      apr_size_t /*len*/ )
-{
-    // nothing to do
-}
-
-namespace
-{
-    apr_status_t Serf_ProcessResponseHeader( void* inUserData,
-                                             const char* inHeaderName,
-                                             const char* inHeaderValue )
-    {
-        SerfHeadReqProcImpl* pReqProcImpl = static_cast< SerfHeadReqProcImpl* >( inUserData );
-        pReqProcImpl->processSingleResponseHeader( inHeaderName,
-                                                   inHeaderValue );
-
-        return APR_SUCCESS;
-    }
-} // end of anonymous namespace
-
-void SerfHeadReqProcImpl::handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket )
-{
-    // read response header, if requested
-    if ( mpHeaderNames != 0 && mpResource != 0 )
-    {
-        serf_bucket_t* SerfHeaderBucket = serf_bucket_response_get_headers( inSerfResponseBucket );
-        if ( SerfHeaderBucket != 0 )
-        {
-            serf_bucket_headers_do( SerfHeaderBucket, 
-                                    Serf_ProcessResponseHeader,
-                                    this );
-        }
-    }
-}
-
-void SerfHeadReqProcImpl::processSingleResponseHeader( const char* inHeaderName,
-                                                       const char* inHeaderValue )
-{
-    rtl::OUString aHeaderName( rtl::OUString::createFromAscii( inHeaderName ) );
-
-    bool bStoreHeaderField = false;
-
-    if ( mpHeaderNames->size() == 0 )
-    {
-        // store all header fields
-        bStoreHeaderField = true;
-    }
-    else
-    {
-        // store only header fields which are requested
-        std::vector< ::rtl::OUString >::const_iterator it( mpHeaderNames->begin() );
-        const std::vector< ::rtl::OUString >::const_iterator end( mpHeaderNames->end() );
-
-        while ( it != end )
-        {
-            // header names are case insensitive
-            if ( (*it).equalsIgnoreAsciiCase( aHeaderName ) )
-            {
-                bStoreHeaderField = true;
-                break;
-            }
-            else
-            {
-                ++it;
-            }
-        }
-    }
-
-    if ( bStoreHeaderField )
-    {
-        DAVPropertyValue thePropertyValue;
-        thePropertyValue.IsCaseSensitive = false;
-        thePropertyValue.Name = aHeaderName;
-        thePropertyValue.Value <<= rtl::OUString::createFromAscii( inHeaderValue );
-        mpResource->properties.push_back( thePropertyValue );
-    }
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx
deleted file mode 100644
index a6758108d4..0000000000
--- a/main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-#ifndef INCLUDED_SERFHEADREQPROCIMPL_HXX
-#define INCLUDED_SERFHEADREQPROCIMPL_HXX
-
-#include "SerfRequestProcessorImpl.hxx"
-
-#include <vector>
-#include <rtl/ustring.hxx>
-#include "DAVResource.hxx"
-
-#include "SerfInputStream.hxx"
-#include <com/sun/star/io/XOutputStream.hpp>
-
-namespace http_dav_ucp
-{
-
-class SerfHeadReqProcImpl : public SerfRequestProcessorImpl
-{
-public:
-    SerfHeadReqProcImpl( const char* inPath,
-                         const DAVRequestHeaders& inRequestHeaders,
-                         const std::vector< ::rtl::OUString > & inHeaderNames,
-                         DAVResource & ioResource );
-
-    virtual ~SerfHeadReqProcImpl();
-
-    virtual
-    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-
-    void processSingleResponseHeader( const char* inHeaderName,
-                                      const char* inHeaderValue );
-
-protected:
-    virtual
-    void processChunkOfResponseData( const char* data, apr_size_t len );
-
-    virtual
-    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
-
-private:
-    const std::vector< ::rtl::OUString > * mpHeaderNames;
-    DAVResource* mpResource;
-};
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFHEADREQPROCIMPL_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.cxx
deleted file mode 100644
index 871718d3b2..0000000000
--- a/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.cxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfTypes.hxx"
-#include "SerfLockRefreshProcImpl.hxx"
-#include "DAVProperties.hxx"
-
-#include "webdavresponseparser.hxx"
-#include <serf.h>
-#include <rtl/ustrbuf.hxx>
-#include <apr_strings.h>
-
-namespace http_dav_ucp
-{
-
-SerfLockRefreshProcImpl::SerfLockRefreshProcImpl( const char* inSourcePath,
-                                                  const DAVRequestHeaders& inRequestHeaders, // on debug the header look empty
-                                                  const ucb::Lock& inLock,
-                                                  const char* inLockToken,
-                                                  const char* inTimeout,
-                                          DAVPropertyValue & outLock)
-    : SerfLockReqProcImpl( inSourcePath, inRequestHeaders, inLock, inTimeout, outLock )
-    , mpLockToken( inLockToken )
-{
-}
-
-SerfLockRefreshProcImpl::~SerfLockRefreshProcImpl()
-{
-}
-
-serf_bucket_t * SerfLockRefreshProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest,
-                                                                 "LOCK",
-                                                                 getPathStr(),
-                                                                 0,
-                                                                 serf_request_get_alloc( inSerfRequest ) );
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    if (hdrs_bkt != NULL)
-    {
-        // general header fields provided by caller
-        setRequestHeaders( hdrs_bkt );
-
-        // request specific header fields
-        if(mTimeout != 0)
-        {
-            serf_bucket_headers_set( hdrs_bkt, "Timeout", mTimeout );
-        }
-        if(mpLockToken != 0)
-        {
-            serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
-        }
-    }
-    return req_bkt;
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.hxx
deleted file mode 100644
index 9c8a2e71b0..0000000000
--- a/main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-#ifndef INCLUDED_SERFLOCKREFRESHPROCIMPL_HXX
-#define INCLUDED_SERFLOCKREFRESHPROCIMPL_HXX
-
-#include "SerfLockReqProcImpl.hxx"
-
-namespace http_dav_ucp
-{
-
-    class SerfLockRefreshProcImpl : public SerfLockReqProcImpl
-    {
-    protected:
-        const char*         mpLockToken;
-
-    public:
-        SerfLockRefreshProcImpl( const char* inSourcePath,
-                                 const DAVRequestHeaders& inRequestHeaders,
-                                 const ucb::Lock& inLock,
-                                 const char* inLockToken,
-                                 const char* inTimeout,
-                                 DAVPropertyValue & outLock);
-
-        virtual ~SerfLockRefreshProcImpl();
-
-        virtual
-        serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-    };
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFLOCKREFRESHPROCIMPL_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx
deleted file mode 100644
index 818a88a537..0000000000
--- a/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx
+++ /dev/null
@@ -1,155 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfTypes.hxx"
-#include "SerfLockReqProcImpl.hxx"
-#include "DAVProperties.hxx"
-
-#include "webdavresponseparser.hxx"
-#include <serf.h>
-#include <rtl/ustrbuf.hxx>
-#include <apr_strings.h>
-
-namespace http_dav_ucp
-{
-
-SerfLockReqProcImpl::SerfLockReqProcImpl( const char* inSourcePath,
-                                          const DAVRequestHeaders& inRequestHeaders, // on debug the header look empty
-                                          const ucb::Lock& inLock,
-                                          const char* inTimeout,
-                                          DAVPropertyValue & outLock)
-    : SerfRequestProcessorImpl( inSourcePath, inRequestHeaders )
-    , mLock( inLock )
-    , mTimeout(inTimeout)
-    , mLockObtained( &outLock )
-    , xInputStream( new SerfInputStream() )
-{
-    switch ( inLock.Depth )
-    {
-        //i126305 TODO investigate on this case...
-    case ucb::LockDepth_MAKE_FIXED_SIZE:
-
-    case ucb::LockDepth_ZERO:
-        mDepthStr = "0";
-        break;
-    case ucb::LockDepth_ONE:
-            mDepthStr = "1";
-            break;
-    case ucb::LockDepth_INFINITY:
-            mDepthStr = "infinity";
-            break;
-    }
-
-    switch ( inLock.Scope )
-    {
-        //i126305 TODO investigate on this case...
-    case ucb::LockScope_MAKE_FIXED_SIZE:
-
-    case ucb::LockScope_EXCLUSIVE:
-        mLockScope = "<lockscope><exclusive/></lockscope>";
-        break;
-    case ucb::LockScope_SHARED:
-        mLockScope = "<lockscope><shared/></lockscope>";
-        break;
-    }
-}
-
-SerfLockReqProcImpl::~SerfLockReqProcImpl()
-{
-}
-
-#define LOCK_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><lockinfo xmlns=\"DAV:\">"
-#define LOCK_TYPE "<locktype><write/></locktype>"
-#define LOCK_TRAILER "</lockinfo>"
-
-serf_bucket_t * SerfLockReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-  //prepare body of request:
-    serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
-    serf_bucket_t* body_bkt = 0;
-    rtl::OString aBodyText;
-    {
-       rtl::OUStringBuffer aBuffer;
-        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_HEADER ));
-        aBuffer.appendAscii( mLockScope );
-        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_TYPE ));
-        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<owner>" ));
-        rtl::OUString aStr;
-        mLock.Owner >>= aStr;
-        aBuffer.appendAscii( rtl::OUStringToOString( aStr, RTL_TEXTENCODING_UTF8 ).getStr() );
-        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</owner>" ));
-        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( LOCK_TRAILER ));
-        aBodyText = rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
-        body_bkt = serf_bucket_simple_copy_create( aBodyText.getStr(),
-                                                   aBodyText.getLength(),
-                                                   pSerfBucketAlloc );
-    }
-
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest,
-                                                                 "LOCK",
-                                                                 getPathStr(),
-                                                                 body_bkt,
-                                                                 pSerfBucketAlloc );
-    handleChunkedEncoding(req_bkt, aBodyText.getLength());
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    if (hdrs_bkt != NULL)
-    {
-        // general header fields provided by caller
-        setRequestHeaders( hdrs_bkt );
-
-        // request specific header fields
-        serf_bucket_headers_set( hdrs_bkt, "Timeout", mTimeout );
-        serf_bucket_headers_set( hdrs_bkt, "Depth", mDepthStr );
-        if (hdrs_bkt!=NULL && body_bkt != 0 && aBodyText.getLength() > 0 )
-        {
-            serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
-        }
-    }
-    else
-    {
-        OSL_ASSERT("Headers Bucket missing");
-    }
-
-    return req_bkt;
-}
-
-void SerfLockReqProcImpl::processChunkOfResponseData( const char* data,
-                                                      apr_size_t len )
-{
-    if ( xInputStream.is() )
-    {
-        xInputStream->AddToStream( data, len );
-    }
-}
-
-void SerfLockReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
-{
-    const DAVPropertyValue rLocksValue( parseWebDAVLockResponse( xInputStream.get() ) );
-    *mLockObtained = rLocksValue;
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx
deleted file mode 100644
index 3983db21ec..0000000000
--- a/main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-#ifndef INCLUDED_SERFLOCKREQPROCIMPL_HXX
-#define INCLUDED_SERFLOCKREQPROCIMPL_HXX
-
-#include "SerfTypes.hxx"
-#include "SerfRequestProcessorImpl.hxx"
-
-#include "SerfInputStream.hxx"
-
-#include <vector>
-#include <rtl/ustring.hxx>
-#include "SerfTypes.hxx"
-#include "DAVTypes.hxx"
-#include "DAVResource.hxx"
-
-namespace http_dav_ucp
-{
-
-    class SerfLockReqProcImpl : public SerfRequestProcessorImpl
-    {
-
-    protected:
-        std::vector< DAVResource > mpResources;
-        const ucb::Lock     mLock;
-        const char*         mDepthStr;
-        const char*         mLockScope;
-        const char*         mTimeout;
-        DAVPropertyValue*   mLockObtained;
-        com::sun::star::uno::Reference< SerfInputStream > xInputStream;
-
-    public:
-        SerfLockReqProcImpl( const char* inSourcePath,
-                             const DAVRequestHeaders& inRequestHeaders,
-                             const ucb::Lock& inLock,
-                             const char* inTimeout,
-                             DAVPropertyValue & outLock);
-
-        virtual ~SerfLockReqProcImpl();
-
-        virtual
-        serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-
-    protected:
-        virtual
-        void processChunkOfResponseData( const char* data, apr_size_t len );
-
-        virtual
-        void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
-
-    };
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFLOCKREQPROCIMPL_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx
deleted file mode 100644
index cc3140452e..0000000000
--- a/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfMkColReqProcImpl.hxx"
-
-#include <serf.h>
-
-namespace http_dav_ucp
-{
-
-SerfMkColReqProcImpl::SerfMkColReqProcImpl( const char* inPath,
-                                            const DAVRequestHeaders& inRequestHeaders,
-                                            const char* inLockToken )
-    : SerfRequestProcessorImpl( inPath,inRequestHeaders )
-    , mpLockToken( inLockToken )
-{
-}
-
-SerfMkColReqProcImpl::~SerfMkColReqProcImpl()
-{
-}
-
-serf_bucket_t * SerfMkColReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
-                                                                 "MKCOL",
-                                                                 getPathStr(),
-                                                                 0,
-                                                                 serf_request_get_alloc( inSerfRequest ) );
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    // general header fields provided by caller
-    setRequestHeaders( hdrs_bkt );
-
-    return req_bkt;
-}
-
-void SerfMkColReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
-                                                       apr_size_t /*len*/ )
-{
-    // nothing to do;
-}
-
-void SerfMkColReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
-{
-    // nothing to do;
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx
deleted file mode 100644
index 662eb0a1f9..0000000000
--- a/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfMoveReqProcImpl.hxx"
-
-#include <serf.h>
-
-namespace http_dav_ucp
-{
-
-SerfMoveReqProcImpl::SerfMoveReqProcImpl( const char* inSourcePath,
-                                          const DAVRequestHeaders& inRequestHeaders,
-                                          const char* inDestinationPath,
-                                          const bool inOverwrite,
-                                          const char* inLockToken)
-    : SerfRequestProcessorImpl( inSourcePath, inRequestHeaders )
-    , mDestPathStr( inDestinationPath )
-    , mbOverwrite( inOverwrite )
-    , mpLockToken( inLockToken )
-{
-}
-
-SerfMoveReqProcImpl::~SerfMoveReqProcImpl()
-{
-}
-
-serf_bucket_t * SerfMoveReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
-                                                                 "MOVE",
-                                                                 getPathStr(),
-                                                                 0,
-                                                                 serf_request_get_alloc( inSerfRequest ) );
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    // general header fields provided by caller
-    setRequestHeaders( hdrs_bkt );
-    
-    // MOVE specific header fields
-    serf_bucket_headers_set( hdrs_bkt, "Destination", mDestPathStr );
-    if ( mbOverwrite )
-    {
-        serf_bucket_headers_set( hdrs_bkt, "Overwrite", "T" );
-    }
-    else
-    {
-        serf_bucket_headers_set( hdrs_bkt, "Overwrite", "F" );
-    }
-    if(mpLockToken)
-    {
-        serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
-    }
-
-    return req_bkt;
-}
-
-void SerfMoveReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
-                                                      apr_size_t /*len*/ )
-{
-    // nothing to do;
-}
-
-void SerfMoveReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
-{
-    // nothing to do;
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx
deleted file mode 100644
index cf49e9983c..0000000000
--- a/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-#ifndef INCLUDED_SERFMOVEREQPROCIMPL_HXX
-#define INCLUDED_SERFMOVEREQPROCIMPL_HXX
-
-#include "SerfRequestProcessorImpl.hxx"
-
-namespace http_dav_ucp
-{
-
-class SerfMoveReqProcImpl : public SerfRequestProcessorImpl
-{
-public:
-    SerfMoveReqProcImpl( const char* inSourcePath,
-                         const DAVRequestHeaders& inRequestHeaders,
-                         const char* inDestinationPath,
-                         const bool inOverwrite,
-                         const char* inLockToken );
-
-    virtual ~SerfMoveReqProcImpl();
-
-    virtual
-    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-
-protected:
-    virtual
-    void processChunkOfResponseData( const char* data, apr_size_t len );
-
-    virtual
-    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
-
-private:
-    const char* mDestPathStr;
-    const bool  mbOverwrite;
-    const char* mpLockToken;
-};
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFMOVEREQPROCIMPL_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
deleted file mode 100644
index 20cd38edc2..0000000000
--- a/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
+++ /dev/null
@@ -1,136 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfPostReqProcImpl.hxx"
-
-#include <serf.h>
-
-using namespace com::sun::star;
-
-namespace http_dav_ucp
-{
-
-SerfPostReqProcImpl::SerfPostReqProcImpl( const char* inPath,
-                                          const DAVRequestHeaders& inRequestHeaders,
-                                          const char* inData,
-                                          apr_size_t inDataLen,
-                                          const char* inLockToken,
-                                          const char* inContentType,
-                                          const char* inReferer,
-                                          const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , mpPostData( inData )
-    , mnPostDataLen( inDataLen )
-    , mpLockToken( inLockToken )
-    , mpContentType( inContentType )
-    , mpReferer( inReferer )
-    , xInputStream( xioInStrm )
-    , xOutputStream()
-{
-}
-
-SerfPostReqProcImpl::SerfPostReqProcImpl( const char* inPath,
-                                          const DAVRequestHeaders& inRequestHeaders,
-                                          const char* inData,
-                                          apr_size_t inDataLen,
-                                          const char* inLockToken,
-                                          const char* inContentType,
-                                          const char* inReferer,
-                                          const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , mpPostData( inData )
-    , mnPostDataLen( inDataLen )
-    , mpLockToken( inLockToken )
-    , mpContentType( inContentType )
-    , mpReferer( inReferer )
-    , xInputStream()
-    , xOutputStream( xioOutStrm )
-{
-}
-
-SerfPostReqProcImpl::~SerfPostReqProcImpl()
-{
-}
-
-serf_bucket_t * SerfPostReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-    serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
-
-    // create body bucket
-    serf_bucket_t* body_bkt = 0;
-    if ( mpPostData != 0 && mnPostDataLen > 0 )
-    {
-        body_bkt = SERF_BUCKET_SIMPLE_STRING_LEN( mpPostData, mnPostDataLen, pSerfBucketAlloc );
-    }
-
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
-                                                                 "POST",
-                                                                 getPathStr(),
-                                                                 body_bkt,
-                                                                 serf_request_get_alloc( inSerfRequest ) );
-    handleChunkedEncoding(req_bkt, mnPostDataLen);
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    // general header fields provided by caller
-    setRequestHeaders( hdrs_bkt );
-
-    // request specific header fields
-    if ( mpContentType != 0 )
-    {
-        serf_bucket_headers_set( hdrs_bkt, "Content-Type", mpContentType );
-    }
-    if ( mpReferer != 0 )
-    {
-        serf_bucket_headers_set( hdrs_bkt, "Referer", mpReferer );
-    }
-    if(mpLockToken)
-    {
-        serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
-    }
-
-    return req_bkt;
-}
-
-void SerfPostReqProcImpl::processChunkOfResponseData( const char* data, 
-                                                      apr_size_t len )
-{
-    if ( xInputStream.is() )
-    {
-        xInputStream->AddToStream( data, len );
-    }
-    else if ( xOutputStream.is() )
-    {
-        const uno::Sequence< sal_Int8 > aDataSeq( (sal_Int8 *)data, len );
-        xOutputStream->writeBytes( aDataSeq );
-    }
-}
-
-void SerfPostReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
-{
-    // nothing to do;
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx
deleted file mode 100644
index a0420faf3c..0000000000
--- a/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-#ifndef INCLUDED_SERFPOSTREQPROCIMPL_HXX
-#define INCLUDED_SERFPOSTREQPROCIMPL_HXX
-
-#include "SerfRequestProcessorImpl.hxx"
-
-#include "SerfInputStream.hxx"
-#include <com/sun/star/io/XOutputStream.hpp>
-
-namespace http_dav_ucp
-{
-
-class SerfPostReqProcImpl : public SerfRequestProcessorImpl
-{
-public:
-    SerfPostReqProcImpl( const char* inPath,
-                         const DAVRequestHeaders& inRequestHeaders,
-                         const char* inData,
-                         apr_size_t inDataLen,
-                         const char* inLockToken,
-                         const char* inContentType,
-                         const char* inReferer,
-                         const com::sun::star::uno::Reference< SerfInputStream > & xioInStrm );
-
-    SerfPostReqProcImpl( const char* inPath,
-                         const DAVRequestHeaders& inRequestHeaders,
-                         const char* inData,
-                         apr_size_t inDataLen,
-                         const char* inLockToken,
-                         const char* inContentType,
-                         const char* inReferer,
-                         const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > & xioOutStrm );
-
-    virtual ~SerfPostReqProcImpl();
-
-    virtual
-    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-
-protected:
-    virtual
-    void processChunkOfResponseData( const char* data, apr_size_t len );
-
-    virtual
-    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
-
-private:
-    const char* mpPostData;
-    apr_size_t mnPostDataLen;
-    const char* mpLockToken;
-    const char* mpContentType;
-    const char* mpReferer;
-    com::sun::star::uno::Reference< SerfInputStream > xInputStream;
-    com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > xOutputStream;
-
-};
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFPOSTREQPROCIMPL_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
deleted file mode 100644
index 806f50a00b..0000000000
--- a/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
+++ /dev/null
@@ -1,202 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfPropFindReqProcImpl.hxx"
-#include "SerfTypes.hxx"
-#include "DAVProperties.hxx"
-
-#include "webdavresponseparser.hxx"
-#include <comphelper/seqstream.hxx>
-#include <rtl/ustrbuf.hxx>
-
-
-using namespace com::sun::star;
-
-namespace http_dav_ucp
-{
-
-SerfPropFindReqProcImpl::SerfPropFindReqProcImpl( const char* inPath,
-                                                  const DAVRequestHeaders& inRequestHeaders,
-                                                  const Depth inDepth,
-                                                  const std::vector< ::rtl::OUString > & inPropNames,
-                                                  std::vector< DAVResource > & ioResources )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , mDepthStr( 0 )
-    , mpPropNames( &inPropNames )
-    , mpResources( &ioResources )
-    , mpResInfo( 0 )
-    , mbOnlyPropertyNames( false )
-    , xInputStream( new SerfInputStream() )
-{
-    init( inDepth );
-}
-
-SerfPropFindReqProcImpl::SerfPropFindReqProcImpl( const char* inPath,
-                                                  const DAVRequestHeaders& inRequestHeaders,
-                                                  const Depth inDepth,
-                                                  std::vector< DAVResourceInfo > & ioResInfo )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , mDepthStr( 0 )
-    , mpPropNames( 0 )
-    , mpResources( 0 )
-    , mpResInfo( &ioResInfo )
-    , mbOnlyPropertyNames( true )
-    , xInputStream( new SerfInputStream() )
-{
-    init( inDepth );
-}
-
-void SerfPropFindReqProcImpl::init( const Depth inDepth )
-{
-    switch ( inDepth )
-    {
-        case DAVZERO:
-            mDepthStr = "0";
-            break;
-        case DAVONE:
-            mDepthStr = "1";
-            break;
-        case DAVINFINITY:
-            mDepthStr = "infinity";
-            break;
-    }
-}
-
-SerfPropFindReqProcImpl::~SerfPropFindReqProcImpl()
-{
-}
-
-#define PROPFIND_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><propfind xmlns=\"DAV:\">"
-#define PROPFIND_TRAILER "</propfind>"
-
-serf_bucket_t * SerfPropFindReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-    serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
-
-    // body bucket - certain properties OR all properties OR only property names
-    serf_bucket_t* body_bkt = 0;
-    rtl::OString aBodyText;
-    {
-        // TODO is it really needed a Unicode string buffer?
-        // All properties and property names aren't supposed to be ASCII?
-        rtl::OUStringBuffer aBuffer;
-        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPFIND_HEADER ));
-
-        // create and fill body bucket with requested properties
-        const int nPropCount = ( !mbOnlyPropertyNames && mpPropNames )
-                               ? mpPropNames->size() 
-                               : 0;
-        if ( nPropCount > 0 )
-        {
-            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<prop>" ) );
-            SerfPropName thePropName;
-            for ( int theIndex = 0; theIndex < nPropCount; theIndex ++ )
-            {
-                // split fullname into namespace and name!
-                DAVProperties::createSerfPropName( (*mpPropNames)[ theIndex ], 
-                                                   thePropName );
-
-                /* <*propname* xmlns="*propns*" /> */
-                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
-                aBuffer.appendAscii( thePropName.name );
-                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " xmlnx=\"" ));
-                aBuffer.appendAscii( thePropName.nspace );
-                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\"/>" ));
-            }
-
-            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop>" ));
-        }
-        else
-        {
-            if ( mbOnlyPropertyNames )
-            {
-                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<propname/>" ));
-            }
-            else
-            {
-                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<allprop/>" ));
-            }
-        }
-
-        aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPFIND_TRAILER ));
-        aBodyText = rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
-        body_bkt = serf_bucket_simple_copy_create( aBodyText.getStr(),
-                                                   aBodyText.getLength(),
-                                                   pSerfBucketAlloc );
-    }
-
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
-                                                                 "PROPFIND",
-                                                                 getPathStr(),
-                                                                 body_bkt,
-                                                                 pSerfBucketAlloc );
-    handleChunkedEncoding(req_bkt, aBodyText.getLength());
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    if (hdrs_bkt != NULL)
-    {
-        // general header fields provided by caller
-        setRequestHeaders( hdrs_bkt );
-
-        // request specific header fields
-        serf_bucket_headers_set( hdrs_bkt, "Depth", mDepthStr );
-        if (hdrs_bkt!=NULL && body_bkt != 0 && aBodyText.getLength() > 0 )
-        {
-            serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
-        }
-    }
-    else
-    {
-        OSL_ASSERT("Headers Bucket missing");
-    }
-
-    return req_bkt;
-}
-
-void SerfPropFindReqProcImpl::processChunkOfResponseData( const char* data, 
-                                                          apr_size_t len )
-{
-    if ( xInputStream.is() )
-    {
-        xInputStream->AddToStream( data, len );
-    }
-}
-
-void SerfPropFindReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
-{
-    if ( mbOnlyPropertyNames )
-    {
-        const std::vector< DAVResourceInfo > rResInfo( parseWebDAVPropNameResponse( xInputStream.get() ) );
-        *mpResInfo = rResInfo;
-    }
-    else
-    {
-        const std::vector< DAVResource > rResources( parseWebDAVPropFindResponse( xInputStream.get() ) );
-        *mpResources = rResources;
-    }
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.hxx
deleted file mode 100644
index b6870a85ec..0000000000
--- a/main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.hxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-#ifndef INCLUDED_SERFPROPFINDREQPROCIMPL_HXX
-#define INCLUDED_SERFPROPFINDREQPROCIMPL_HXX
-
-#include "SerfRequestProcessorImpl.hxx"
-
-#include <vector>
-#include <rtl/ustring.hxx>
-#include "DAVTypes.hxx"
-#include "DAVResource.hxx"
-
-#include "SerfInputStream.hxx"
-
-namespace http_dav_ucp
-{
-
-class SerfPropFindReqProcImpl : public SerfRequestProcessorImpl
-{
-public:
-    SerfPropFindReqProcImpl( const char* inPath,
-                             const DAVRequestHeaders& inRequestHeaders,
-                             const Depth inDepth,
-                             const std::vector< ::rtl::OUString > & inPropNames,
-                             std::vector< DAVResource > & ioResources );
-    
-    SerfPropFindReqProcImpl( const char* inPath,
-                             const DAVRequestHeaders& inRequestHeaders,
-                             const Depth inDepth,
-                             std::vector< DAVResourceInfo > & ioResInfo );
-
-    virtual ~SerfPropFindReqProcImpl();
-
-    virtual
-    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-
-protected:
-    virtual
-    void processChunkOfResponseData( const char* data, apr_size_t len );
-
-    virtual
-    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
-
-private:
-    void init( const Depth inDepth );
-
-    const char* mDepthStr;
-    const std::vector< ::rtl::OUString > * mpPropNames;
-    std::vector< DAVResource > * mpResources;
-    std::vector< DAVResourceInfo > * mpResInfo;
-
-    const bool mbOnlyPropertyNames;
-    com::sun::star::uno::Reference< SerfInputStream > xInputStream;
-};
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFPROPFINDREQPROCIMPL_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
deleted file mode 100644
index 57c7e7350b..0000000000
--- a/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
+++ /dev/null
@@ -1,200 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include <rtl/ustring.hxx>
-#include <rtl/ustrbuf.hxx>
-#include "DAVProperties.hxx"
-#include "UCBDeadPropertyValue.hxx"
-
-#include "SerfPropPatchReqProcImpl.hxx"
-#include "SerfTypes.hxx"
-
-namespace http_dav_ucp
-{
-
-SerfPropPatchReqProcImpl::SerfPropPatchReqProcImpl( const char* inPath,
-                                                    const DAVRequestHeaders& inRequestHeaders,
-                                                    const std::vector< ProppatchValue > & inProperties,
-                                                    const char* inLockToken )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , mpProperties( &inProperties )
-    , mpLockToken( inLockToken )
-{
-}
-
-SerfPropPatchReqProcImpl::~SerfPropPatchReqProcImpl()
-{
-}
-
-#define PROPPATCH_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><propertyupdate xmlns=\"DAV:\">"
-#define PROPPATCH_TRAILER "</propertyupdate>"
-
-serf_bucket_t * SerfPropPatchReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-    serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
-
-    // body bucket
-    serf_bucket_t* body_bkt = 0;
-    rtl::OString aBodyText;
-    {
-        // create and fill body bucket with properties to be set or removed
-        static const struct
-        {
-            const char *str;
-            sal_Int32   len;
-        }
-        OpCode [] = {
-            { RTL_CONSTASCII_STRINGPARAM( "set" ) },
-            { RTL_CONSTASCII_STRINGPARAM( "remove" ) }
-        };
-        const int nPropCount = ( mpProperties != 0 )
-                               ? mpProperties->size() 
-                               : 0;
-        if ( nPropCount > 0 )
-        {
-            rtl::OUStringBuffer aBuffer;
-            // add PropPatch xml header in front
-            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPPATCH_HEADER ));
-
-            // <*operation code*><prop>
-
-            ProppatchOperation lastOp = (*mpProperties)[ 0 ].operation;
-            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
-            aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
-            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><prop>" ));
-
-            SerfPropName thePropName;
-            for ( int n = 0; n < nPropCount; ++n )
-            {
-                const ProppatchValue & rProperty = (*mpProperties)[ n ];
-                // split fullname into namespace and name!
-                DAVProperties::createSerfPropName( rProperty.name, 
-                                                   thePropName );
-
-                if ( rProperty.operation != lastOp )
-                {
-                    // </prop></*last operation code*><*operation code><prop>
-                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop></" ));
-                    aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
-                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><" ));
-                    aBuffer.appendAscii( OpCode[rProperty.operation].str, OpCode[rProperty.operation].len );
-                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "><prop>" ));
-                }
-
-                // <*propname* xmlns="*propns*"
-                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<" ));
-                aBuffer.appendAscii( thePropName.name );
-                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( " xmlns=\"" ));
-                aBuffer.appendAscii( thePropName.nspace );
-                aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\"" ));
-
-                if ( rProperty.operation == PROPSET )
-                {
-                    // >*property value*</*propname*>
-                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
-
-                    rtl::OUString aStringValue;
-                    if ( DAVProperties::isUCBDeadProperty( thePropName ) )
-                    {
-                        UCBDeadPropertyValue::toXML( rProperty.value,
-                                                     aStringValue );
-                    }
-                    else
-                    {
-                        rProperty.value >>= aStringValue;
-                    }
-                    aBuffer.append( aStringValue );
-                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</" ));
-                    aBuffer.appendAscii( thePropName.name );
-                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
-                }
-                else
-                {
-                    // />
-                    aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/>" ));
-                }
-
-                lastOp = rProperty.operation;
-            }
-
-            // </prop></*last operation code*>
-            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</prop></" ));
-            aBuffer.appendAscii( OpCode[lastOp].str, OpCode[lastOp].len );
-            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( ">" ));
-
-            // add PropPatch xml trailer at end
-            aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( PROPPATCH_TRAILER ));
-
-            aBodyText = rtl::OUStringToOString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
-            body_bkt = serf_bucket_simple_copy_create( aBodyText.getStr(),
-                                                       aBodyText.getLength(),
-                                                       pSerfBucketAlloc );
-        }
-    }
-
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest, 
-                                                                 "PROPPATCH",
-                                                                 getPathStr(),
-                                                                 body_bkt,
-                                                                 pSerfBucketAlloc ) ;
-    handleChunkedEncoding(req_bkt, aBodyText.getLength());
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    if (hdrs_bkt != NULL)
-    {
-        // general header fields provided by caller
-        setRequestHeaders( hdrs_bkt );
-
-        // request specific header fields
-        if(mpLockToken)
-        {
-            serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
-        }
-        if ( body_bkt != 0 && aBodyText.getLength() > 0 )
-        {
-            serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
-        }
-    }
-    else
-    {
-        OSL_ASSERT("Headers Bucket missing");
-    }
-
-    return req_bkt;
-}
-
-void SerfPropPatchReqProcImpl::processChunkOfResponseData( const char* /*data*/, 
-                                                           apr_size_t /*len*/ )
-{
-    // nothing to do;
-}
-
-void SerfPropPatchReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
-{
-    // nothing to do;
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.hxx
deleted file mode 100644
index 454344d750..0000000000
--- a/main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-#ifndef INCLUDED_SERFPROPPATCHREQPROCIMPL_HXX
-#define INCLUDED_SERFPROPPATCHREQPROCIMPL_HXX
-
-#include "SerfRequestProcessorImpl.hxx"
-
-#include <vector>
-#include "DAVTypes.hxx"
-
-namespace http_dav_ucp
-{
-
-class SerfPropPatchReqProcImpl : public SerfRequestProcessorImpl
-{
-public:
-    SerfPropPatchReqProcImpl( const char* inPath,
-                              const DAVRequestHeaders& inRequestHeaders,
-                              const std::vector< ProppatchValue > & inProperties,
-                              const char* inLockToken );
-
-    virtual ~SerfPropPatchReqProcImpl();
-
-    virtual
-    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-
-protected:
-    virtual
-    void processChunkOfResponseData( const char* data, apr_size_t len );
-
-    virtual
-    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
-
-private:
-    const std::vector< ProppatchValue > * mpProperties;
-    const  char *mpLockToken;
-};
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFPROPPATCHREQPROCIMPL_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx b/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
deleted file mode 100644
index 2057705458..0000000000
--- a/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include <rtl/ustring.hxx>
-
-#include "SerfPutReqProcImpl.hxx"
-
-#include <serf.h>
-
-namespace http_dav_ucp
-{
-
-SerfPutReqProcImpl::SerfPutReqProcImpl( const char* inPath,
-                                        const DAVRequestHeaders& inRequestHeaders,
-                                        const char* inData,
-                                        const char* inLockToken,
-                                        apr_size_t inDataLen )
-    : SerfRequestProcessorImpl( inPath, inRequestHeaders )
-    , mpData( inData )
-    , mpLockToken( inLockToken)
-    , mnDataLen( inDataLen )
-{
-}
-
-SerfPutReqProcImpl::~SerfPutReqProcImpl()
-{
-}
-
-serf_bucket_t * SerfPutReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
-{
-    serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
-
-    // create body bucket
-    serf_bucket_t* body_bkt = 0;
-    if ( mpData != 0 && mnDataLen > 0 )
-    {
-        body_bkt = SERF_BUCKET_SIMPLE_STRING_LEN( mpData, mnDataLen, pSerfBucketAlloc );
-    }
-
-    // create serf request
-    serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest,
-                                                                 "PUT",
-                                                                 getPathStr(),
-                                                                 body_bkt,
-                                                                 serf_request_get_alloc( inSerfRequest ) );
-    handleChunkedEncoding(req_bkt, mnDataLen);
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    // general header fields provided by caller
-    setRequestHeaders( hdrs_bkt );
-    if(mpLockToken)
-    {
-    // request specific header field
-        serf_bucket_headers_set( hdrs_bkt, "if", mpLockToken );
-    }
-
-    return req_bkt;
-}
-
-void SerfPutReqProcImpl::processChunkOfResponseData( const char* /*data*/,
-                                                     apr_size_t /*len*/ )
-{
-    // nothing to do;
-}
-
-void SerfPutReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
-{
-    // nothing to do;
-}
-
-} // namespace http_dav_ucp
diff --git a/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx b/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx
deleted file mode 100644
index 887e1612d2..0000000000
--- a/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-#ifndef INCLUDED_SERFPUTREQPROCIMPL_HXX
-#define INCLUDED_SERFPUTREQPROCIMPL_HXX
-
-#include "SerfRequestProcessorImpl.hxx"
-
-namespace http_dav_ucp
-{
-
-class SerfPutReqProcImpl : public SerfRequestProcessorImpl
-{
-public:
-    SerfPutReqProcImpl( const char* inPath,
-                        const DAVRequestHeaders& inRequestHeaders,
-                        const char* inData,
-                        const char* inLockToken,
-                        apr_size_t inDataLen );
-    
-
-    virtual ~SerfPutReqProcImpl();
-
-    virtual
-    serf_bucket_t * createSerfRequestBucket( serf_request_t * inSerfRequest );
-
-protected:
-    virtual
-    void processChunkOfResponseData( const char* data, apr_size_t len );
-
-    virtual
-    void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket );
-
-private:
-    const char* mpData;
-    const char* mpLockToken;
-    apr_size_t mnDataLen;
-
-};
-
-} // namespace http_dav_ucp
-
-#endif // INCLUDED_SERFPUTREQPROCIMPL_HXX
diff --git a/main/ucb/source/ucp/webdav/SerfRequestProcessor.cxx b/main/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
deleted file mode 100644
index e3786301d8..0000000000
--- a/main/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
+++ /dev/null
@@ -1,721 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_webdav.hxx"
-
-#include "SerfRequestProcessor.hxx"
-#include "SerfRequestProcessorImpl.hxx"
-#include "SerfRequestProcessorImplFac.hxx"
-#include "SerfCallbacks.hxx"
-#include "SerfSession.hxx"
-
-#include <apr_strings.h>
-
-//to examine returned http code
-#include "DAVException.hxx"
-
-namespace http_dav_ucp
-{
-
-SerfRequestProcessor::SerfRequestProcessor( SerfSession& rSerfSession,
-                                            const rtl::OUString & inPath,
-                                            const bool bUseChunkedEncoding )
-    : mrSerfSession( rSerfSession )
-    , mPathStr( 0 )
-    , mbUseChunkedEncoding( bUseChunkedEncoding )
-    , mDestPathStr( 0 )
-    , mContentType( 0 )
-    , mReferer( 0 )
-    , mpProcImpl( 0 )
-    , mbProcessingDone( false )
-    , mpDAVException()
-    , mnHTTPStatusCode( SC_NONE )
-    , mHTTPStatusCodeText()
-    , mRedirectLocation()
-    , mnSuccessfulCredentialAttempts( 0 )
-    , mbInputOfCredentialsAborted( false )
-    , mbSetupSerfRequestCalled( false )
-    , mbAcceptSerfResponseCalled( false )
-    , mbHandleSerfResponseCalled( false )
-{
-    mPathStr = apr_pstrdup( mrSerfSession.getAprPool(), 
-                            rtl::OUStringToOString( inPath, RTL_TEXTENCODING_UTF8 ).getStr() );
-}
-
-SerfRequestProcessor::~SerfRequestProcessor()
-{
-    delete mpProcImpl;
-    delete mpDAVException;
-}
-
-void SerfRequestProcessor::prepareProcessor()
-{
-    delete mpDAVException;
-    mpDAVException = 0;
-    mnHTTPStatusCode = SC_NONE;
-    mHTTPStatusCodeText = rtl::OUString();
-    mRedirectLocation = rtl::OUString();
-
-    mnSuccessfulCredentialAttempts = 0;
-    mbInputOfCredentialsAborted = false;
-    mbSetupSerfRequestCalled = false;
-    mbAcceptSerfResponseCalled = false;
-    mbHandleSerfResponseCalled = false;
-}
-
-// PROPFIND - allprop & named
-bool SerfRequestProcessor::processPropFind( const Depth inDepth,
-                                            const std::vector< ::rtl::OUString > & inPropNames,
-                                            std::vector< DAVResource > & ioResources,
-                                            apr_status_t& outSerfStatus )
-{
-    mpProcImpl = createPropFindReqProcImpl( mPathStr,
-                                            mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                            inDepth,
-                                            inPropNames,
-                                            ioResources );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// PROPFIND - property names
-bool SerfRequestProcessor::processPropFind( const Depth inDepth,
-                                            std::vector< DAVResourceInfo > & ioResInfo,
-                                            apr_status_t& outSerfStatus )
-{
-    mpProcImpl = createPropFindReqProcImpl( mPathStr,
-                                            mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                            inDepth,
-                                            ioResInfo );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// PROPPATCH
-bool SerfRequestProcessor::processPropPatch( const std::vector< ProppatchValue > & inProperties,
-                                             const com::sun::star::ucb::Lock  inLock,
-                                             apr_status_t& outSerfStatus )
-{
-    char * inLockToken = static_cast<char*>(0);
-    if(inLock.LockTokens.getLength() > 0)
-    {
-        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
-                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
-    }
-    mpProcImpl = createPropPatchReqProcImpl( mPathStr,
-                                             mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                             inProperties,
-                                             inLockToken );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// GET
-bool SerfRequestProcessor::processGet( const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm, 
-                                       apr_status_t& outSerfStatus )
-{
-    mpProcImpl = createGetReqProcImpl( mPathStr,
-                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                       xioInStrm );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// GET inclusive header fields
-bool SerfRequestProcessor::processGet( const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm, 
-                                       const std::vector< ::rtl::OUString > & inHeaderNames,
-                                       DAVResource & ioResource,
-                                       apr_status_t& outSerfStatus )
-{
-    mpProcImpl = createGetReqProcImpl( mPathStr,
-                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                       xioInStrm,
-                                       inHeaderNames,
-                                       ioResource );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// GET
-bool SerfRequestProcessor::processGet( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm, 
-                                       apr_status_t& outSerfStatus )
-{
-    mpProcImpl = createGetReqProcImpl( mPathStr,
-                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                       xioOutStrm );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// GET inclusive header fields
-bool SerfRequestProcessor::processGet( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm, 
-                                       const std::vector< ::rtl::OUString > & inHeaderNames,
-                                       DAVResource & ioResource,
-                                       apr_status_t& outSerfStatus )
-{
-    mpProcImpl = createGetReqProcImpl( mPathStr,
-                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                       xioOutStrm,
-                                       inHeaderNames,
-                                       ioResource );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// HEAD
-bool SerfRequestProcessor::processHead( const std::vector< ::rtl::OUString > & inHeaderNames,
-                                        DAVResource & ioResource,
-                                        apr_status_t& outSerfStatus )
-{
-    mpProcImpl = createHeadReqProcImpl( mPathStr,
-                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                        inHeaderNames,
-                                        ioResource );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// PUT
-bool SerfRequestProcessor::processPut( const char* inData,
-                                       apr_size_t inDataLen,
-                                       const com::sun::star::ucb::Lock inLock,
-                                       apr_status_t& outSerfStatus )
-{
-    char * inLockToken = static_cast<char*>(0);
-    if(inLock.LockTokens.getLength() > 0)
-    {
-        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
-                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
-    }
-    mpProcImpl = createPutReqProcImpl( mPathStr,
-                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                       inData,
-                                       inLockToken,
-                                       inDataLen );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// POST
-bool SerfRequestProcessor::processPost( const char* inData,
-                                        apr_size_t inDataLen,
-                                        const rtl::OUString & inContentType,
-                                        const rtl::OUString & inReferer,
-                                        const com::sun::star::ucb::Lock inLock,
-                                        const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm,
-                                        apr_status_t& outSerfStatus )
-{
-    mContentType = apr_pstrdup( mrSerfSession.getAprPool(), 
-                                rtl::OUStringToOString( inContentType, RTL_TEXTENCODING_UTF8 ).getStr() );
-    mReferer = apr_pstrdup( mrSerfSession.getAprPool(), 
-                                rtl::OUStringToOString( inReferer, RTL_TEXTENCODING_UTF8 ).getStr() );
-    char * inLockToken = static_cast<char*>(0);
-    if(inLock.LockTokens.getLength() > 0)
-    {
-        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
-                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
-    }
-    mpProcImpl = createPostReqProcImpl( mPathStr,
-                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                        inData,
-                                        inDataLen,
-                                        inLockToken,
-                                        mContentType,
-                                        mReferer,
-                                        xioInStrm );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// POST
-bool SerfRequestProcessor::processPost( const char* inData,
-                                        apr_size_t inDataLen,
-                                        const rtl::OUString & inContentType,
-                                        const rtl::OUString & inReferer,
-                                        const com::sun::star::ucb::Lock inLock,
-                                        const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm,
-                                        apr_status_t& outSerfStatus )
-{
-    mContentType = apr_pstrdup( mrSerfSession.getAprPool(), 
-                                rtl::OUStringToOString( inContentType, RTL_TEXTENCODING_UTF8 ).getStr() );
-    mReferer = apr_pstrdup( mrSerfSession.getAprPool(), 
-                            rtl::OUStringToOString( inReferer, RTL_TEXTENCODING_UTF8 ).getStr() );
-    char * inLockToken = static_cast<char*>(0);
-    if(inLock.LockTokens.getLength() > 0)
-    {
-        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
-                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
-    }
-    mpProcImpl = createPostReqProcImpl( mPathStr,
-                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                        inData,
-                                        inDataLen,
-                                        inLockToken,
-                                        mContentType,
-                                        mReferer,
-                                        xioOutStrm );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// DELETE
-bool SerfRequestProcessor::processDelete( const com::sun::star::ucb::Lock inLock,
-                                          apr_status_t& outSerfStatus )
-{
-    char * inLockToken = static_cast<char*>(0);
-    if(inLock.LockTokens.getLength() > 0)
-    {
-        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
-                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
-    }
-    mpProcImpl = createDeleteReqProcImpl( mPathStr,
-                                          mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                          inLockToken );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// MKCOL
-bool SerfRequestProcessor::processMkCol( const com::sun::star::ucb::Lock inLock,
-                                         apr_status_t& outSerfStatus )
-{
-    char * inLockToken = static_cast<char*>(0);
-    if(inLock.LockTokens.getLength() > 0)
-    {
-        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
-                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
-    }
-    mpProcImpl = createMkColReqProcImpl( mPathStr,
-                                         mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                         inLockToken );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// COPY
-bool SerfRequestProcessor::processCopy( const rtl::OUString & inDestinationPath,
-                                        const bool inOverwrite,
-                                        const com::sun::star::ucb::Lock inLock,
-                                        apr_status_t& outSerfStatus )
-{
-    mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(), 
-                                rtl::OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
-    char * inLockToken = static_cast<char*>(0);
-    if(inLock.LockTokens.getLength() > 0)
-    {
-        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
-                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
-    }
-    mpProcImpl = createCopyReqProcImpl( mPathStr,
-                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                        mDestPathStr,
-                                        inOverwrite,
-                                        inLockToken );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-// MOVE
-bool SerfRequestProcessor::processMove( const rtl::OUString & inDestinationPath,
-                                        const bool inOverwrite,
-                                        const com::sun::star::ucb::Lock  inLock,
-                                        apr_status_t& outSerfStatus )
-{
-    mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(), 
-                                rtl::OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
-    char * inLockToken = static_cast<char*>(0);
-    if(inLock.LockTokens.getLength() > 0)
-    {
-        inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
-                               rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
-    }
-    mpProcImpl = createMoveReqProcImpl( mPathStr,
-                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                        mDestPathStr,
-                                        inOverwrite,
-                                        inLockToken );
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-//LOCK creating a new lock
-bool SerfRequestProcessor::processLock( const rtl::OUString & inDestinationPath,
-                                        const com::sun::star::ucb::Lock& inLock,
-                                        DAVPropertyValue & outLock,
-                                        apr_status_t& outSerfStatus )
-{
-    mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(),
-                                rtl::OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
-    char * Timeout;
-    if(inLock.Timeout == -1)
-        Timeout = apr_psprintf( mrSerfSession.getAprPool(), "Infinite" );
-    else
-        Timeout = apr_psprintf( mrSerfSession.getAprPool(), "Second-%ld", inLock.Timeout );
-
-    mpProcImpl = createLockReqProcImpl( mPathStr,
-                                        mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                        inLock,
-                                        Timeout,
-                                        outLock);
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-//LOCK refresh an existing lock
-bool SerfRequestProcessor::processLockRefresh( const rtl::OUString & inDestinationPath,
-                                        const com::sun::star::ucb::Lock& inLock,
-                                        DAVPropertyValue & outLock,
-                                        apr_status_t& outSerfStatus )
-{
-    mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(),
-                                rtl::OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
-    char * Timeout;
-    if(inLock.Timeout == -1)
-        Timeout = apr_psprintf( mrSerfSession.getAprPool(), "Infinite" );
-    else
-        Timeout = apr_psprintf( mrSerfSession.getAprPool(), "Second-%ld", inLock.Timeout );
-
-    char * inLockToken = apr_psprintf( mrSerfSession.getAprPool(), "(<%s>)",
-                                 rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
-
-    mpProcImpl = createLockRefreshProcImpl( mPathStr,
-                                            mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                            inLock,
-                                            inLockToken,
-                                            Timeout,
-                                            outLock);
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-//ULOCK unlock an existing lock
-bool SerfRequestProcessor::processUnlock( const rtl::OUString & inDestinationPath,
-                                        const com::sun::star::ucb::Lock& inLock,
-                                        apr_status_t& outSerfStatus )
-{
-    mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(),
-                                rtl::OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
-
-    char * aToken = apr_psprintf( mrSerfSession.getAprPool(), "<%s>",
-                                 rtl::OUStringToOString(inLock.LockTokens[0], RTL_TEXTENCODING_UTF8 ).getStr() );
-
-    mpProcImpl = createUnlockProcImpl( mPathStr,
-                                       mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
-                                       inLock,
-                                       aToken );
-
-    outSerfStatus = runProcessor();
-
-    return outSerfStatus == APR_SUCCESS;
-}
-
-apr_status_t SerfRequestProcessor::runProcessor()
-{
-    prepareProcessor();
-
-    // activate chunked encoding, if requested
-    if ( mbUseChunkedEncoding )
-    {
-        mpProcImpl->activateChunkedEncoding();
-    }
-
-    // create serf request
-    OSL_ASSERT(mrSerfSession.getSerfConnection() != NULL);
-    serf_connection_request_create( mrSerfSession.getSerfConnection(),
-                                    Serf_SetupRequest,
-                                    this );
-
-    // perform serf request
-    mbProcessingDone = false;
-    apr_status_t status = APR_SUCCESS;
-    serf_context_t* pSerfContext = mrSerfSession.getSerfContext();
-    apr_pool_t* pAprPool = mrSerfSession.getAprPool();
-    while ( true )
-    {
-        status = serf_context_run( pSerfContext,
-                                   SERF_DURATION_FOREVER,
-                                   pAprPool );
-        if ( APR_STATUS_IS_TIMEUP( status ) )
-        {
-            continue;
-        }
-        if ( status != APR_SUCCESS )
-        {
-#if OSL_DEBUG_LEVEL > 0
-            char buff[512];
-            OSL_TRACE("SerfRequestProcessor::runProcessor, status != APR_SUCCESS: %d (%s)",status, apr_strerror(status, buff, 512));
-#endif
-            break;
-        }
-        if ( mbProcessingDone )
-        {
-            break;
-        }
-    }
-
-    postprocessProcessor( status );
-
-    return status;
-}
-
-void SerfRequestProcessor::postprocessProcessor( const apr_status_t inStatus )
-{
-    if ( inStatus == APR_SUCCESS )
-    {
-        return;
-    }
-
-    OSL_TRACE("SerfRequestProcessor::postprocessProcessor:%d",__LINE__);
-    switch ( inStatus )
-    {
-    case APR_EGENERAL:
-    case SERF_ERROR_AUTHN_FAILED:
-        // general error; <mnHTTPStatusCode> provides more information
-        {
-            switch ( mnHTTPStatusCode )
-            {
-            case SC_NONE:
-                if ( !mbSetupSerfRequestCalled )
-                {
-                    mpDAVException = new DAVException( DAVException::DAV_HTTP_LOOKUP,
-                                                       SerfUri::makeConnectionEndPointString( mrSerfSession.getHostName(),
-                                                                                              mrSerfSession.getPort() ) );
-                }
-                else if ( mbInputOfCredentialsAborted )
-                {
-                    mpDAVException = new DAVException( DAVException::DAV_HTTP_NOAUTH,
-                                                       SerfUri::makeConnectionEndPointString( mrSerfSession.getHostName(),
-                                                                                              mrSerfSession.getPort() ) );
-                }
-                else
-                {
-                    mpDAVException = new DAVException( DAVException::DAV_HTTP_ERROR,
-                                                       mHTTPStatusCodeText,
-                                                       mnHTTPStatusCode );
-                }
-                break;
-            case SC_MOVED_PERMANENTLY:
-            case SC_MOVED_TEMPORARILY:
-            case SC_SEE_OTHER:
-            case SC_TEMPORARY_REDIRECT:
-                mpDAVException = new DAVException( DAVException::DAV_HTTP_REDIRECT,
-                                                   mRedirectLocation );
-                break;
-            case SC_LOCKED:
-                mpDAVException = new DAVException( DAVException::DAV_LOCKED,
-                                                   mHTTPStatusCodeText,
-                                                   mnHTTPStatusCode );
-                break;
-            default:
-                mpDAVException = new DAVException( DAVException::DAV_HTTP_ERROR,
-                                                   mHTTPStatusCodeText,
-                                                   mnHTTPStatusCode );
-                break;
-            }
-        }
-        break;
-
-    default:
-        mpDAVException = new DAVException( DAVException::DAV_HTTP_ERROR );
-        break;
-    }
-}
-
-apr_status_t SerfRequestProcessor::provideSerfCredentials( char ** outUsername,
-                                                           char ** outPassword,
-                                                           serf_request_t * inRequest,
-                                                           int inCode,
-                                                           const char *inAuthProtocol,
-                                                           const char *inRealm,
-                                                           apr_pool_t *inAprPool )
-{
-    // as each successful provided credentials are tried twice - see below - the
-    // number of real attempts is half of the value of <mnSuccessfulCredentialAttempts>
-    if ( (mnSuccessfulCredentialAttempts / 2) >= 5 ||
-         mbInputOfCredentialsAborted )
-    {
-        mbInputOfCredentialsAborted = true;
-        return SERF_ERROR_AUTHN_FAILED;
-    }
-
-    // because serf keeps credentials only for a connection in case of digest authentication
-    // we give each successful provided credentials a second try in order to workaround the
-    // situation that the connection for which the credentials have been provided has been closed
-    // before the provided credentials could be applied for the request.
-    apr_status_t status = mrSerfSession.provideSerfCredentials( (mnSuccessfulCredentialAttempts % 2) == 1,
-                                                                outUsername,
-                                                                outPassword,
-                                                                inRequest,
-                                                                inCode,
-                                                                inAuthProtocol,
-                                                                inRealm,
-                                                                inAprPool );
-    if ( status != APR_SUCCESS )
-    {
-        mbInputOfCredentialsAborted = true;
-    }
-    else
-    {
-        ++mnSuccessfulCredentialAttempts;
-    }
-
-    return status;
-}
-
-apr_status_t SerfRequestProcessor::setupSerfRequest( serf_request_t * inSerfRequest,
-                                   serf_bucket_t ** outSerfRequestBucket,
-                                   serf_response_acceptor_t * outSerfResponseAcceptor,
-                                   void ** outSerfResponseAcceptorBaton,
-                                   serf_response_handler_t * outSerfResponseHandler,
-                                   void ** outSerfResponseHandlerBaton,
-                                   apr_pool_t * /*inAprPool*/ )
-{
-    mbSetupSerfRequestCalled = true;
-    *outSerfRequestBucket = mpProcImpl->createSerfRequestBucket( inSerfRequest );
-
-    // apply callbacks for accepting response and handling response
-    *outSerfResponseAcceptor = Serf_AcceptResponse;
-    *outSerfResponseAcceptorBaton = this;
-    *outSerfResponseHandler = Serf_HandleResponse;
-    *outSerfResponseHandlerBaton = this;
-
-    return APR_SUCCESS;
-}
-
-serf_bucket_t* SerfRequestProcessor::acceptSerfResponse( serf_request_t * inSerfRequest,
-                                                         serf_bucket_t * inSerfStreamBucket,
-                                                         apr_pool_t * inAprPool )
-{
-    mbAcceptSerfResponseCalled = true;
-    return mrSerfSession.acceptSerfResponse( inSerfRequest,
-                                             inSerfStreamBucket,
-                                             inAprPool );
-}
-
-apr_status_t SerfRequestProcessor::handleSerfResponse( serf_request_t * inSerfRequest,
-                                                       serf_bucket_t * inSerfResponseBucket,
-                                                       apr_pool_t * inAprPool )
-{
-    mbHandleSerfResponseCalled = true;
-
-    // some general response handling and error handling
-    {
-        if ( !inSerfResponseBucket )
-        {
-            /* A NULL response can come back if the request failed completely */
-            mbProcessingDone = true;
-            return APR_EGENERAL;
-        }
-
-        serf_status_line sl;
-        apr_status_t status = serf_bucket_response_status( inSerfResponseBucket, &sl );
-        if ( status )
-        {
-            mbProcessingDone = false; // allow another try in order to get a response
-            return status;
-        }
-        serf_bucket_t *headers = serf_bucket_response_get_headers( inSerfResponseBucket );
-
-        // check header according:
-        // http://tools.ietf.org/html/rfc7231#section-7.4.2
-        // need to do this so we can adjust the protocol accordingly
-        // serf_bucket_headers_get is case independent
-        const char* server = serf_bucket_headers_get( headers, "server" );
-        if( server )
-        {
-            //update the server type on session
-            mrSerfSession.setServerHeaderField( ::rtl::OUString::createFromAscii( server ) );
-        }
-        //the following extension is MS IIS specific,
-        //see https://msdn.microsoft.com/en-us/library/cc250064.aspx
-        //site last checked on 2015-03-02
-        //TODO i126305 need to be added when serf is updated to a version supporting Windows authentication
-        //const char* msDavExtErr = serf_bucket_headers_get( headers, "X-MSDAVEXT_ERROR" );
-
-        // TODO - check, if response status code handling is correct
-        mnHTTPStatusCode = ( sl.version != 0 && sl.code >= 0 )
-                           ? static_cast< sal_uInt16 >( sl.code )
-                           : SC_NONE;
-        if ( sl.reason )
-        {
-            mHTTPStatusCodeText = ::rtl::OUString::createFromAscii( sl.reason );
-        }
-        if ( ( sl.version == 0 || sl.code < 0 ) ||
-             mnHTTPStatusCode >= 300 )
-        {
-            if ( mnHTTPStatusCode == 301 ||
-                 mnHTTPStatusCode == 302 ||
-                 mnHTTPStatusCode == 303 ||
-                 mnHTTPStatusCode == 307 )
-            {
-                // new location for certain redirections
-                const char* location = serf_bucket_headers_get( headers, "Location" );
-                if ( location )
-                {
-                    mRedirectLocation = rtl::OUString::createFromAscii( location );
-                }
-                mbProcessingDone = true;
-                return APR_EGENERAL;
-            }
-            else if ( mrSerfSession.isHeadRequestInProgress() &&
-                      ( mnHTTPStatusCode == 401 || mnHTTPStatusCode == 407 ) )
-            {
-                // keep going as authentication is not required on HEAD request.
-                // the response already contains header fields.
-            }
-            else
-            {
-                mbProcessingDone = true;
-                return APR_EGENERAL;
-            }
-        }
-    }
-
-    // request specific processing of the response bucket
-    apr_status_t status = APR_SUCCESS;
-    mbProcessingDone = mpProcImpl->processSerfResponseBucket( inSerfRequest,
-                                                              inSerfResponseBucket,
-                                                              inAprPool,
-                                                              status );
-
-    return status;
-}
-
-} // namespace http_dav_ucp
-
diff --git a/main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx b/main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
deleted file mode 100644
index 36d63f0025..0000000000
--- a/main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
+++ /dev/null
@@ -1,208 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-#ifndef INCLUDED_SERFREQUESTPROCESSOR_HXX
-#define INCLUDED_SERFREQUESTPROCESSOR_HXX
-
-#include <apr_errno.h>
-#include <apr_pools.h>
-
-#include <serf.h>
-
-#include "DAVTypes.hxx"
-#include "DAVResource.hxx"
-#include "DAVException.hxx"
-
-#include "SerfTypes.hxx"
-#include "SerfInputStream.hxx"
-#include <com/sun/star/io/XOutputStream.hpp>
-
-namespace http_dav_ucp
-{
-
-class SerfSession;
-class SerfRequestProcessorImpl;
-
-class SerfRequestProcessor
-{
-public:
-    SerfRequestProcessor( SerfSession& rSerfSession,
-                          const rtl::OUString & inPath,
-                          const bool bUseChunkedEncoding );
-    ~SerfRequestProcessor();
-
-    // PROPFIND - allprop & named
-    bool processPropFind( const Depth inDepth,
-                          const std::vector< ::rtl::OUString > & inPropNames,
-                          std::vector< DAVResource > & ioResources,
-                          apr_status_t& outSerfStatus );
-
-    // PROPFIND - property names
-    bool processPropFind( const Depth inDepth,
-                          std::vector< DAVResourceInfo > & ioResInfo,
-                          apr_status_t& outSerfStatus );
-
-    // PROPPATCH
-    bool processPropPatch( const std::vector< ProppatchValue > & inProperties,
-                           const com::sun::star::ucb::Lock  inLock,
-                           apr_status_t& outSerfStatus );
-
-    // GET
-    bool processGet( const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm, 
-                     apr_status_t& outSerfStatus );
-
-    // GET inclusive header fields
-    bool processGet( const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm, 
-                     const std::vector< ::rtl::OUString > & inHeaderNames,
-                     DAVResource & ioResource,
-                     apr_status_t& outSerfStatus );
-
-    // GET
-    bool processGet( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm,
-                     apr_status_t& outSerfStatus );
-
-    // GET inclusive header fields
-    bool processGet( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm,
-                     const std::vector< ::rtl::OUString > & inHeaderNames,
-                     DAVResource & ioResource,
-                     apr_status_t& outSerfStatus );
-
-    // HEAD
-    bool processHead( const std::vector< ::rtl::OUString > & inHeaderNames,
-                      DAVResource & ioResource,
-                      apr_status_t& outSerfStatus );
-
-    // PUT
-    bool processPut( const char* inData,
-                     apr_size_t inDataLen,
-                     const com::sun::star::ucb::Lock  inLock,
-                     apr_status_t& outSerfStatus );
-
-    // POST
-    bool processPost( const char* inData,
-                      apr_size_t inDataLen,
-                      const rtl::OUString & inContentType,
-                      const rtl::OUString & inReferer,
-                      const com::sun::star::ucb::Lock  inLock,
-                      const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm,
-                      apr_status_t& outSerfStatus );
-
-    // POST
-    bool processPost( const char* inData,
-                      apr_size_t inDataLen,
-                      const rtl::OUString & inContentType,
-                      const rtl::OUString & inReferer,
-                      const com::sun::star::ucb::Lock  inLock,
-                      const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm,
-                      apr_status_t& outSerfStatus );
-
-    // DELETE
-    bool processDelete( const com::sun::star::ucb::Lock inLock,
-                        apr_status_t& outSerfStatus );
-
-    // MKCOL
-    bool processMkCol( const com::sun::star::ucb::Lock inLock,
-                       apr_status_t& outSerfStatus );
-
-    // COPY
-    bool processCopy( const rtl::OUString & inDestinationPath,
-                      const bool inOverwrite,
-                      const com::sun::star::ucb::Lock inLock,
-                      apr_status_t& outSerfStatus );
-
-    // MOVE
-    bool processMove( const rtl::OUString & inDestinationPath,
-                      const bool inOverwrite,
-                      const com::sun::star::ucb::Lock inLock,
-                      apr_status_t& outSerfStatus );
-
-    // LOCK
-    bool processLock( const rtl::OUString & inDestinationPath,
... 2846 lines suppressed ...


(openoffice) 08/12: Upgrade OpenSSL to version 3.0.13.

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 979772527e057b70bb93d4370b1de45120f68236
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Mon Mar 18 17:20:28 2024 +0200

    Upgrade OpenSSL to version 3.0.13.
    
    LICENSE and NOTICE files now reflect its new license.
    The obsolete "DISABLE_OPENSSL" setting has been removed.
    Patch Python 2 to support OpenSSL 3.0.x.
    Support old versions of Windows.
    Uses Strawberry Perl on Windows to build, fetched as a dependency.
    Workarounds for missing integer limit constants in the old version of MSVC we use.
    NASM now works when it's in the PATH, instead of needing --with-nasm-path to ./configure.
    
    Patch by: me
    
    (cherry picked from commit 4c5b548fb6ece87dd30bbf720aca0d994a749167)
---
 main/LICENSE                              | 125 -------
 main/NOTICE                               |  10 +-
 main/RepositoryFixes.mk                   |   4 +-
 main/external_deps.lst                    |  15 +-
 main/openssl/makefile.mk                  |  94 ++---
 main/openssl/openssl.patch                | 214 +++--------
 main/openssl/openssllnx.patch             |  25 --
 main/openssl/opensslunx.patch             |  10 +
 main/openssl/prj/d.lst                    |   6 +-
 main/python/python-2.7.18-msvs9.patch     | 579 +++++++++++++++---------------
 main/scp2/source/ooo/file_library_ooo.scp |   4 +-
 11 files changed, 427 insertions(+), 659 deletions(-)

diff --git a/main/LICENSE b/main/LICENSE
index aa6d1e0b1e..9cf79ea9fb 100644
--- a/main/LICENSE
+++ b/main/LICENSE
@@ -1210,131 +1210,6 @@ ings in this Software without prior written authorization from him.
 
 ____
 
-For OpenSSL - built in main/openssl/:
-- BSD-style license with advertising clause
-
-The OpenSSL toolkit stays under a double license, i.e. both the conditions of
-the OpenSSL License and the original SSLeay license apply to the toolkit.
-See below for the actual license texts. Actually both licenses are BSD-style
-Open Source licenses. In case of any license issues related to OpenSSL
-please contact openssl-core@openssl.org.
-
-OpenSSL License
----------------
-
-===================================================================
-Copyright (c) 1998-2018 The OpenSSL Project.  All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in
-   the documentation and/or other materials provided with the
-   distribution.
-
-3. All advertising materials mentioning features or use of this
-   software must display the following acknowledgment:
-   "This product includes software developed by the OpenSSL Project
-   for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
-
-4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
-   endorse or promote products derived from this software without
-   prior written permission. For written permission, please contact
-   openssl-core@openssl.org.
-
-5. Products derived from this software may not be called "OpenSSL"
-   nor may "OpenSSL" appear in their names without prior written
-   permission of the OpenSSL Project.
-
-6. Redistributions of any form whatsoever must retain the following
-   acknowledgment:
-   "This product includes software developed by the OpenSSL Project
-   for use in the OpenSSL Toolkit (http://www.openssl.org/)"
-
-THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
-EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
-ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-===================================================================
-
-This product includes cryptographic software written by Eric Young
-(eay@cryptsoft.com).  This product includes software written by Tim
-Hudson (tjh@cryptsoft.com).
-
-Original SSLeay License
------------------------
-
-Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
-All rights reserved.
-
-This package is an SSL implementation written
-by Eric Young (eay@cryptsoft.com).
-The implementation was written so as to conform with Netscapes SSL.
-
-This library is free for commercial and non-commercial use as long as
-the following conditions are aheared to.  The following conditions
-apply to all code found in this distribution, be it the RC4, RSA,
-lhash, DES, etc., code; not just the SSL code.  The SSL documentation
-included with this distribution is covered by the same copyright terms
-except that the holder is Tim Hudson (tjh@cryptsoft.com).
-
-Copyright remains Eric Young's, and as such any Copyright notices in
-the code are not to be removed.
-If this package is used in a product, Eric Young should be given attribution
-as the author of the parts of the library used.
-This can be in the form of a textual message at program startup or
-in documentation (online or textual) provided with the package.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
-   must display the following acknowledgement:
-   "This product includes cryptographic software written by
-    Eric Young (eay@cryptsoft.com)"
-   The word 'cryptographic' can be left out if the rouines from the library
-   being used are not cryptographic related :-).
-4. If you include any Windows specific code (or a derivative thereof) from
-   the apps directory (application code) you must include an acknowledgement:
-   "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
-
-THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-The licence and distribution terms for any publically available version or
-derivative of this code cannot be changed.  i.e. this code cannot simply be
-copied and put under another distribution licence
-[including the GNU Public Licence.]
-
-____
-
 For ICC - built in main/icc/:
 - ICC Software License equal to BSD license
 
diff --git a/main/NOTICE b/main/NOTICE
index 43d0de4cc7..2ccf6b03fa 100644
--- a/main/NOTICE
+++ b/main/NOTICE
@@ -172,23 +172,21 @@ ____
 
 As part of the base system this product also includes code from the following
 projects which are licensed under the Apache license:
+- OpenSSL
 - redland
 - StAX
 
 The notices from these projects are following:
 
+OpenSSL:
+[no notices]
+
 redland
 This product includes Redland software (http://librdf.org/)
 developed at the Institute for Learning and Research Technology,
 University of Bristol, UK (http://www.bristol.ac.uk/).
 
-
 StAX
 [no notices]
 
-____
-
-This product includes software developed by the OpenSSL Project
-for use in the OpenSSL Toolkit. (https://www.openssl.org/)
-
 $HeadURL$
diff --git a/main/RepositoryFixes.mk b/main/RepositoryFixes.mk
index a82b01820e..45f414bd36 100644
--- a/main/RepositoryFixes.mk
+++ b/main/RepositoryFixes.mk
@@ -146,8 +146,8 @@ gb_Library_FILENAMES := $(patsubst svt:isvt%,svt:svtool%,$(gb_Library_FILENAMES)
 gb_Library_FILENAMES := $(patsubst tl:itl%,tl:itools%,$(gb_Library_FILENAMES))
 gb_Library_FILENAMES := $(patsubst vbahelper:ivbahelper%,vbahelper:vbahelper%,$(gb_Library_FILENAMES))
 gb_Library_FILENAMES := $(patsubst vos3:ivos3%,vos3:ivos%,$(gb_Library_FILENAMES))
-gb_Library_FILENAMES := $(patsubst crypto:icrypto%,crypto:libeay32%,$(gb_Library_FILENAMES))
-gb_Library_FILENAMES := $(patsubst ssl:issl%,ssl:ssleay32%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst crypto:icrypto%,crypto:libcrypto%,$(gb_Library_FILENAMES))
+gb_Library_FILENAMES := $(patsubst ssl:issl%,ssl:libssl%,$(gb_Library_FILENAMES))
 gb_Library_FILENAMES := $(patsubst xml2:ixml2%,xml2:libxml2%,$(gb_Library_FILENAMES))
 gb_Library_FILENAMES := $(patsubst xslt:ixslt%,xslt:libxslt%,$(gb_Library_FILENAMES))
 gb_Library_FILENAMES := $(patsubst rdf:irdf%,rdf:librdf%,$(gb_Library_FILENAMES))
diff --git a/main/external_deps.lst b/main/external_deps.lst
index 072031667e..237b599761 100644
--- a/main/external_deps.lst
+++ b/main/external_deps.lst
@@ -150,10 +150,17 @@ if (SOLAR_JAVA==TRUE)
     URL1 = https://archive.apache.org/dist/commons/lang/source/$(name)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
-if (SYSTEM_OPENSSL!=YES && DISABLE_OPENSSL!=TRUE)
-    MD5 = cdc2638f789ecc2db2c91488265686c1
-    name = openssl-1.0.2u.tar.gz
-    URL1 = https://www.openssl.org/source/old/1.0.2/$(name)
+if (SYSTEM_OPENSSL!=YES)
+    MD5 = c15e53a62711002901d3515ac8b30b86
+    name = openssl-3.0.13.tar.gz
+    URL1 = https://www.openssl.org/source/$(name)
+    URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
+
+# On Windows, we need Strawberry Perl to build OpenSSL 3:
+if (SYSTEM_OPENSSL!=YES && GUI==WNT)
+    MD5 = 93fdfe261588bc82ab3a0bd4f5945b60
+    name = strawberry-perl-5.32.1.1-32bit-portable.zip
+    URL1 = https://strawberryperl.com/download/5.32.1.1/$(name)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
 if (SYSTEM_LIBXML != YES)
diff --git a/main/openssl/makefile.mk b/main/openssl/makefile.mk
index 6d8afa27b5..45def9d385 100644
--- a/main/openssl/makefile.mk
+++ b/main/openssl/makefile.mk
@@ -37,15 +37,11 @@ TARGET=openssl
 	@echo "Using system openssl...."
 .ENDIF
 
-.IF "$(DISABLE_OPENSSL)" == "TRUE"
-@all:
-	@echo "openssl disabled...."
-.ENDIF
 
-OPENSSL_NAME=openssl-1.0.2u
+OPENSSL_NAME=openssl-3.0.13
 
 TARFILE_NAME=$(OPENSSL_NAME)
-TARFILE_MD5=cdc2638f789ecc2db2c91488265686c1
+TARFILE_MD5=c15e53a62711002901d3515ac8b30b86
 
 CONFIGURE_DIR=.
 CONFIGURE_ACTION=config
@@ -67,7 +63,7 @@ UNAME=$(shell uname)
 .ENDIF
 
 .IF "$(OS)" == "LINUX" || "$(OS)" == "FREEBSD"
-	PATCH_FILES=openssllnx.patch
+	PATCH_FILES=opensslunx.patch
 	.IF "$(CPU)" == "I"
 		.IF "$(UNAME)" == "GNU/kFreeBSD"
 			CONFIGURE_ACTION=Configure debian-kfreebsd-i386 no-dso no-shared $(NO_ASM)
@@ -117,6 +113,7 @@ UNAME=$(shell uname)
 .IF "$(OS)" == "WNT"
 
 .IF "$(COM)"=="GCC"
+
 PATCH_FILES=opensslmingw.patch
 .IF "$(USE_MINGW)" == "cygwin"
 CONFIGURE_ACTION=$(PERL) configure
@@ -128,7 +125,7 @@ OUT2LIB += libcrypto.*
 OUT2LIB += libssl.*
 OUT2BIN = ssleay32.dll
 OUT2BIN += libeay32.dll
-.ELSE
+.ELSE # "$(USE_MINGW)" == "cygwin"
 CONFIGURE_ACTION=
 BUILD_ACTION=cmd /c "ms\mingw32"
 OUT2LIB = out/libcrypto_static.*
@@ -137,47 +134,56 @@ OUT2LIB += out/libcrypto.*
 OUT2LIB += out/libssl.*
 OUT2BIN = out/ssleay32.dll
 OUT2BIN += out/libeay32.dll
-.ENDIF
-.ELSE
+.ENDIF # "$(USE_MINGW)" == "cygwin"
 
-		PATCH_FILES=openssl.patch
-		.IF "$(MAKETARGETS)" == ""
-			# The env. vars CC and PERL are used by nmake, and nmake insists on '\'s
-			# If WRAPCMD is set it is prepended before the compiler, don't touch that.
-			.IF "$(WRAPCMD)"==""
-				CC!:=$(subst,/,\ $(normpath,1 $(CC)))
-				.EXPORT : CC
-			.ENDIF
-			PERL_bak:=$(PERL)
-			PERL!:=$(subst,/,\ $(normpath,1 $(PERL)))
-			.EXPORT : PERL
-			PERL!:=$(PERL_bak)
-		.ENDIF
+.ELSE # "$(COM)"=="GCC"
 
-		#CONFIGURE_ACTION=cmd /c $(PERL:s!\!/!) configure
-		.IF "$(CPUNAME)"=="INTEL"
-			CONFIGURE_ACTION=$(PERL) configure $(NO_ASM)
-			CONFIGURE_FLAGS=VC-WIN32
-			.IF "$(NASM_PATH)"=="NO_NASM_HOME"
-			  BUILD_ACTION=cmd /c "ms$(EMQ)\do_ms.bat $(subst,/,\ $(normpath,1 $(PERL)))" && nmake -f ms/ntdll.mak
-			.ELSE
-			  BUILD_ACTION=cmd /c "ms$(EMQ)\do_nasm.bat $(subst,/,\ $(normpath,1 $(PERL)))" && nmake -f ms/ntdll.mak
-			.ENDIF
-		.ELIF "$(CPUNAME)"=="X86_64"
-			CONFIGURE_ACTION=$(PERL) configure $(NO_ASM)
-			CONFIGURE_FLAGS=VC-WIN64A
-			BUILD_ACTION=cmd /c "ms$(EMQ)\do_win64a.bat $(subst,/,\ $(normpath,1 $(PERL)))" && cmd /c "nmake -f ms/ntdll.mak"
-		.ENDIF
+	PATCH_FILES=openssl.patch
 
-		OUT2LIB = out32dll$/ssleay32.lib
-		OUT2LIB += out32dll$/libeay32.lib
-		OUT2BIN = out32dll$/ssleay32.dll
-		OUT2BIN += out32dll$/libeay32.dll
-		OUT2INC = inc32$/openssl$/*
+	# Extract Strawberry Perl and use CONFIGURE_ACTION to insert it, and NASM which it needs, into the PATH.
+	# Also define:
+	# - certain constants absent in the old MSVC we use (INT64_MAX, INT64_MIN, UINT64_MAX).
+	# - the minimum Windows version to support (_WIN32_WINDOWS=0x0400 for Windows 95, _WIN32_WINNT=0x0400 for Windows NT 4.0).
+	# - OPENSSL_NO_ASYNC=1 to stop using async functions that require old Windows versions.
+	STRAWBERRY_PERL_DIR=$(shell cygpath -u $(SOLARSRC)/openssl/$(INPATH)/misc/build/strawberry-perl)
+	.IF "$(NASM_PATH)"=="NASM_IN_PATH"
+		CONFIGURE_PATH=$(STRAWBERRY_PERL_DIR)/perl/bin:$(PATH)
+	.ELSE
+		NASM_PATH_NIX=$(shell cygpath -u $(NASM_PATH))
+		CONFIGURE_PATH=$(STRAWBERRY_PERL_DIR)/perl/bin:$(NASM_PATH_NIX):$(PATH)
 	.ENDIF
-.ENDIF
+	CONFIGURE_ACTION=\
+		if test -d "$(STRAWBERRY_PERL_DIR)"; \
+		then echo Found Strawberry Perl; \
+		else mkdir "$(STRAWBERRY_PERL_DIR)" && unzip -d $(STRAWBERRY_PERL_DIR) $(SOLARSRC)/../ext_sources/93fdfe261588bc82ab3a0bd4f5945b60-strawberry-perl-5.32.1.1-32bit-portable.zip ; \
+		fi && \
+		PATH="$(CONFIGURE_PATH)" \
+		PERL= \
+		CPPFLAGS="$(SOLARINC) \
+			-DOPENSSL_NO_ASYNC=1 \
+			-DWINVER=0x0400 \
+			-D_WIN32_WINNT=0x0400 \
+			-D_WIN32_WINDOWS=0x0400 \
+			-DINT64_MAX=9223372036854775807i64 \
+			-DINT64_MIN=(-9223372036854775807i64-1) \
+			-DUINT64_MAX=0xffffffffffffffffui64" \
+		RCFLAGS="$(SOLARINC)" \
+		perl configure $(NO_ASM)
+	.IF "$(CPUNAME)"=="INTEL"
+		CONFIGURE_FLAGS=VC-WIN32
+	.ELIF "$(CPUNAME)"=="X86_64"
+		CONFIGURE_FLAGS=VC-WIN64A
+	.ENDIF
+	BUILD_ACTION=LIB="$(ILIB)" nmake
+
+	OUT2BIN = libcrypto-3.dll
+	OUT2BIN += libssl-3.dll
+	OUT2INC = include$/openssl$/*
+
+.ENDIF # "$(COM)"=="GCC"
+
+.ENDIF # "$(OS)" == "WNT"
 
-#set INCLUDE=D:\sol_temp\n\msvc7net3\PlatformSDK\include;D:\sol_temp\n\msvc7net3\include\ && set path=%path%;D:\sol_temp\r\btw\SRC680\perl\bin &&
 
 # --- Targets ------------------------------------------------------
 
diff --git a/main/openssl/openssl.patch b/main/openssl/openssl.patch
index fb48031e21..c837f1e919 100644
--- a/main/openssl/openssl.patch
+++ b/main/openssl/openssl.patch
@@ -1,166 +1,50 @@
-diff -ur misc/openssl-1.0.2u/Configure misc/build/openssl-1.0.2u/Configure
---- misc/openssl-1.0.2u/Configure	2018-08-14 05:49:04.000000000 -0700
-+++ misc/build/openssl-1.0.2u/Configure	2018-08-26 14:51:25.397910000 -0700
-@@ -477,19 +477,20 @@
- "android-mips","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
- 
- #### *BSD [do see comment about ${BSDthreads} above!]
--"BSD-generic32","gcc:-O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
--"BSD-x86",	"gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
--"BSD-x86-elf",	"gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
--"debug-BSD-x86-elf",	"gcc:-DL_ENDIAN -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
--"BSD-sparcv8",	"gcc:-DB_ENDIAN -O3 -mcpu=v8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"BSD-generic32","$ENV{'FREEBSDCC'}:-O3 -fomit-frame-pointer -Wall $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)",
-+"BSD-x86",	"$ENV{'FREEBSDCC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIBVER)",
-+"BSD-x86-elf",	"$ENV{'FREEBSDCC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIBVER)",
-+"debug-BSD-x86-elf",	"$ENV{'FREEBSDCC'}:-DL_ENDIAN -O3 -Wall -g $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIBVER)",
-+"BSD-sparcv8", "$ENV{'FREEBSDCC'}:-DB_ENDIAN -O3 -mcpu=v8 -Wall $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)",
- 
--"BSD-generic64","gcc:-O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"BSD-generic64","$ENV{'FREEBSDCC'}:-O3 -Wall $ENV{'CFLAGS'}::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)",
- # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
- # simply *happens* to work around a compiler bug in gcc 3.3.3,
- # triggered by RIPEMD160 code.
--"BSD-sparc64",	"gcc:-DB_ENDIAN -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
--"BSD-ia64",	"gcc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
--"BSD-x86_64",	"cc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"BSD-sparc64",	"$ENV{'FREEBSDCC'}:-DB_ENDIAN -O3 -DMD32_REG_T=int -Wall $ENV{'CFLAGS'}::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)",
-+"BSD-ia64",	"$ENV{'FREEBSDCC'}:-DL_ENDIAN -O3 -Wall $ENV{'CFLAGS'}::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)",
-+"BSD-x86_64",	"$ENV{'FREEBSDCC'}:-DL_ENDIAN -O3 -Wall $ENV{'CFLAGS'}::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)",
-+"BSD-alpha",	"$ENV{'FREEBSDCC'}:-DL_ENDIAN -O -Wall $ENV{'CFLAGS'}::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIBVER)",
- 
- "bsdi-elf-gcc",     "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
- 
-@@ -592,9 +593,9 @@
- "debug-VC-WIN64A","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:".eval{my $asm=$x86_64_asm;$asm=~s/x86_64-gcc\.o/bn_asm.o/;$asm}.":auto:win32",
- # x86 Win32 target defaults to ANSI API, if you want UNICODE, complement
- # 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE'
--"VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
-+"VC-WIN32","cl:-W3 -w44129 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
- # Unified CE target
--"debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
-+"debug-VC-WIN32","cl:-W3 -W44129 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
- "VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",
- 
- # Borland C++ 4.5
-@@ -2065,10 +2066,12 @@
- 	if ( $perl =~ m@^/@) {
- 	    &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
- 	    &dofile("apps/CA.pl",$perl,'^#!/', '#!%s');
-+	    &dofile("apps/tsget",$perl,'^#!/', '#!%s');
- 	} else {
- 	    # No path for Perl known ...
- 	    &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";',  '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
- 	    &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
-+	    &dofile("apps/tsget",'/usr/local/bin/perl',,'^#!/', '#!%s');
- 	}
- 	if ($depflags ne $default_depflags && !$make_depend) {
- 	    $warn_make_depend++;
-diff -ur misc/openssl-1.0.2u/config misc/build/openssl-1.0.2u/config
---- misc/openssl-1.0.2u/config	2018-08-14 05:48:56.000000000 -0700
-+++ misc/build/openssl-1.0.2u/config	2018-08-26 14:49:34.431584000 -0700
-@@ -762,14 +762,8 @@
-   sparc64-*-*bsd*)	OUT="BSD-sparc64" ;;
-   ia64-*-*bsd*)		OUT="BSD-ia64" ;;
-   amd64-*-*bsd*)	OUT="BSD-x86_64" ;;
--  *86*-*-*bsd*)		# mimic ld behaviour when it's looking for libc...
--			if [ -L /usr/lib/libc.so ]; then	# [Free|Net]BSD
--			    libc=/usr/lib/libc.so
--			else					# OpenBSD
--			    # ld searches for highest libc.so.* and so do we
--			    libc=`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`
--			fi
--			case "`(file -L $libc) 2>/dev/null`" in
-+  *86*-*-*bsd*)	
-+			case "`(file -L /bin/sh) 2>/dev/null`" in
- 			*ELF*)	OUT="BSD-x86-elf" ;;
- 			*)	OUT="BSD-x86"; options="$options no-sse2" ;;
- 			esac ;;
-diff -ur misc/openssl-1.0.2u/ms/do_ms.bat misc/build/openssl-1.0.2u/ms/do_ms.bat
---- misc/openssl-1.0.2u/ms/do_ms.bat	2018-08-14 05:48:59.000000000 -0700
-+++ misc/build/openssl-1.0.2u/ms/do_ms.bat	2018-08-26 14:49:34.432106000 -0700
-@@ -1,11 +1,11 @@
- 
--perl util\mkfiles.pl >MINFO
--perl util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak
--perl util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak
-+%1 util\mkfiles.pl >MINFO
-+%1 util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak
-+%1 util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak
- if x%OSVERSION% == x goto skipce
--perl util\mk1mf.pl no-asm VC-CE >ms\ce.mak
--perl util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak
-+%1 util\mk1mf.pl no-asm VC-CE >ms\ce.mak
-+%1 util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak
- :skipce
- 
--perl util\mkdef.pl 32 libeay > ms\libeay32.def
--perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
-+%1 util\mkdef.pl 32 libeay > ms\libeay32.def
-+%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def
-diff -ur misc/openssl-1.0.2u/ms/do_win64a.bat misc/build/openssl-1.0.2u/ms/do_win64a.bat
---- misc/openssl-1.0.2u/ms/do_win64a.bat	2018-08-14 05:48:59.000000000 -0700
-+++ misc/build/openssl-1.0.2u/ms/do_win64a.bat	2018-08-26 14:49:34.432647000 -0700
-@@ -1,19 +1,19 @@
--perl util\mkfiles.pl >MINFO
-+%1 util\mkfiles.pl >MINFO
- 
- cmd /c "nasm -f win64 -v" >NUL 2>&1
- if %errorlevel% neq 0 goto ml64
- 
--perl ms\uplink-x86_64.pl nasm > ms\uptable.asm
-+%1 ms\uplink-x86_64.pl nasm > ms\uptable.asm
- nasm -f win64 -o ms\uptable.obj ms\uptable.asm
- goto proceed
- 
- :ml64
--perl ms\uplink-x86_64.pl masm > ms\uptable.asm
-+%1 ms/uplink-x86_64.pl masm > ms/uptable.asm
- ml64 -c -Foms\uptable.obj ms\uptable.asm
- 
- :proceed
--perl util\mk1mf.pl VC-WIN64A >ms\nt.mak
--perl util\mk1mf.pl dll VC-WIN64A >ms\ntdll.mak
-+%1 util\mk1mf.pl VC-WIN64A >ms\nt.mak
-+%1 util\mk1mf.pl dll VC-WIN64A >ms\ntdll.mak
- 
--perl util\mkdef.pl 32 libeay > ms\libeay32.def
--perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
-+%1 util\mkdef.pl 32 libeay > ms\libeay32.def
-+%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def
-diff -ur misc/openssl-1.0.2u/util/mk1mf.pl misc/build/openssl-1.0.2u/util/mk1mf.pl
---- misc/openssl-1.0.2u/util/mk1mf.pl	2018-08-14 05:48:59.000000000 -0700
-+++ misc/build/openssl-1.0.2u/util/mk1mf.pl	2018-08-26 14:49:34.433421000 -0700
-@@ -163,7 +163,7 @@
- $inc_def="outinc";
- $tmp_def="tmp";
- 
--$perl="perl" unless defined $perl;
-+$perl="$ENV{PERL}" unless defined $perl;
- $mkdir="-mkdir" unless defined $mkdir;
- 
- ($ssl,$crypto)=("ssl","crypto");
-@@ -346,6 +346,11 @@
- 	s/\s*$//; # was chop, didn't work in mixture of perls for Windows...
- 
- 	($key,$val)=/^([^=]+)=(.*)/;
-+
-+	# On some Windows machines, $val has linefeeds at the end, which confuses
-+	# subsequent code in this file. So we strip all whitespace at the end.
-+	$val =~ s/\s+$//;
-+
- 	if ($key eq "RELATIVE_DIRECTORY")
- 		{
- 		if ($lib ne "")
-diff -ur misc/openssl-1.0.2u/util/pl/VC-32.pl misc/build/openssl-1.0.2u/util/pl/VC-32.pl
---- misc/openssl-1.0.2u/util/pl/VC-32.pl	2018-08-14 05:48:59.000000000 -0700
-+++ misc/build/openssl-1.0.2u/util/pl/VC-32.pl	2018-08-26 14:49:57.553776000 -0700
-@@ -30,7 +30,7 @@
- my $ff = "";
- 
- # C compiler stuff
--$cc='cl';
-+$cc=$ENV{'CC'};
- if ($FLAVOR =~ /WIN64/)
+diff --git misc/build/openssl-3.0.13/crypto/bio/bio_sock2.c misc/build/openssl-3.0.13/crypto/bio/bio_sock2.c
+index 8bdad0c0b6..e52cd4f00e 100644
+--- misc/build/openssl-3.0.13/crypto/bio/bio_sock2.c
++++ misc/build/openssl-3.0.13/crypto/bio/bio_sock2.c
+@@ -270,6 +270,10 @@ int BIO_listen(int sock, const BIO_ADDR *addr, int options)
+          * Therefore we always have to use setsockopt here.
+          */
+         on = options & BIO_SOCK_V6_ONLY ? 1 : 0;
++/* Windows < XP needs this: */
++#  if !defined(IPPROTO_IPV6)
++#    define IPPROTO_IPV6 41
++#  endif
+         if (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,
+                        (const void *)&on, sizeof(on)) != 0) {
+             ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(),
+diff --git misc/build/openssl-3.0.13/crypto/init.c misc/build/openssl-3.0.13/crypto/init.c
+index cacf637c89..0728c0a20d 100644
+--- misc/build/openssl-3.0.13/crypto/init.c
++++ misc/build/openssl-3.0.13/crypto/init.c
+@@ -131,7 +131,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_nodelete)
+ 
+ #if !defined(OPENSSL_USE_NODELETE) \
+     && !defined(OPENSSL_NO_PINSHARED)
+-# if defined(DSO_WIN32) && !defined(_WIN32_WCE)
++# if defined(DSO_WIN32) && !defined(_WIN32_WCE) && _WIN32_WINNT >= 0x0500
+     {
+         HMODULE handle = NULL;
+         BOOL ret;
+@@ -659,7 +659,7 @@ int OPENSSL_atexit(void (*handler)(void))
+ #if !defined(OPENSSL_USE_NODELETE)\
+     && !defined(OPENSSL_NO_PINSHARED)
      {
-     # Note that we currently don't have /WX on Win64! There is a lot of
+-# if defined(DSO_WIN32) && !defined(_WIN32_WCE)
++# if defined(DSO_WIN32) && !defined(_WIN32_WCE) && _WIN32_WINNT >= 0x0500
+         HMODULE handle = NULL;
+         BOOL ret;
+         union {
+diff --git misc/build/openssl-3.0.13/crypto/threads_win.c misc/build/openssl-3.0.13/crypto/threads_win.c
+index dbeda74d73..c599e88c59 100644
+--- misc/build/openssl-3.0.13/crypto/threads_win.c
++++ misc/build/openssl-3.0.13/crypto/threads_win.c
+@@ -54,7 +54,7 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
+         return NULL;
+     }
+ 
+-#  if !defined(_WIN32_WCE)
++#  if !defined(_WIN32_WCE) && _WIN32_WINNT >= 0x0403
+     /* 0x400 is the spin count value suggested in the documentation */
+     if (!InitializeCriticalSectionAndSpinCount(lock, 0x400)) {
+         OPENSSL_free(lock);
diff --git a/main/openssl/openssllnx.patch b/main/openssl/openssllnx.patch
deleted file mode 100644
index 9a20d22c96..0000000000
--- a/main/openssl/openssllnx.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -ur misc/openssl-1.0.2u/Configure misc/build/openssl-1.0.2u/Configure
---- misc/openssl-1.0.2u/Configure	2018-08-14 05:49:04.000000000 -0700
-+++ misc/build/openssl-1.0.2u/Configure	2018-08-26 13:35:54.485021000 -0700
-@@ -493,6 +493,9 @@
- 
- "bsdi-elf-gcc",     "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
- 
-+"debian-kfreebsd-amd64","gcc:-m64 -DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-kfreebsd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+
- "nextstep",	"cc:-O -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
- "nextstep3.3",	"cc:-O3 -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
- 
-diff -ur misc/openssl-1.0.2u/Makefile.org misc/build/openssl-1.0.2u/Makefile.org
---- misc/openssl-1.0.2u/Makefile.org	2018-08-14 05:48:56.000000000 -0700
-+++ misc/build/openssl-1.0.2u/Makefile.org	2018-08-26 13:35:54.485813000 -0700
-@@ -208,7 +208,7 @@
- # same language for uniform treatment.
- BUILDENV=	LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
- 		CC='$(CC)' CFLAG='$(CFLAG)' 			\
--		AS='$(CC)' ASFLAG='$(CFLAG) -c'			\
-+		AS='$(CC)' ASFLAG='$(CFLAG) -c -Wa,--noexecstack'	\
- 		AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)'	\
- 		RC='$(RC)'              			\
- 		CROSS_COMPILE='$(CROSS_COMPILE)'	\
diff --git a/main/openssl/opensslunx.patch b/main/openssl/opensslunx.patch
new file mode 100644
index 0000000000..7177a1c740
--- /dev/null
+++ b/main/openssl/opensslunx.patch
@@ -0,0 +1,10 @@
+--- misc/build/openssl-3.0.13/Configurations/00-base-templates.conf	2024-01-30 15:28:16.000000000 +0200
++++ misc/build/openssl-3.0.13/Configurations/00-base-templates.conf	2024-03-18 02:55:09.593025000 +0200
+@@ -67,6 +67,7 @@
+ 
+         AR              => "ar",
+         ARFLAGS         => "qc",
++        ASFLAGS          => "-Wa,--noexecstack",
+         CC              => "cc",
+         lflags          =>
+             sub { $withargs{zlib_lib} ? "-L".$withargs{zlib_lib} : () },
diff --git a/main/openssl/prj/d.lst b/main/openssl/prj/d.lst
index bfd80e44f8..f381599703 100644
--- a/main/openssl/prj/d.lst
+++ b/main/openssl/prj/d.lst
@@ -1,10 +1,6 @@
 mkdir: %_DEST%\inc%_EXT%\external
 mkdir: %_DEST%\inc%_EXT%\external\openssl
 ..\%__SRC%\inc\*.h %_DEST%\inc%_EXT%\external\openssl
-..\%__SRC%\lib\ssleay32.lib %_DEST%\lib%_EXT%\ssleay32.lib
-..\%__SRC%\bin\ssleay32.dll %_DEST%\bin%_EXT%\ssleay32.dll
-..\%__SRC%\lib\libeay32.lib %_DEST%\lib%_EXT%\libeay32.lib
-..\%__SRC%\bin\libeay32.dll %_DEST%\bin%_EXT%\libeay32.dll
 ..\%__SRC%\lib\libcrypto.* %_DEST%\lib%_EXT%\libcrypto.*
 ..\%__SRC%\lib\libssl.* %_DEST%\lib%_EXT%\libssl.*
- 
+..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
diff --git a/main/python/python-2.7.18-msvs9.patch b/main/python/python-2.7.18-msvs9.patch
index 5a95434b3f..ba6b3d85e3 100644
--- a/main/python/python-2.7.18-msvs9.patch
+++ b/main/python/python-2.7.18-msvs9.patch
@@ -1,7 +1,7 @@
-diff -urp misc/Python-2.7.18/PC/VS9.0/_bsddb.vcproj misc/build/Python-2.7.18/PC/VS9.0/_bsddb.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_bsddb.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_bsddb.vcproj	2017-10-21 17:56:40.218589000 -0500
-@@ -56,6 +56,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_bsddb.vcproj misc/build/Python-2.7.18/PC/VS9.0/_bsddb.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/_bsddb.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_bsddb.vcproj
+@@ -56,6 +56,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -9,7 +9,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_bsddb.vcproj misc/build/Python-2.7.18/PC/
  				AdditionalDependencies="$(bsddbDepLibs)"
  				BaseAddress="0x1e180000"
  			/>
-@@ -120,6 +121,7 @@
+@@ -120,6 +121,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -17,7 +17,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_bsddb.vcproj misc/build/Python-2.7.18/PC/
  				AdditionalDependencies="$(bsddbDepLibs)"
  				BaseAddress="0x1e180000"
  			/>
-@@ -183,6 +185,7 @@
+@@ -183,6 +185,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -25,7 +25,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_bsddb.vcproj misc/build/Python-2.7.18/PC/
  				AdditionalDependencies="$(bsddbDepLibs)"
  				BaseAddress="0x1e180000"
  			/>
-@@ -248,6 +251,7 @@
+@@ -248,6 +251,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -33,7 +33,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_bsddb.vcproj misc/build/Python-2.7.18/PC/
  				AdditionalDependencies="$(bsddbDepLibs)"
  				BaseAddress="0x1e180000"
  			/>
-@@ -311,6 +315,7 @@
+@@ -311,6 +315,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -41,7 +41,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_bsddb.vcproj misc/build/Python-2.7.18/PC/
  				AdditionalDependencies="$(bsddbDepLibs)"
  				BaseAddress="0x1e180000"
  			/>
-@@ -375,6 +380,7 @@
+@@ -375,6 +380,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -49,7 +49,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_bsddb.vcproj misc/build/Python-2.7.18/PC/
  				AdditionalDependencies="$(bsddbDepLibs)"
  				BaseAddress="0x1e180000"
  				TargetMachine="17"
-@@ -439,6 +445,7 @@
+@@ -439,6 +445,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -57,7 +57,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_bsddb.vcproj misc/build/Python-2.7.18/PC/
  				AdditionalDependencies="$(bsddbDepLibs)"
  				BaseAddress="0x1e180000"
  			/>
-@@ -503,6 +510,7 @@
+@@ -503,6 +510,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -65,10 +65,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_bsddb.vcproj misc/build/Python-2.7.18/PC/
  				AdditionalDependencies="$(bsddbDepLibs)"
  				BaseAddress="0x1e180000"
  				TargetMachine="17"
-diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes.vcproj misc/build/Python-2.7.18/PC/VS9.0/_ctypes.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_ctypes.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_ctypes.vcproj	2017-10-21 17:56:40.219465000 -0500
-@@ -177,7 +177,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_ctypes.vcproj misc/build/Python-2.7.18/PC/VS9.0/_ctypes.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/_ctypes.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_ctypes.vcproj
+@@ -177,7 +177,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -77,7 +77,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes.vcproj misc/build/Python-2.7.18/PC
  				SubSystem="0"
  				BaseAddress="0x1D1A0000"
  			/>
-@@ -241,7 +241,7 @@
+@@ -241,7 +241,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -86,7 +86,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes.vcproj misc/build/Python-2.7.18/PC
  				SubSystem="0"
  				BaseAddress="0x1D1A0000"
  			/>
-@@ -304,7 +304,7 @@
+@@ -304,7 +304,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -95,7 +95,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes.vcproj misc/build/Python-2.7.18/PC
  				SubSystem="0"
  				BaseAddress="0x1D1A0000"
  			/>
-@@ -368,7 +368,7 @@
+@@ -368,7 +368,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -104,7 +104,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes.vcproj misc/build/Python-2.7.18/PC
  				SubSystem="0"
  				BaseAddress="0x1D1A0000"
  				TargetMachine="17"
-@@ -432,7 +432,7 @@
+@@ -432,7 +432,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -113,7 +113,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes.vcproj misc/build/Python-2.7.18/PC
  				SubSystem="0"
  				BaseAddress="0x1D1A0000"
  			/>
-@@ -496,7 +496,7 @@
+@@ -496,7 +496,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -122,10 +122,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes.vcproj misc/build/Python-2.7.18/PC
  				SubSystem="0"
  				BaseAddress="0x1D1A0000"
  				TargetMachine="17"
-diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj misc/build/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj	2017-10-21 17:56:40.220226000 -0500
-@@ -54,6 +54,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj misc/build/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj
+@@ -54,6 +54,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -133,7 +133,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -113,6 +114,7 @@
+@@ -113,6 +114,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -141,7 +141,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -172,6 +174,7 @@
+@@ -172,6 +174,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -149,7 +149,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -232,6 +235,7 @@
+@@ -232,6 +235,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -157,7 +157,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -291,6 +295,7 @@
+@@ -291,6 +295,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -165,7 +165,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -352,6 +357,7 @@
+@@ -352,6 +357,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				TargetMachine="17"
@@ -173,7 +173,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -411,6 +417,7 @@
+@@ -411,6 +417,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -181,7 +181,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -472,6 +479,7 @@
+@@ -472,6 +479,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				TargetMachine="17"
@@ -189,10 +189,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ctypes_test.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/_elementtree.vcproj misc/build/Python-2.7.18/PC/VS9.0/_elementtree.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_elementtree.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_elementtree.vcproj	2017-10-21 17:56:40.221003000 -0500
-@@ -57,6 +57,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_elementtree.vcproj misc/build/Python-2.7.18/PC/VS9.0/_elementtree.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/_elementtree.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_elementtree.vcproj
+@@ -57,6 +57,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D100000"
@@ -200,7 +200,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_elementtree.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -119,6 +120,7 @@
+@@ -119,6 +120,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D100000"
@@ -208,7 +208,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_elementtree.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -181,6 +183,7 @@
+@@ -181,6 +183,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D100000"
@@ -216,7 +216,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_elementtree.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -244,6 +247,7 @@
+@@ -244,6 +247,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D100000"
@@ -224,7 +224,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_elementtree.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -306,6 +310,7 @@
+@@ -306,6 +310,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D100000"
@@ -232,7 +232,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_elementtree.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -370,6 +375,7 @@
+@@ -370,6 +375,7 @@
  				Name="VCLinkerTool"
  				BaseAddress="0x1D100000"
  				TargetMachine="17"
@@ -240,7 +240,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_elementtree.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -432,6 +438,7 @@
+@@ -432,6 +438,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D100000"
@@ -248,7 +248,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_elementtree.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -496,6 +503,7 @@
+@@ -496,6 +503,7 @@
  				Name="VCLinkerTool"
  				BaseAddress="0x1D100000"
  				TargetMachine="17"
@@ -256,18 +256,20 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_elementtree.vcproj misc/build/Python-2.7.
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/_hashlib.vcproj misc/build/Python-2.7.18/PC/VS9.0/_hashlib.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_hashlib.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_hashlib.vcproj	2017-10-21 17:56:40.222221000 -0500
-@@ -58,6 +58,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_hashlib.vcproj misc/build/Python-2.7.18/PC/VS9.0/_hashlib.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/_hashlib.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_hashlib.vcproj
+@@ -57,7 +57,8 @@
+ 			/>
  			<Tool
  				Name="VCLinkerTool"
- 				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
+-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
++				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libcrypto.lib $(opensslDir)\out32\libssl.lib"
 +				AdditionalOptions="/SAFESEH /NXCOMPAT /DYNAMICBASE"
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -121,6 +122,7 @@
+@@ -121,6 +122,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"
@@ -275,15 +277,17 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_hashlib.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -184,6 +186,7 @@
+@@ -183,7 +185,8 @@
+ 			/>
  			<Tool
  				Name="VCLinkerTool"
- 				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
+-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
++				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libcrypto.lib $(opensslDir)\out32\libssl.lib"
 +				AdditionalOptions="/SAFESEH /NXCOMPAT /DYNAMICBASE"
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -248,6 +251,7 @@
+@@ -248,6 +251,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"
@@ -291,15 +295,17 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_hashlib.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -311,6 +315,7 @@
+@@ -310,7 +314,8 @@
+ 			/>
  			<Tool
  				Name="VCLinkerTool"
- 				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
+-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
++				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libcrypto.lib $(opensslDir)\out32\libssl.lib"
 +				AdditionalOptions="/SAFESEH /NXCOMPAT /DYNAMICBASE"
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -376,6 +381,7 @@
+@@ -376,6 +381,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"
  				TargetMachine="17"
@@ -307,15 +313,17 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_hashlib.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -439,6 +445,7 @@
+@@ -438,7 +444,8 @@
+ 			/>
  			<Tool
  				Name="VCLinkerTool"
- 				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
+-				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
++				AdditionalDependencies="ws2_32.lib $(opensslDir)\out32\libcrypto.lib $(opensslDir)\out32\libssl.lib"
 +				AdditionalOptions="/SAFESEH /NXCOMPAT /DYNAMICBASE"
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -504,6 +511,7 @@
+@@ -504,6 +511,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"
  				TargetMachine="17"
@@ -323,10 +331,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_hashlib.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/_msi.vcproj misc/build/Python-2.7.18/PC/VS9.0/_msi.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_msi.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_msi.vcproj	2017-10-21 17:56:40.223291000 -0500
-@@ -56,6 +56,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_msi.vcproj misc/build/Python-2.7.18/PC/VS9.0/_msi.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/_msi.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_msi.vcproj
+@@ -56,6 +56,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
  				BaseAddress="0x1D160000"
@@ -334,7 +342,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_msi.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -117,6 +118,7 @@
+@@ -117,6 +118,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
  				BaseAddress="0x1D160000"
@@ -342,7 +350,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_msi.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -178,6 +180,7 @@
+@@ -178,6 +180,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
  				BaseAddress="0x1D160000"
@@ -350,7 +358,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_msi.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -240,6 +243,7 @@
+@@ -240,6 +243,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
  				BaseAddress="0x1D160000"
@@ -358,7 +366,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_msi.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -301,6 +305,7 @@
+@@ -301,6 +305,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
  				BaseAddress="0x1D160000"
@@ -366,7 +374,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_msi.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -364,6 +369,7 @@
+@@ -364,6 +369,7 @@
  				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
  				BaseAddress="0x1D160000"
  				TargetMachine="17"
@@ -374,7 +382,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_msi.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -425,6 +431,7 @@
+@@ -425,6 +431,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
  				BaseAddress="0x1D160000"
@@ -382,7 +390,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_msi.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -488,6 +495,7 @@
+@@ -488,6 +495,7 @@
  				AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
  				BaseAddress="0x1D160000"
  				TargetMachine="17"
@@ -390,10 +398,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_msi.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj misc/build/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj	2017-10-21 17:56:40.224316000 -0500
-@@ -56,6 +56,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj misc/build/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj
+@@ -56,6 +56,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -401,7 +409,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -117,6 +118,7 @@
+@@ -117,6 +118,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -409,7 +417,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -178,6 +180,7 @@
+@@ -178,6 +180,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -417,7 +425,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -240,6 +243,7 @@
+@@ -240,6 +243,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -425,7 +433,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -301,6 +305,7 @@
+@@ -301,6 +305,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -433,7 +441,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -364,6 +369,7 @@
+@@ -364,6 +369,7 @@
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
  				TargetMachine="17"
@@ -441,7 +449,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -425,6 +431,7 @@
+@@ -425,6 +431,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -449,7 +457,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -488,6 +495,7 @@
+@@ -488,6 +495,7 @@
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
  				TargetMachine="17"
@@ -457,10 +465,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_multiprocessing.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/_socket.vcproj misc/build/Python-2.7.18/PC/VS9.0/_socket.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_socket.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_socket.vcproj	2017-10-21 17:56:40.225407000 -0500
-@@ -56,6 +56,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_socket.vcproj misc/build/Python-2.7.18/PC/VS9.0/_socket.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/_socket.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_socket.vcproj
+@@ -56,6 +56,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -468,7 +476,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_socket.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -117,6 +118,7 @@
+@@ -117,6 +118,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -476,7 +484,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_socket.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -178,6 +180,7 @@
+@@ -178,6 +180,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -484,7 +492,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_socket.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -240,6 +243,7 @@
+@@ -240,6 +243,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -492,7 +500,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_socket.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -301,6 +305,7 @@
+@@ -301,6 +305,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -500,7 +508,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_socket.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -364,6 +369,7 @@
+@@ -364,6 +369,7 @@
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
  				TargetMachine="17"
@@ -508,7 +516,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_socket.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -425,6 +431,7 @@
+@@ -425,6 +431,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
@@ -516,7 +524,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_socket.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -488,6 +495,7 @@
+@@ -488,6 +495,7 @@
  				AdditionalDependencies="ws2_32.lib"
  				BaseAddress="0x1e1D0000"
  				TargetMachine="17"
@@ -524,10 +532,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_socket.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj misc/build/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj	2017-10-21 17:56:40.226403000 -0500
-@@ -57,6 +57,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj misc/build/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj
+--- misc/build/Python-2.7.18PC/VS9.0/_sqlite3.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj
+@@ -57,6 +57,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e180000"
@@ -535,7 +543,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -119,6 +120,7 @@
+@@ -119,6 +120,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e180000"
@@ -543,7 +551,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -181,6 +183,7 @@
+@@ -181,6 +183,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e180000"
@@ -551,7 +559,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -244,6 +247,7 @@
+@@ -244,6 +247,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e180000"
@@ -559,7 +567,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -306,6 +310,7 @@
+@@ -306,6 +310,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e180000"
@@ -567,7 +575,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -370,6 +375,7 @@
+@@ -370,6 +375,7 @@
  				Name="VCLinkerTool"
  				BaseAddress="0x1e180000"
  				TargetMachine="17"
@@ -575,7 +583,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -432,6 +438,7 @@
+@@ -432,6 +438,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e180000"
@@ -583,7 +591,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -496,6 +503,7 @@
+@@ -496,6 +503,7 @@
  				Name="VCLinkerTool"
  				BaseAddress="0x1e180000"
  				TargetMachine="17"
@@ -591,10 +599,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_sqlite3.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/_ssl.vcproj misc/build/Python-2.7.18/PC/VS9.0/_ssl.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_ssl.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_ssl.vcproj	2017-10-21 17:56:40.227504000 -0500
-@@ -43,7 +43,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_ssl.vcproj misc/build/Python-2.7.18/PC/VS9.0/_ssl.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/_ssl.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_ssl.vcproj
+@@ -43,7 +43,7 @@
  			/>
  			<Tool
  				Name="VCCLCompilerTool"
@@ -603,17 +611,17 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ssl.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCManagedResourceCompilerTool"
-@@ -57,7 +57,8 @@
+@@ -57,7 +57,8 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
 -				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
 +				AdditionalOptions="/SAFESEH /NXCOMPAT /DYNAMICBASE"
-+				AdditionalDependencies="ws2_32.lib crypt32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib"
++				AdditionalDependencies="ws2_32.lib crypt32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libssl.lib"
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -106,7 +107,7 @@
+@@ -106,7 +107,7 @@
  			/>
  			<Tool
  				Name="VCCLCompilerTool"
@@ -622,7 +630,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ssl.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCManagedResourceCompilerTool"
-@@ -120,7 +121,8 @@
+@@ -120,7 +121,8 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -632,7 +640,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ssl.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -169,7 +171,7 @@
+@@ -169,7 +171,7 @@
  			/>
  			<Tool
  				Name="VCCLCompilerTool"
@@ -641,17 +649,17 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ssl.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCManagedResourceCompilerTool"
-@@ -183,7 +185,8 @@
+@@ -183,7 +185,8 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
 -				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
 +				AdditionalOptions="/SAFESEH /NXCOMPAT /DYNAMICBASE"
-+				AdditionalDependencies="ws2_32.lib crypt32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\ssleay32.lib"
++				AdditionalDependencies="ws2_32.lib crypt32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libcrypto.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libssl.lib"
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -233,7 +236,7 @@
+@@ -233,7 +236,7 @@
  			/>
  			<Tool
  				Name="VCCLCompilerTool"
@@ -660,17 +668,17 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ssl.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCManagedResourceCompilerTool"
-@@ -247,7 +250,8 @@
+@@ -247,7 +250,8 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
 -				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out64\libeay32.lib $(opensslDir)\out64\ssleay32.lib"
-+				AdditionalOptions="/SAFESEH /NXCOMPAT /DYNAMICBASE"
++				AdditionalOptions="/SAFESEH /NXCOMPAT /DYNAMICBASE"
 +				AdditionalDependencies="ws2_32.lib crypt32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\ssleay32.lib"
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -296,7 +300,7 @@
+@@ -296,7 +300,7 @@
  			/>
  			<Tool
  				Name="VCCLCompilerTool"
@@ -679,20 +687,29 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_ssl.vcproj misc/build/Python-2.7.18/PC/VS
  			/>
  			<Tool
  				Name="VCManagedResourceCompilerTool"
-@@ -310,7 +314,8 @@
+@@ -310,7 +314,8 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
 -				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
 +				AdditionalOptions="/SAFESEH /NXCOMPAT /DYNAMICBASE"
-+				AdditionalDependencies="ws2_32.lib crypt32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libeay32.lib"
++				AdditionalDependencies="ws2_32.lib crypt32.lib $(SOLARVER)\$(INPATH)\lib$(UPDMINOREXT)\libssl.lib"
+ 			/>
+ 			<Tool
+ 				Name="VCALinkTool"
+@@ -438,7 +443,7 @@
+ 			/>
+ 			<Tool
+ 				Name="VCLinkerTool"
+-				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out32\libeay32.lib $(opensslDir)\out32\ssleay32.lib"
++				AdditionalDependencies="ws2_32.lib crypt32.lib $(opensslDir)\out32\libcrypto.lib $(opensslDir)\out32\libssl.lib"
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/_testcapi.vcproj misc/build/Python-2.7.18/PC/VS9.0/_testcapi.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_testcapi.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_testcapi.vcproj	2017-10-21 17:56:40.228516000 -0500
-@@ -55,6 +55,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_testcapi.vcproj misc/build/Python-2.7.18/PC/VS9.0/_testcapi.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/_testcapi.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_testcapi.vcproj
+@@ -55,6 +55,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e1F0000"
@@ -700,7 +717,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_testcapi.vcproj misc/build/Python-2.7.18/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -115,6 +116,7 @@
+@@ -115,6 +116,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e1F0000"
@@ -708,7 +725,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_testcapi.vcproj misc/build/Python-2.7.18/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -175,6 +177,7 @@
+@@ -175,6 +177,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e1F0000"
@@ -716,7 +733,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_testcapi.vcproj misc/build/Python-2.7.18/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -236,6 +239,7 @@
+@@ -236,6 +239,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e1F0000"
@@ -724,7 +741,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_testcapi.vcproj misc/build/Python-2.7.18/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -296,6 +300,7 @@
+@@ -296,6 +300,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e1F0000"
@@ -732,7 +749,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_testcapi.vcproj misc/build/Python-2.7.18/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -358,6 +363,7 @@
+@@ -358,6 +363,7 @@
  				Name="VCLinkerTool"
  				BaseAddress="0x1e1F0000"
  				TargetMachine="17"
@@ -740,7 +757,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_testcapi.vcproj misc/build/Python-2.7.18/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -418,6 +424,7 @@
+@@ -418,6 +424,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1e1F0000"
@@ -748,7 +765,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_testcapi.vcproj misc/build/Python-2.7.18/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -480,6 +487,7 @@
+@@ -480,6 +487,7 @@
  				Name="VCLinkerTool"
  				BaseAddress="0x1e1F0000"
  				TargetMachine="17"
@@ -756,10 +773,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_testcapi.vcproj misc/build/Python-2.7.18/
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/_tkinter.vcproj misc/build/Python-2.7.18/PC/VS9.0/_tkinter.vcproj
---- misc/Python-2.7.18/PC/VS9.0/_tkinter.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/_tkinter.vcproj	2017-10-21 17:56:40.229664000 -0500
-@@ -57,6 +57,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/_tkinter.vcproj misc/build/Python-2.7.18/PC/VS9.0/_tkinter.vcproj
+--- misc/build/Python-2.7.18PC/VS9.0/_tkinter.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/_tkinter.vcproj
+@@ -57,6 +57,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="$(tcltkLibDebug)"
@@ -767,7 +784,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_tkinter.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -119,6 +120,7 @@
+@@ -119,6 +120,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="$(tcltk64LibDebug)"
@@ -775,7 +792,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_tkinter.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -181,6 +183,7 @@
+@@ -181,6 +183,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="$(tcltkLib)"
@@ -783,7 +800,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_tkinter.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -244,6 +247,7 @@
+@@ -244,6 +247,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="$(tcltk64Lib)"
@@ -791,7 +808,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_tkinter.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -306,6 +310,7 @@
+@@ -306,6 +310,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="$(tcltkLib)"
@@ -799,7 +816,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_tkinter.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -370,6 +375,7 @@
+@@ -370,6 +375,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="$(tcltk64Lib)"
  				TargetMachine="17"
@@ -807,7 +824,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_tkinter.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -432,6 +438,7 @@
+@@ -432,6 +438,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="$(tcltkLib)"
@@ -815,7 +832,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_tkinter.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -496,6 +503,7 @@
+@@ -496,6 +503,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="$(tcltk64Lib)"
  				TargetMachine="17"
@@ -823,10 +840,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/_tkinter.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/bdist_wininst.vcproj misc/build/Python-2.7.18/PC/VS9.0/bdist_wininst.vcproj
---- misc/Python-2.7.18/PC/VS9.0/bdist_wininst.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/bdist_wininst.vcproj	2017-10-21 17:56:40.230806000 -0500
-@@ -81,8 +81,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/bdist_wininst.vcproj misc/build/Python-2.7.18/PC/VS9.0/bdist_wininst.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/bdist_wininst.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/bdist_wininst.vcproj
+@@ -81,8 +81,7 @@
  				IgnoreDefaultLibraryNames="LIBC"
  				ProgramDatabaseFile="..\..\lib\distutils\command\wininst-9.0.pdb"
  				SubSystem="2"
@@ -836,7 +853,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/bdist_wininst.vcproj misc/build/Python-2.7
  				TargetMachine="1"
  			/>
  			<Tool
-@@ -171,8 +170,7 @@
+@@ -171,8 +170,7 @@
  				IgnoreDefaultLibraryNames="LIBC"
  				ProgramDatabaseFile="..\..\lib\distutils\command\wininst-9.0-amd64.pdb"
  				SubSystem="2"
@@ -846,10 +863,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/bdist_wininst.vcproj misc/build/Python-2.7
  				TargetMachine="17"
  			/>
  			<Tool
-diff -urp misc/Python-2.7.18/PC/VS9.0/bz2.vcproj misc/build/Python-2.7.18/PC/VS9.0/bz2.vcproj
---- misc/Python-2.7.18/PC/VS9.0/bz2.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/bz2.vcproj	2017-10-21 17:56:40.232092000 -0500
-@@ -57,6 +57,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/bz2.vcproj misc/build/Python-2.7.18/PC/VS9.0/bz2.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/bz2.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/bz2.vcproj
+@@ -57,6 +57,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D170000"
@@ -857,7 +874,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/bz2.vcproj misc/build/Python-2.7.18/PC/VS9
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -119,6 +120,7 @@
+@@ -119,6 +120,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D170000"
@@ -865,7 +882,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/bz2.vcproj misc/build/Python-2.7.18/PC/VS9
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -181,6 +183,7 @@
+@@ -181,6 +183,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D170000"
@@ -873,7 +890,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/bz2.vcproj misc/build/Python-2.7.18/PC/VS9
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -244,6 +247,7 @@
+@@ -244,6 +247,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D170000"
@@ -881,7 +898,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/bz2.vcproj misc/build/Python-2.7.18/PC/VS9
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -306,6 +310,7 @@
+@@ -306,6 +310,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D170000"
@@ -889,7 +906,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/bz2.vcproj misc/build/Python-2.7.18/PC/VS9
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -370,6 +375,7 @@
+@@ -370,6 +375,7 @@
  				Name="VCLinkerTool"
  				BaseAddress="0x1D170000"
  				TargetMachine="17"
@@ -897,7 +914,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/bz2.vcproj misc/build/Python-2.7.18/PC/VS9
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -432,6 +438,7 @@
+@@ -432,6 +438,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D170000"
@@ -905,7 +922,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/bz2.vcproj misc/build/Python-2.7.18/PC/VS9
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -496,6 +503,7 @@
+@@ -496,6 +503,7 @@
  				Name="VCLinkerTool"
  				BaseAddress="0x1D170000"
  				TargetMachine="17"
@@ -913,10 +930,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/bz2.vcproj misc/build/Python-2.7.18/PC/VS9
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/kill_python.vcproj misc/build/Python-2.7.18/PC/VS9.0/kill_python.vcproj
---- misc/Python-2.7.18/PC/VS9.0/kill_python.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/kill_python.vcproj	2017-10-21 17:56:40.233109000 -0500
-@@ -56,6 +56,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/kill_python.vcproj misc/build/Python-2.7.18/PC/VS9.0/kill_python.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/kill_python.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/kill_python.vcproj
+@@ -56,6 +56,7 @@
  				Name="VCLinkerTool"
  				OutputFile="$(OutDir)\$(ProjectName)_d.exe"
  				SubSystem="1"
@@ -924,7 +941,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/kill_python.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -117,6 +118,7 @@
+@@ -117,6 +118,7 @@
  				Name="VCLinkerTool"
  				OutputFile="$(OutDir)\$(ProjectName)_d.exe"
  				SubSystem="1"
@@ -932,7 +949,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/kill_python.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -177,6 +179,7 @@
+@@ -177,6 +179,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				SubSystem="1"
@@ -940,7 +957,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/kill_python.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -238,6 +241,7 @@
+@@ -238,6 +241,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				SubSystem="1"
@@ -948,10 +965,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/kill_python.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/make_buildinfo.vcproj misc/build/Python-2.7.18/PC/VS9.0/make_buildinfo.vcproj
---- misc/Python-2.7.18/PC/VS9.0/make_buildinfo.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/make_buildinfo.vcproj	2017-10-21 17:56:40.233689000 -0500
-@@ -61,6 +61,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/make_buildinfo.vcproj misc/build/Python-2.7.18/PC/VS9.0/make_buildinfo.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/make_buildinfo.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/make_buildinfo.vcproj
+@@ -61,6 +61,7 @@
  				OutputFile="$(OutDir)/make_buildinfo.exe"
  				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
  				SubSystem="1"
@@ -959,7 +976,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/make_buildinfo.vcproj misc/build/Python-2.
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -119,6 +120,7 @@
+@@ -119,6 +120,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -967,10 +984,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/make_buildinfo.vcproj misc/build/Python-2.
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj misc/build/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj
---- misc/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj	2017-10-21 17:56:40.234324000 -0500
-@@ -71,6 +71,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj misc/build/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj
+@@ -71,6 +71,7 @@
  				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
  				SubSystem="1"
  				BaseAddress="0x1d000000"
@@ -978,7 +995,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -137,6 +138,7 @@
+@@ -137,6 +138,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				OutputFile="$(SolutionDir)make_versioninfo.exe"
@@ -986,7 +1003,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -214,6 +216,7 @@
+@@ -214,6 +216,7 @@
  				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
  				SubSystem="1"
  				BaseAddress="0x1d000000"
@@ -994,7 +1011,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -282,6 +285,7 @@
+@@ -282,6 +285,7 @@
  				Name="VCLinkerTool"
  				OutputFile="$(SolutionDir)make_versioninfo_d.exe"
  				TargetMachine="17"
@@ -1002,10 +1019,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/make_versioninfo.vcproj misc/build/Python-
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/pcbuild.sln misc/build/Python-2.7.18/PC/VS9.0/pcbuild.sln
---- misc/Python-2.7.18/PC/VS9.0/pcbuild.sln	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/pcbuild.sln	2017-10-21 17:56:40.235608000 -0500
-@@ -38,12 +38,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C9
+diff --git misc/build/Python-2.7.18/PC/VS9.0/pcbuild.sln misc/build/Python-2.7.18/PC/VS9.0/pcbuild.sln
+--- misc/build/Python-2.7.18/PC/VS9.0/pcbuild.sln
++++ misc/build/Python-2.7.18/PC/VS9.0/pcbuild.sln
+@@ -38,12 +38,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", "winsound.vcproj
  		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
  	EndProjectSection
  EndProject
@@ -1024,7 +1041,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pcbuild.sln misc/build/Python-2.7.18/PC/VS
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ctypes", "_ctypes.vcproj", "{0E9791DB-593A-465F-98BC-681011311618}"
  	ProjectSection(ProjectDependencies) = postProject
  		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
-@@ -69,12 +69,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C9
+@@ -69,12 +69,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcproj",
  		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
  	EndProjectSection
  EndProject
@@ -1043,7 +1060,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pcbuild.sln misc/build/Python-2.7.18/PC/VS
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcproj", "{C6E20F84-3247-4AD6-B051-B073268F73BA}"
  	ProjectSection(ProjectDependencies) = postProject
  		{B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}
-@@ -87,16 +87,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C9
+@@ -87,16 +87,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcpr
  		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
  	EndProjectSection
  EndProject
@@ -1070,7 +1087,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pcbuild.sln misc/build/Python-2.7.18/PC/VS
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "select", "select.vcproj", "{18CAE28C-B454-46C1-87A0-493D91D97F03}"
  	ProjectSection(ProjectDependencies) = postProject
  		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
-@@ -114,17 +114,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C9
+@@ -114,17 +114,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyexpat", "pyexpat.vcproj",
  EndProject
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdist_wininst", "bdist_wininst.vcproj", "{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}"
  EndProject
@@ -1099,10 +1116,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pcbuild.sln misc/build/Python-2.7.18/PC/VS
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multiprocessing.vcproj", "{9E48B300-37D1-11DD-8C41-005056C00008}"
  	ProjectSection(ProjectDependencies) = postProject
  		{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
-diff -urp misc/Python-2.7.18/PC/VS9.0/pyexpat.vcproj misc/build/Python-2.7.18/PC/VS9.0/pyexpat.vcproj
---- misc/Python-2.7.18/PC/VS9.0/pyexpat.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/pyexpat.vcproj	2017-10-21 17:56:40.236395000 -0500
-@@ -56,6 +56,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/pyexpat.vcproj misc/build/Python-2.7.18/PC/VS9.0/pyexpat.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/pyexpat.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/pyexpat.vcproj
+@@ -56,6 +56,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -1110,7 +1127,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pyexpat.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -117,6 +118,7 @@
+@@ -117,6 +118,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -1118,7 +1135,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pyexpat.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -178,6 +180,7 @@
+@@ -178,6 +180,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -1126,7 +1143,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pyexpat.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -240,6 +243,7 @@
+@@ -240,6 +243,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -1134,7 +1151,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pyexpat.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -301,6 +305,7 @@
+@@ -301,6 +305,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -1142,7 +1159,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pyexpat.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -364,6 +369,7 @@
+@@ -364,6 +369,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				TargetMachine="17"
@@ -1150,7 +1167,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pyexpat.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -425,6 +431,7 @@
+@@ -425,6 +431,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -1158,7 +1175,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pyexpat.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -488,6 +495,7 @@
+@@ -488,6 +495,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				TargetMachine="17"
@@ -1166,10 +1183,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pyexpat.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/python.vcproj misc/build/Python-2.7.18/PC/VS9.0/python.vcproj
---- misc/Python-2.7.18/PC/VS9.0/python.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/python.vcproj	2017-10-21 17:56:40.237211000 -0500
-@@ -66,6 +66,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/python.vcproj misc/build/Python-2.7.18/PC/VS9.0/python.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/python.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/python.vcproj
+@@ -66,6 +66,7 @@
  				SubSystem="1"
  				StackReserveSize="2000000"
  				BaseAddress="0x1d000000"
@@ -1177,7 +1194,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/python.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -139,6 +140,7 @@
+@@ -139,6 +140,7 @@
  				SubSystem="1"
  				StackReserveSize="2000000"
  				BaseAddress="0x1d000000"
@@ -1185,7 +1202,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/python.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -213,6 +215,7 @@
+@@ -213,6 +215,7 @@
  				SubSystem="1"
  				StackReserveSize="2000000"
  				BaseAddress="0x1d000000"
@@ -1193,7 +1210,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/python.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -288,6 +291,7 @@
+@@ -288,6 +291,7 @@
  				SubSystem="1"
  				StackReserveSize="2100000"
  				BaseAddress="0x1d000000"
@@ -1201,7 +1218,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/python.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -361,6 +365,7 @@
+@@ -361,6 +365,7 @@
  				StackReserveSize="2000000"
  				BaseAddress="0x1d000000"
  				ImportLibrary=""
@@ -1209,7 +1226,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/python.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -436,6 +441,7 @@
+@@ -436,6 +441,7 @@
  				BaseAddress="0x1d000000"
  				ImportLibrary=""
  				TargetMachine="17"
@@ -1217,7 +1234,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/python.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -509,6 +515,7 @@
+@@ -509,6 +515,7 @@
  				StackReserveSize="2000000"
  				BaseAddress="0x1d000000"
  				ImportLibrary=""
@@ -1225,7 +1242,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/python.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -584,6 +591,7 @@
+@@ -584,6 +591,7 @@
  				BaseAddress="0x1d000000"
  				ImportLibrary=""
  				TargetMachine="17"
@@ -1233,10 +1250,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/python.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/pythoncore.vcproj misc/build/Python-2.7.18/PC/VS9.0/pythoncore.vcproj
---- misc/Python-2.7.18/PC/VS9.0/pythoncore.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/pythoncore.vcproj	2017-10-21 17:56:40.238551000 -0500
-@@ -69,6 +69,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/pythoncore.vcproj misc/build/Python-2.7.18/PC/VS9.0/pythoncore.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/pythoncore.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/pythoncore.vcproj
+@@ -69,6 +69,7 @@
  				ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
  				BaseAddress="0x1e000000"
  				ImportLibrary="$(OutDir)$(PyDllName).lib"
@@ -1244,7 +1261,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythoncore.vcproj misc/build/Python-2.7.18
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -144,6 +145,7 @@
+@@ -144,6 +145,7 @@
  				ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
  				BaseAddress="0x1e000000"
  				ImportLibrary="$(OutDir)$(PyDllName).lib"
@@ -1252,7 +1269,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythoncore.vcproj misc/build/Python-2.7.18
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -222,6 +224,7 @@
+@@ -222,6 +224,7 @@
  				ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb"
  				BaseAddress="0x1e000000"
  				ImportLibrary="$(OutDir)$(PyDllName)_d.lib"
@@ -1260,7 +1277,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythoncore.vcproj misc/build/Python-2.7.18
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -300,6 +303,7 @@
+@@ -300,6 +303,7 @@
  				ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb"
  				BaseAddress="0x1e000000"
  				ImportLibrary="$(OutDir)$(PyDllName)_d.lib"
@@ -1268,7 +1285,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythoncore.vcproj misc/build/Python-2.7.18
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -374,6 +378,7 @@
+@@ -374,6 +378,7 @@
  				ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
  				BaseAddress="0x1e000000"
  				ImportLibrary="$(OutDirPGI)$(PyDllName).lib"
@@ -1276,7 +1293,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythoncore.vcproj misc/build/Python-2.7.18
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -450,6 +455,7 @@
+@@ -450,6 +455,7 @@
  				BaseAddress="0x1e000000"
  				ImportLibrary="$(OutDirPGI)$(PyDllName).lib"
  				TargetMachine="17"
@@ -1284,7 +1301,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythoncore.vcproj misc/build/Python-2.7.18
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -524,6 +530,7 @@
+@@ -524,6 +530,7 @@
  				ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
  				BaseAddress="0x1e000000"
  				ImportLibrary="$(OutDirPGI)$(PyDllName).lib"
@@ -1292,7 +1309,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythoncore.vcproj misc/build/Python-2.7.18
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -600,6 +607,7 @@
+@@ -600,6 +607,7 @@
  				BaseAddress="0x1e000000"
  				ImportLibrary="$(OutDirPGI)$(PyDllName).lib"
  				TargetMachine="17"
@@ -1300,10 +1317,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythoncore.vcproj misc/build/Python-2.7.18
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/pythonw.vcproj misc/build/Python-2.7.18/PC/VS9.0/pythonw.vcproj
---- misc/Python-2.7.18/PC/VS9.0/pythonw.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/pythonw.vcproj	2017-10-21 17:56:40.239382000 -0500
-@@ -66,6 +66,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/pythonw.vcproj misc/build/Python-2.7.18/PC/VS9.0/pythonw.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/pythonw.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/pythonw.vcproj
+@@ -66,6 +66,7 @@
  				StackReserveSize="2000000"
  				BaseAddress="0x1d000000"
  				TargetMachine="1"
@@ -1311,7 +1328,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythonw.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -137,6 +138,7 @@
+@@ -137,6 +138,7 @@
  				OutputFile="$(OutDir)\pythonw_d.exe"
  				StackReserveSize="2000000"
  				BaseAddress="0x1d000000"
@@ -1319,7 +1336,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythonw.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -208,6 +210,7 @@
+@@ -208,6 +210,7 @@
  				StackReserveSize="2000000"
  				BaseAddress="0x1d000000"
  				TargetMachine="1"
@@ -1327,7 +1344,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythonw.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -279,6 +282,7 @@
+@@ -279,6 +282,7 @@
  				OutputFile="$(OutDir)\pythonw.exe"
  				StackReserveSize="2000000"
  				BaseAddress="0x1d000000"
@@ -1335,7 +1352,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythonw.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -351,6 +355,7 @@
+@@ -351,6 +355,7 @@
  				BaseAddress="0x1d000000"
  				ImportLibrary=""
  				TargetMachine="1"
@@ -1343,7 +1360,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythonw.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -424,6 +429,7 @@
+@@ -424,6 +429,7 @@
  				BaseAddress="0x1d000000"
  				ImportLibrary=""
  				TargetMachine="17"
@@ -1351,7 +1368,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythonw.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -496,6 +502,7 @@
+@@ -496,6 +502,7 @@
  				BaseAddress="0x1d000000"
  				ImportLibrary=""
  				TargetMachine="1"
@@ -1359,7 +1376,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythonw.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -569,6 +576,7 @@
+@@ -569,6 +576,7 @@
  				BaseAddress="0x1d000000"
  				ImportLibrary=""
  				TargetMachine="17"
@@ -1367,10 +1384,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/pythonw.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/select.vcproj misc/build/Python-2.7.18/PC/VS9.0/select.vcproj
---- misc/Python-2.7.18/PC/VS9.0/select.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/select.vcproj	2017-10-21 17:56:40.240210000 -0500
-@@ -57,6 +57,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/select.vcproj misc/build/Python-2.7.18/PC/VS9.0/select.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/select.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/select.vcproj
+@@ -57,6 +57,7 @@
  				AdditionalDependencies="ws2_32.lib"
  				IgnoreDefaultLibraryNames="libc"
  				BaseAddress="0x1D110000"
@@ -1378,7 +1395,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/select.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -119,6 +120,7 @@
+@@ -119,6 +120,7 @@
  				AdditionalDependencies="ws2_32.lib"
  				IgnoreDefaultLibraryNames="libc"
  				BaseAddress="0x1D110000"
@@ -1386,7 +1403,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/select.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -181,6 +183,7 @@
+@@ -181,6 +183,7 @@
  				AdditionalDependencies="ws2_32.lib"
  				IgnoreDefaultLibraryNames="libc"
  				BaseAddress="0x1D110000"
@@ -1394,7 +1411,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/select.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -244,6 +247,7 @@
+@@ -244,6 +247,7 @@
  				AdditionalDependencies="ws2_32.lib"
  				IgnoreDefaultLibraryNames="libc"
  				BaseAddress="0x1D110000"
@@ -1402,7 +1419,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/select.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -306,6 +310,7 @@
+@@ -306,6 +310,7 @@
  				AdditionalDependencies="ws2_32.lib"
  				IgnoreDefaultLibraryNames="libc"
  				BaseAddress="0x1D110000"
@@ -1410,7 +1427,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/select.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -370,6 +375,7 @@
+@@ -370,6 +375,7 @@
  				IgnoreDefaultLibraryNames="libc"
  				BaseAddress="0x1D110000"
  				TargetMachine="17"
@@ -1418,7 +1435,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/select.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -432,6 +438,7 @@
+@@ -432,6 +438,7 @@
  				AdditionalDependencies="ws2_32.lib"
  				IgnoreDefaultLibraryNames="libc"
  				BaseAddress="0x1D110000"
@@ -1426,7 +1443,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/select.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -496,6 +503,7 @@
+@@ -496,6 +503,7 @@
  				IgnoreDefaultLibraryNames="libc"
  				BaseAddress="0x1D110000"
  				TargetMachine="17"
@@ -1434,10 +1451,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/select.vcproj misc/build/Python-2.7.18/PC/
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/sqlite3.vcproj misc/build/Python-2.7.18/PC/VS9.0/sqlite3.vcproj
---- misc/Python-2.7.18/PC/VS9.0/sqlite3.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/sqlite3.vcproj	2017-10-21 17:56:40.241775000 -0500
-@@ -56,6 +56,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/sqlite3.vcproj misc/build/Python-2.7.18/PC/VS9.0/sqlite3.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/sqlite3.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/sqlite3.vcproj
+@@ -56,6 +56,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				OutputFile="$(OutDir)\$(ProjectName)_d.dll"
@@ -1445,7 +1462,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/sqlite3.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -117,6 +118,7 @@
+@@ -117,6 +118,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				OutputFile="$(OutDir)\$(ProjectName)_d.dll"
@@ -1453,7 +1470,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/sqlite3.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -178,6 +180,7 @@
+@@ -178,6 +180,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				OutputFile="$(OutDir)\$(ProjectName).dll"
@@ -1461,7 +1478,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/sqlite3.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -240,6 +243,7 @@
+@@ -240,6 +243,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				OutputFile="$(OutDir)\$(ProjectName).dll"
@@ -1469,7 +1486,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/sqlite3.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -301,6 +305,7 @@
+@@ -301,6 +305,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				OutputFile="$(OutDir)\$(ProjectName).dll"
@@ -1477,7 +1494,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/sqlite3.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -362,6 +367,7 @@
+@@ -362,6 +367,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -1485,7 +1502,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/sqlite3.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -423,6 +429,7 @@
+@@ -423,6 +429,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				OutputFile="$(OutDir)\$(ProjectName).dll"
@@ -1493,7 +1510,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/sqlite3.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -484,6 +491,7 @@
+@@ -484,6 +491,7 @@
  			/>
  			<Tool
  				Name="VCLinkerTool"
@@ -1501,10 +1518,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/sqlite3.vcproj misc/build/Python-2.7.18/PC
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/unicodedata.vcproj misc/build/Python-2.7.18/PC/VS9.0/unicodedata.vcproj
---- misc/Python-2.7.18/PC/VS9.0/unicodedata.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/unicodedata.vcproj	2017-10-21 17:56:40.242820000 -0500
-@@ -55,6 +55,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/unicodedata.vcproj misc/build/Python-2.7.18/PC/VS9.0/unicodedata.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/unicodedata.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/unicodedata.vcproj
+@@ -55,6 +55,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D120000"
@@ -1512,7 +1529,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/unicodedata.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -115,6 +116,7 @@
+@@ -115,6 +116,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D120000"
@@ -1520,7 +1537,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/unicodedata.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -175,6 +177,7 @@
+@@ -175,6 +177,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D120000"
@@ -1528,7 +1545,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/unicodedata.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -236,6 +239,7 @@
+@@ -236,6 +239,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D120000"
@@ -1536,7 +1553,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/unicodedata.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -296,6 +300,7 @@
+@@ -296,6 +300,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D120000"
@@ -1544,7 +1561,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/unicodedata.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -358,6 +363,7 @@
+@@ -358,6 +363,7 @@
  				Name="VCLinkerTool"
  				BaseAddress="0x1D120000"
  				TargetMachine="17"
@@ -1552,7 +1569,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/unicodedata.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -418,6 +424,7 @@
+@@ -418,6 +424,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				BaseAddress="0x1D120000"
@@ -1560,7 +1577,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/unicodedata.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -480,6 +487,7 @@
+@@ -480,6 +487,7 @@
  				Name="VCLinkerTool"
  				BaseAddress="0x1D120000"
  				TargetMachine="17"
@@ -1568,10 +1585,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/unicodedata.vcproj misc/build/Python-2.7.1
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj misc/build/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj
---- misc/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj	2017-10-21 17:56:40.243805000 -0500
-@@ -59,6 +59,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj misc/build/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj
+@@ -59,6 +59,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				SubSystem="1"
@@ -1579,7 +1596,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -124,6 +125,7 @@
+@@ -124,6 +125,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				SubSystem="1"
@@ -1587,7 +1604,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -191,6 +193,7 @@
+@@ -191,6 +193,7 @@
  				Name="VCLinkerTool"
  				GenerateDebugInformation="false"
  				SubSystem="1"
@@ -1595,7 +1612,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -259,6 +262,7 @@
+@@ -259,6 +262,7 @@
  				Name="VCLinkerTool"
  				GenerateDebugInformation="false"
  				SubSystem="1"
@@ -1603,7 +1620,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -327,6 +331,7 @@
+@@ -327,6 +331,7 @@
  				GenerateDebugInformation="false"
  				SubSystem="1"
  				ImportLibrary=""
@@ -1611,7 +1628,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -397,6 +402,7 @@
+@@ -397,6 +402,7 @@
  				SubSystem="1"
  				ImportLibrary=""
  				TargetMachine="17"
@@ -1619,7 +1636,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -465,6 +471,7 @@
+@@ -465,6 +471,7 @@
  				GenerateDebugInformation="false"
  				SubSystem="1"
  				ImportLibrary=""
@@ -1627,7 +1644,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -535,6 +542,7 @@
+@@ -535,6 +542,7 @@
  				SubSystem="1"
  				ImportLibrary=""
  				TargetMachine="17"
@@ -1635,10 +1652,10 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/w9xpopen.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-diff -urp misc/Python-2.7.18/PC/VS9.0/winsound.vcproj misc/build/Python-2.7.18/PC/VS9.0/winsound.vcproj
---- misc/Python-2.7.18/PC/VS9.0/winsound.vcproj	2017-09-16 12:38:35.000000000 -0500
-+++ misc/build/Python-2.7.18/PC/VS9.0/winsound.vcproj	2017-10-21 17:56:40.244677000 -0500
-@@ -55,6 +55,7 @@
+diff --git misc/build/Python-2.7.18/PC/VS9.0/winsound.vcproj misc/build/Python-2.7.18/PC/VS9.0/winsound.vcproj
+--- misc/build/Python-2.7.18/PC/VS9.0/winsound.vcproj
++++ misc/build/Python-2.7.18/PC/VS9.0/winsound.vcproj
+@@ -55,6 +55,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="winmm.lib"
@@ -1646,7 +1663,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/winsound.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -115,6 +116,7 @@
+@@ -115,6 +116,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="winmm.lib"
@@ -1654,7 +1671,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/winsound.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -175,6 +177,7 @@
+@@ -175,6 +177,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="winmm.lib"
@@ -1662,7 +1679,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/winsound.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -236,6 +239,7 @@
+@@ -236,6 +239,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="winmm.lib"
@@ -1670,7 +1687,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/winsound.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -296,6 +300,7 @@
+@@ -296,6 +300,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="winmm.lib"
@@ -1678,7 +1695,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/winsound.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -358,6 +363,7 @@
+@@ -358,6 +363,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="winmm.lib"
  				TargetMachine="17"
@@ -1686,7 +1703,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/winsound.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -418,6 +424,7 @@
+@@ -418,6 +424,7 @@
  			<Tool
  				Name="VCLinkerTool"
  				AdditionalDependencies="winmm.lib"
@@ -1694,7 +1711,7 @@ diff -urp misc/Python-2.7.18/PC/VS9.0/winsound.vcproj misc/build/Python-2.7.18/P
  			/>
  			<Tool
  				Name="VCALinkTool"
-@@ -480,6 +487,7 @@
+@@ -480,6 +487,7 @@
  				Name="VCLinkerTool"
  				AdditionalDependencies="winmm.lib"
  				TargetMachine="17"
diff --git a/main/scp2/source/ooo/file_library_ooo.scp b/main/scp2/source/ooo/file_library_ooo.scp
index ae84b0d958..fb82de45e6 100644
--- a/main/scp2/source/ooo/file_library_ooo.scp
+++ b/main/scp2/source/ooo/file_library_ooo.scp
@@ -1775,7 +1775,7 @@ File gid_File_Lib_Openssl
     Styles = (PACKED);
     Dir = SCP2_OOO_BIN_DIR;
   #ifdef WNT
-    Name = "ssleay32.dll";
+    Name = "libssl-3.dll";
   #else
     Name = "libssl.so";
   #endif
@@ -1788,7 +1788,7 @@ File gid_File_Lib_Crypto
     Styles = (PACKED);
     Dir = SCP2_OOO_BIN_DIR;
   #ifdef WNT
-    Name = "libeay32.dll";
+    Name = "libcrypto-3.dll";
   #else
     Name = "libcrypto.so";
   #endif


(openoffice) 02/12: Include string.h too, for memcpy().

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit b28b64c25ead03162e6aaa7ed04c6e9ad2bb85fe
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Thu Apr 28 18:16:13 2022 +0200

    Include string.h too, for memcpy().
    
    (cherry picked from commit 19cdc44e34d49eeb215c9268163feda83250d827)
---
 main/ucb/source/ucp/webdav/CurlRequest.cxx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/main/ucb/source/ucp/webdav/CurlRequest.cxx b/main/ucb/source/ucp/webdav/CurlRequest.cxx
index ee6e906e99..746a83554f 100644
--- a/main/ucb/source/ucp/webdav/CurlRequest.cxx
+++ b/main/ucb/source/ucp/webdav/CurlRequest.cxx
@@ -26,6 +26,8 @@
 
 #include "CurlRequest.hxx"
 
+#include <string.h>
+
 using namespace ::com::sun::star;
 using namespace http_dav_ucp;
 
@@ -388,4 +390,4 @@ void CurlRequest::curlMoreBodyReceived( const char *buffer, size_t size )
     }
     else if ( responseBodyInputStream.is() )
         responseBodyInputStream->AddToStream( buffer, size );
-}
\ No newline at end of file
+}


(openoffice) 11/12: Upgrade Curl to version 8.7.1.

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 4db815500aa1388fee2404bfe75ec26d4c25760b
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Mon Apr 22 19:23:06 2024 +0200

    Upgrade Curl to version 8.7.1.
    
    Patch by: me
    
    (cherry picked from commit e469ab6aed23a1b38f105a944997af16e61071d0)
---
 main/curl/curl-bundled_openssl.patch | 35 ++++++++++++++++++-----------------
 main/curl/curl-wnt.patch             | 26 ++++----------------------
 main/curl/makefile.mk                | 17 ++++++++++-------
 main/curl/prj/d.lst                  | 10 +---------
 main/external_deps.lst               |  4 ++--
 5 files changed, 35 insertions(+), 57 deletions(-)

diff --git a/main/curl/curl-bundled_openssl.patch b/main/curl/curl-bundled_openssl.patch
index a3599097ac..02398175f9 100644
--- a/main/curl/curl-bundled_openssl.patch
+++ b/main/curl/curl-bundled_openssl.patch
@@ -1,28 +1,29 @@
---- misc/curl-7.72.0/configure	2020-08-17 00:34:29.000000000 +0200
-+++ misc/build/curl-7.72.0/configure	2022-05-05 19:03:39.766880970 +0200
-@@ -23617,14 +23617,14 @@
-       { $as_echo "$as_me:${as_lineno-$LINENO}: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&5
- $as_echo "$as_me: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&6;}
-       PKGTEST="yes"
--    elif test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then
-+    elif test ! -f "$PREFIX_OPENSSL/inc/external/openssl/ssl.h"; then
-       as_fn_error $? "$PREFIX_OPENSSL is a bad --with-ssl prefix!" "$LINENO" 5
+--- misc/build/curl-8.7.1/configure	2024-04-21 19:20:02.487331000 +0200
++++ misc/build/curl-8.7.1/configure	2024-04-21 19:20:26.529989000 +0200
+@@ -26416,7 +26416,7 @@
      fi
  
+     if test "$PKGTEST" != "yes"; then
+-      if test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then
++      if test ! -f "$PREFIX_OPENSSL/inc/external/openssl/ssl.h"; then
+         as_fn_error $? "$PREFIX_OPENSSL is a bad --with-openssl prefix!" "$LINENO" 5
+       fi
+     fi
+@@ -26424,7 +26424,7 @@
              LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
      if test "$PREFIX_OPENSSL" != "/usr" ; then
        SSL_LDFLAGS="-L$LIB_OPENSSL"
 -      SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
 +      SSL_CPPFLAGS="-I$PREFIX_OPENSSL/inc/external"
      fi
-     SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
      ;;
-@@ -23841,7 +23841,7 @@
-      LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
-      if test "$PKGCONFIG" = "no" ; then
+   esac
+@@ -26655,7 +26655,7 @@
+      fi
+      if test "$PKGCONFIG" = "no" -a -n "$PREFIX_OPENSSL" ; then
         # only set this if pkg-config wasn't used
--       CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
-+       CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/inc/external/openssl -I$PREFIX_OPENSSL/inc/external"
+-       CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include"
++       CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/inc/external"
       fi
-      # Linking previously failed, try extra paths from --with-ssl or pkg-config.
-      # Use a different function name to avoid reusing the earlier cached result.
+      # Linking previously failed, try extra paths from --with-openssl or
+      # pkg-config.  Use a different function name to avoid reusing the earlier
diff --git a/main/curl/curl-wnt.patch b/main/curl/curl-wnt.patch
index b38ad3c4c0..e54176f2ef 100644
--- a/main/curl/curl-wnt.patch
+++ b/main/curl/curl-wnt.patch
@@ -1,6 +1,6 @@
---- misc/build/curl-7.72.0/winbuild/MakefileBuild.vc	2020-08-17 00:28:40.000000000 +0200
-+++ misc/build/curl-7.72.0/winbuild/MakefileBuild.vc	2022-04-23 19:57:39.594763000 +0200
-@@ -115,7 +115,7 @@
+--- misc/build/curl-8.7.1/winbuild/MakefileBuild.vc	2024-03-06 23:16:03.000000000 +0200
++++ misc/build/curl-8.7.1/winbuild/MakefileBuild.vc	2024-04-21 19:13:08.380236000 +0200
+@@ -102,7 +102,7 @@
  !IFNDEF WITH_DEVEL
  WITH_DEVEL   = ../../deps
  !ENDIF
@@ -9,7 +9,7 @@
  DEVEL_LIB    = $(WITH_DEVEL)/lib
  
  !IF EXISTS("$(DEVEL_INCLUDE)")
-@@ -233,7 +233,7 @@
+@@ -241,7 +241,7 @@
  ZLIB_LIB_DIR = $(ZLIB_PATH)\lib
  ZLIB_LFLAGS  = $(ZLIB_LFLAGS) "/LIBPATH:$(ZLIB_LIB_DIR)"
  !ELSE
@@ -18,21 +18,3 @@
  ZLIB_LIB_DIR = $(DEVEL_LIB)
  !ENDIF
  
-@@ -568,6 +568,7 @@
- 	@if not exist "$(LIB_DIROBJ)\vtls" mkdir $(LIB_DIROBJ)\vtls
- 	@if not exist "$(LIB_DIROBJ)\vssh" mkdir $(LIB_DIROBJ)\vssh
- 	@if not exist "$(LIB_DIROBJ)\vquic" mkdir $(LIB_DIROBJ)\vquic
-+	@if not exist "$(LIB_DIROBJ)\vssh" mkdir $(LIB_DIROBJ)\vssh
- 
- $(CURL_DIROBJ):
- 	@if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)
-@@ -590,6 +591,9 @@
- 	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
- 
- {$(LIBCURL_SRC_DIR)\vquic\}.c{$(LIB_DIROBJ)\vquic\}.obj:
-+	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
-+
-+{$(LIBCURL_SRC_DIR)\vssh\}.c{$(LIB_DIROBJ)\vssh\}.obj:
- 	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
- 
- $(LIB_DIROBJ)\libcurl.res: $(LIBCURL_SRC_DIR)\libcurl.rc
diff --git a/main/curl/makefile.mk b/main/curl/makefile.mk
index b801cb75bf..f17ba876d9 100644
--- a/main/curl/makefile.mk
+++ b/main/curl/makefile.mk
@@ -37,8 +37,8 @@ all:
 
 # --- Files --------------------------------------------------------
 
-TARFILE_NAME=curl-7.72.0
-TARFILE_MD5=7422feb126df677d2d33294a1fd079ea
+TARFILE_NAME=curl-8.7.1
+TARFILE_MD5=92f7a11836678b725e2cb59fef10c273
 PATCH_FILES=curl-wnt.patch
 
 #ADDITIONAL_FILES= lib$/config-os2.h lib$/Makefile.os2
@@ -146,15 +146,18 @@ OUT2LIB=$(BUILD_DIR)$/libcurl.lib
 .ENDIF			# "$(GUI)"=="OS2"
 
 OUT2INC= \
-	include$/curl$/easy.h  			\
-	include$/curl$/multi.h  		\
 	include$/curl$/curl.h  			\
 	include$/curl$/curlver.h  		\
-	include$/curl$/typecheck-gcc.h  	\
-	include$/curl$/stdcheaders.h  	\
+	include$/curl$/easy.h  			\
+	include$/curl$/header.h			\
 	include$/curl$/mprintf.h	    \
+	include$/curl$/multi.h  		\
+	include$/curl$/options.h		\
+	include$/curl$/stdcheaders.h  	\
 	include$/curl$/system.h			\
-	include$/curl$/urlapi.h
+	include$/curl$/typecheck-gcc.h  	\
+	include$/curl$/urlapi.h			\
+	include$/curl$/websockets.h
 
 
 # --- Targets ------------------------------------------------------
diff --git a/main/curl/prj/d.lst b/main/curl/prj/d.lst
index 1458a6b968..a5bb6b4e79 100644
--- a/main/curl/prj/d.lst
+++ b/main/curl/prj/d.lst
@@ -1,13 +1,5 @@
 mkdir: %_DEST%\inc%_EXT%\external\curl
-..\%__SRC%\inc\easy.h %_DEST%\inc%_EXT%\external\curl\easy.h
-..\%__SRC%\inc\curlver.h %_DEST%\inc%_EXT%\external\curl\curlver.h
-..\%__SRC%\inc\curl.h %_DEST%\inc%_EXT%\external\curl\curl.h
-..\%__SRC%\inc\mprintf.h %_DEST%\inc%_EXT%\external\curl\mprintf.h
-..\%__SRC%\inc\multi.h %_DEST%\inc%_EXT%\external\curl\multi.h
-..\%__SRC%\inc\stdcheaders.h %_DEST%\inc%_EXT%\external\curl\stdcheaders.h
-..\%__SRC%\inc\typecheck-gcc.h %_DEST%\inc%_EXT%\external\curl\typecheck-gcc.h
-..\%__SRC%\inc\system.h %_DEST%\inc%_EXT%\external\curl\system.h
-..\%__SRC%\inc\urlapi.h %_DEST%\inc%_EXT%\external\curl\urlapi.h
+..\%__SRC%\inc\*.h %_DEST%\inc%_EXT%\external\curl\
 
 ..\%__SRC%\bin\libcurl*.dll %_DEST%\bin%_EXT%\*.dll
 ..\%__SRC%\lib\libcurl.* %_DEST%\lib%_EXT%\libcurl.*
diff --git a/main/external_deps.lst b/main/external_deps.lst
index 237b599761..f5d7f4b561 100644
--- a/main/external_deps.lst
+++ b/main/external_deps.lst
@@ -218,8 +218,8 @@ if (SYSTEM_EXPAT != YES)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
 if (SYSTEM_CURL != YES)
-    MD5 = 7422feb126df677d2d33294a1fd079ea
-    name = curl-7.72.0.tar.gz
+    MD5 = 92f7a11836678b725e2cb59fef10c273
+    name = curl-8.7.1.tar.gz
     URL1 = https://curl.haxx.se/download/$(name)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 


(openoffice) 09/12: Build OpenSSL as a dynamic link library, instead of a static library.

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit e350def35cbda643944098130243b4e7e550d7ef
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Sun Apr 7 10:41:42 2024 +0200

    Build OpenSSL as a dynamic link library, instead of a static library.
    
    Patch its users to use an RPATH of $ORIGIN, so they use the correct copy.
    This reduces the size of the build by about 4615 KiB, or 3.78%.
    
    Patch by: me
    
    (adapted from commit 8eb9a7e66a3128669216ddb884f844d50ac59fb9 by Arrigo
    Marchiori)
---
 main/RepositoryExternal.mk                | 17 ++++-------------
 main/curl/makefile.mk                     |  2 ++
 main/openssl/opensslunx.patch             | 17 ++++++++++++-----
 main/openssl/prj/d.lst                    |  7 +++++--
 main/scp2/source/ooo/file_library_ooo.scp |  4 ++--
 5 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/main/RepositoryExternal.mk b/main/RepositoryExternal.mk
index afc4420ba1..5a8503056e 100644
--- a/main/RepositoryExternal.mk
+++ b/main/RepositoryExternal.mk
@@ -361,35 +361,26 @@ endef
 
 else # !SYSTEM_OPENSSL
 
-ifeq ($(OS),WNT)
 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
 	crypto \
 	ssl \
 ))
-else
-$(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
-	crypto \
-	ssl \
-))
-endif
 
 define gb_LinkTarget__use_openssl
-ifeq ($(OS),WNT)
 $(call gb_LinkTarget_add_linked_libs,$(1),\
 	crypto \
 	ssl \
 )
-else
-$(call gb_LinkTarget_add_linked_static_libs,$(1),\
-	crypto \
-	ssl \
-)
 ifeq ($(OS),SOLARIS)
 $(call gb_LinkTarget_add_libs,$(1),\
 	-lnsl \
 	-lsocket \
 )
 endif
+ifeq ($(OS),LINUX)
+$(call gb_LinkTarget_add_libs,$(1),\
+	-lpthread \
+)
 endif
 endef
 
diff --git a/main/curl/makefile.mk b/main/curl/makefile.mk
index 044bf4d8c9..b801cb75bf 100644
--- a/main/curl/makefile.mk
+++ b/main/curl/makefile.mk
@@ -59,6 +59,8 @@ curl_LDFLAGS+:=$(ARCH_FLAGS)
 ssl_param=--with-ssl
 .ELSE
 ssl_param=--with-ssl=$(OUTDIR)
+curl_CFLAGS+=-I$(SOLARINCDIR)$/external
+curl_LDFLAGS+=-L$(SOLARLIBDIR) -Wl,-z,origin -Wl,-rpath,\\\$$\$$ORIGIN
 PATCH_FILES+= curl-bundled_openssl.patch
 .ENDIF
 
diff --git a/main/openssl/opensslunx.patch b/main/openssl/opensslunx.patch
index 7177a1c740..5ceac19471 100644
--- a/main/openssl/opensslunx.patch
+++ b/main/openssl/opensslunx.patch
@@ -1,10 +1,17 @@
---- misc/build/openssl-3.0.13/Configurations/00-base-templates.conf	2024-01-30 15:28:16.000000000 +0200
-+++ misc/build/openssl-3.0.13/Configurations/00-base-templates.conf	2024-03-18 02:55:09.593025000 +0200
-@@ -67,6 +67,7 @@
+--- misc/build/openssl-3.0.13/Configurations/00-base-templates.conf	2024-04-14 20:51:59.953276000 +0200
++++ misc/build/openssl-3.0.13/Configurations/00-base-templates.conf	2024-04-15 04:41:41.558374000 +0200
+@@ -67,9 +67,13 @@
  
          AR              => "ar",
          ARFLAGS         => "qc",
-+        ASFLAGS          => "-Wa,--noexecstack",
++        ASFLAGS         => "-Wa,--noexecstack",
          CC              => "cc",
          lflags          =>
-             sub { $withargs{zlib_lib} ? "-L".$withargs{zlib_lib} : () },
+-            sub { $withargs{zlib_lib} ? "-L".$withargs{zlib_lib} : () },
++            sub {
++                my $s = '-Wl,-z,origin -Wl,-rpath,\$$ORIGIN';
++                return $withargs{zlib_lib} ? $s." -L".$withargs{zlib_lib} : $s;
++            },
+         ex_libs         =>
+             sub { !defined($disabled{zlib})
+                   && defined($disabled{"zlib-dynamic"})
diff --git a/main/openssl/prj/d.lst b/main/openssl/prj/d.lst
index f381599703..cac50416cf 100644
--- a/main/openssl/prj/d.lst
+++ b/main/openssl/prj/d.lst
@@ -1,6 +1,9 @@
 mkdir: %_DEST%\inc%_EXT%\external
 mkdir: %_DEST%\inc%_EXT%\external\openssl
 ..\%__SRC%\inc\*.h %_DEST%\inc%_EXT%\external\openssl
-..\%__SRC%\lib\libcrypto.* %_DEST%\lib%_EXT%\libcrypto.*
-..\%__SRC%\lib\libssl.* %_DEST%\lib%_EXT%\libssl.*
+..\%__SRC%\lib\libcrypto.*.* %_DEST%\lib%_EXT%\*
+..\%__SRC%\lib\libssl.*.* %_DEST%\lib%_EXT%\*
 ..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
+
+linklib: libcrypto.*.*
+linklib: libssl.*.*
diff --git a/main/scp2/source/ooo/file_library_ooo.scp b/main/scp2/source/ooo/file_library_ooo.scp
index fb82de45e6..ca9dadba1e 100644
--- a/main/scp2/source/ooo/file_library_ooo.scp
+++ b/main/scp2/source/ooo/file_library_ooo.scp
@@ -1777,7 +1777,7 @@ File gid_File_Lib_Openssl
   #ifdef WNT
     Name = "libssl-3.dll";
   #else
-    Name = "libssl.so";
+    Name = SCP2_URE_DL_VER("ssl", "3");
   #endif
 End
 #endif
@@ -1790,7 +1790,7 @@ File gid_File_Lib_Crypto
   #ifdef WNT
     Name = "libcrypto-3.dll";
   #else
-    Name = "libcrypto.so";
+    Name = SCP2_URE_DL_VER("crypto", "3");
   #endif
 End
 #endif


(openoffice) 04/12: Link to bundled OpenSSL if requested

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit cfbfe4277d92ae7c14987db8379a83545d6d62f1
Author: Arrigo Marchiori <ar...@yahoo.it>
AuthorDate: Thu May 5 19:12:12 2022 +0200

    Link to bundled OpenSSL if requested
    
    (cherry picked from commit bb956dfd85428dd08d991a01ee6a6c4e966bf431)
---
 main/curl/curl-bundled_openssl.patch | 28 ++++++++++++++++++++++++++++
 main/curl/makefile.mk                |  9 ++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/main/curl/curl-bundled_openssl.patch b/main/curl/curl-bundled_openssl.patch
new file mode 100644
index 0000000000..a3599097ac
--- /dev/null
+++ b/main/curl/curl-bundled_openssl.patch
@@ -0,0 +1,28 @@
+--- misc/curl-7.72.0/configure	2020-08-17 00:34:29.000000000 +0200
++++ misc/build/curl-7.72.0/configure	2022-05-05 19:03:39.766880970 +0200
+@@ -23617,14 +23617,14 @@
+       { $as_echo "$as_me:${as_lineno-$LINENO}: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&5
+ $as_echo "$as_me: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&6;}
+       PKGTEST="yes"
+-    elif test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then
++    elif test ! -f "$PREFIX_OPENSSL/inc/external/openssl/ssl.h"; then
+       as_fn_error $? "$PREFIX_OPENSSL is a bad --with-ssl prefix!" "$LINENO" 5
+     fi
+ 
+             LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
+     if test "$PREFIX_OPENSSL" != "/usr" ; then
+       SSL_LDFLAGS="-L$LIB_OPENSSL"
+-      SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
++      SSL_CPPFLAGS="-I$PREFIX_OPENSSL/inc/external"
+     fi
+     SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
+     ;;
+@@ -23841,7 +23841,7 @@
+      LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
+      if test "$PKGCONFIG" = "no" ; then
+        # only set this if pkg-config wasn't used
+-       CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
++       CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/inc/external/openssl -I$PREFIX_OPENSSL/inc/external"
+      fi
+      # Linking previously failed, try extra paths from --with-ssl or pkg-config.
+      # Use a different function name to avoid reusing the earlier cached result.
diff --git a/main/curl/makefile.mk b/main/curl/makefile.mk
index dafa4a6b30..044bf4d8c9 100644
--- a/main/curl/makefile.mk
+++ b/main/curl/makefile.mk
@@ -55,10 +55,17 @@ curl_CFLAGS+:=$(ARCH_FLAGS)
 curl_LDFLAGS+:=$(ARCH_FLAGS)
 .ENDIF
 
+.IF "$(SYSTEM_OPENSSL)"=="YES"
+ssl_param=--with-ssl
+.ELSE
+ssl_param=--with-ssl=$(OUTDIR)
+PATCH_FILES+= curl-bundled_openssl.patch
+.ENDIF
+
 CONFIGURE_DIR=.$/
 #relative to CONFIGURE_DIR
 CONFIGURE_ACTION=.$/configure
-CONFIGURE_FLAGS= --with-ssl --without-libidn --enable-ftp --enable-ipv6 --enable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --disable-static CPPFLAGS="$(curl_CFLAGS)"  LDFLAGS="$(curl_LDFLAGS)"
+CONFIGURE_FLAGS= $(ssl_param) --without-libidn --enable-ftp --enable-ipv6 --enable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --disable-static CPPFLAGS="$(curl_CFLAGS)"  LDFLAGS="$(curl_LDFLAGS)"
 
 BUILD_DIR=$(CONFIGURE_DIR)$/lib
 BUILD_ACTION=$(GNUMAKE)


(openoffice) 07/12: Allow our WebDAV content provider to connect when the TLS certificate name doesn't match the server's host name.

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit e8e5910fd829cec3704a0277212c2973aa68e08f
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Tue Feb 6 07:29:29 2024 +0200

    Allow our WebDAV content provider to connect when the TLS certificate name
    doesn't match the server's host name.
    
    Currently in such cases the connection always fails, and the user isn't even
    given a chance to allow it. This is because Curl does the server name
    validation itself. However we already have code to validate server names,
    and we prompt the user for what to do, unlike Curl which always fails.
    Therefore disable Curl's verification and use ours.
    
    Patch by: me
    
    (cherry picked from commit 88ba7bc95f387996e4041aab9f586786362ea8da)
---
 main/ucb/source/ucp/webdav/CurlSession.cxx | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/main/ucb/source/ucp/webdav/CurlSession.cxx b/main/ucb/source/ucp/webdav/CurlSession.cxx
index bf6494233f..73328b78d5 100644
--- a/main/ucb/source/ucp/webdav/CurlSession.cxx
+++ b/main/ucb/source/ucp/webdav/CurlSession.cxx
@@ -113,6 +113,17 @@ CurlSession::CurlSession(
     curl_easy_setopt( m_pCurl, CURLOPT_SSL_CTX_FUNCTION, Curl_SSLContextCallback );
     curl_easy_setopt( m_pCurl, CURLOPT_SSL_CTX_DATA, this );
 
+    // If a certificate's commmon name / alt name doesn't match the hostname we are
+    // connecting to, Curl will refuse to connect. Disable this, as we do that check
+    // ourselves, and give the user the option of connecting anyway.
+    //
+    // Note also, how "man CURLOPT_SSL_VERIFYHOST" tells us that setting 0 here
+    // disables SNI, which is bad news, some servers require SNI. However reading Curl
+    // 8.6.0's Curl_ssl_peer_init() in file lib/vtls/vtls.c shows that SNI is sent
+    // regardless, as long as we are connecting to a domain name, NOT an IP address.
+    // Tests confirm this. For OpenSSL anyway - other Curl crypto providers are stricter...
+    curl_easy_setopt( m_pCurl, CURLOPT_SSL_VERIFYHOST, 0 );
+
     if ( m_aLogger.getLogLevel() == LogLevel::FINEST )
     {
         curl_easy_setopt( m_pCurl, CURLOPT_DEBUGFUNCTION, Curl_DebugCallback );


(openoffice) 12/12: Override OpenSSL's certificate verification with our own, instead of using its verification and selectively overriding the result. - A nonsense self-signed expired certificate is fed into Curl to get it to initialize even when the certificates in its expected system path are missing or elsewhere. - In Curl's CURLOPT_SSL_CTX_FUNCTION, our Curl_SSLContextCallback, we then completely override OpenSSL's verification process with ours, using SSL_CTX_set_cert_verify_callback() (instead o [...]

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 0ec0f743104c26d8c7b0517fbfa228daea0afc51
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Sun Apr 21 17:07:24 2024 +0200

    Override OpenSSL's certificate verification with our own, instead of
    using its verification and selectively overriding the result.
    - A nonsense self-signed expired certificate is fed into Curl to get it
      to initialize even when the certificates in its expected system path
      are missing or elsewhere.
    - In Curl's CURLOPT_SSL_CTX_FUNCTION, our Curl_SSLContextCallback, we
      then completely override OpenSSL's verification process with ours,
      using SSL_CTX_set_cert_verify_callback() (instead of the previous
      SSL_CTX_set_verify() which just allows us to override OpenSSL's
      verification result).
    - The verification is largely the same as before, we just have to call
      slightly different functions to retrieve the certificate to verify and
      the untrusted chain.
    - Create components using the component context, not the legacy multi
      service factory.
    - Various other cleanups, better logging, etc. were made in the process.
    
    Patch by: me
    
    (cherry picked from commit f7b97bf7d9139c8b602d3da3aadbeef0631e39c1)
---
 main/ucb/source/ucp/webdav/CurlSession.cxx | 197 ++++++++++++++---------------
 main/ucb/source/ucp/webdav/CurlSession.hxx |  14 +-
 2 files changed, 103 insertions(+), 108 deletions(-)

diff --git a/main/ucb/source/ucp/webdav/CurlSession.cxx b/main/ucb/source/ucp/webdav/CurlSession.cxx
index 73328b78d5..55c654ffc2 100644
--- a/main/ucb/source/ucp/webdav/CurlSession.cxx
+++ b/main/ucb/source/ucp/webdav/CurlSession.cxx
@@ -47,13 +47,10 @@
 #include "webdavprovider.hxx"
 
 
-#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
 #include <com/sun/star/logging/LogLevel.hpp>
 #include <com/sun/star/security/XCertificate.hpp>
 #include <com/sun/star/security/CertificateValidity.hpp>
 #include <com/sun/star/security/CertificateContainerStatus.hpp>
-#include <com/sun/star/security/CertificateContainer.hpp>
-#include <com/sun/star/security/XCertificateContainer.hpp>
 #include <com/sun/star/security/CertAltNameEntry.hpp>
 #include <com/sun/star/security/XSanExtension.hpp>
 #include <com/sun/star/ucb/Lock.hpp>
@@ -130,6 +127,48 @@ CurlSession::CurlSession(
         curl_easy_setopt( m_pCurl, CURLOPT_DEBUGDATA, this );
         curl_easy_setopt( m_pCurl, CURLOPT_VERBOSE, 1L);
     }
+
+    // Create a certificate container.
+    if( !m_aContext.createComponent( "com.sun.star.security.CertificateContainer", m_xCertificateContainer ) )
+        throw DAVException( DAVException::DAV_SESSION_CREATE, rtl::OUString::createFromAscii( "Failed to create com.sun.star.security.CertificateContainer" ) );
+    uno::Reference< xml::crypto::XSEInitializer > xSEInitializer;
+    if( !m_aContext.createComponent( "com.sun.star.xml.crypto.SEInitializer", xSEInitializer ) )
+        throw DAVException( DAVException::DAV_SESSION_CREATE, rtl::OUString::createFromAscii( "Failed to create com.sun.star.xml.crypto.SEInitializer" ) );
+    m_xSecurityContext = xSEInitializer->createSecurityContext( rtl::OUString() );
+    if( m_xSecurityContext.is() )
+        m_xSecurityEnv = m_xSecurityContext->getSecurityEnvironment();
+    if ( ! m_xSecurityContext.is() || ! m_xSecurityEnv.is())
+        throw DAVException( DAVException::DAV_SESSION_CREATE, rtl::OUString::createFromAscii( "Failure creating security services for certificate verification" ) );
+
+    // Populate one nonsense certificate, which we won't ever really use, just to get Curl to initialize:
+    struct curl_blob blob;
+    blob.data = (void*)
+        "-----BEGIN CERTIFICATE-----\n"
+        "MIIC/zCCAeegAwIBAgIUQYFHL3Bv7alQBtXQWy9SXGusm5YwDQYJKoZIhvcNAQEL\n"
+        "BQAwDzENMAsGA1UEAwwEVEVTVDAeFw0yNDA0MjExNzU3MzdaFw0yNDA0MjIxNzU3\n"
+        "MzdaMA8xDTALBgNVBAMMBFRFU1QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n"
+        "AoIBAQCZSXla2TE7GU6xOfie5uilpRf7KQflWcQRgwTCFhk0yzbsSPJYdqbuUqfx\n"
+        "k0pV9Sx8GIkvc7jKQBwS79T15qn6dAZOF40x/k2jEMq150oc/80+dqeNP2jWvxv7\n"
+        "FjgBKSiuGUaHldy6XU3NhrA9G1Ys2/yHQRXER1NTeknEzPiPlobRUk1sNR2Prc5r\n"
+        "0u6cdUWGhbDOKDV9jjvA/14jmaAK+vUqrzzAdiOHVrkglA5oyBKX0BUokRCa8jID\n"
+        "34tH9zeuvozA3xXCi8l9to+HOgT/n7LAGeOSnNPeSHC/xkwumt/rJ05tL9DXg6Ud\n"
+        "3Pjf8KZM+FWJsjoJkcwBR0P2Qh3FAgMBAAGjUzBRMB0GA1UdDgQWBBR7pCl5msAz\n"
+        "rGApirAQ+/tFuHl5kDAfBgNVHSMEGDAWgBR7pCl5msAzrGApirAQ+/tFuHl5kDAP\n"
+        "BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBDJ1S51MKlafDAfFbU\n"
+        "DJcxw3JNHn+VxQuaQQpeeqLIn3rgKHRBV9eOTYHf8AMoCYdQfPs1z45vqBmcyrDw\n"
+        "LoXL6vlUbSLUuYFyfCaFup3bbh2lLozsLcD6bcvV07amX6V3u0ZOKpwqhg+k/IJd\n"
+        "cPVM8jYAnNZZYD6rMHWnW5ZgMFSzSj3Jyyaov/3zwixvFZdViBG+R2RmJZVgMiFP\n"
+        "PNxY3USKiHqdwZIszf3G63Ku0EYtFf3KN8YpoqSMDCDfjL0NhJOtkBUs5HL+4XfK\n"
+        "hToBqJojDMLFRdVIhPQX1LoPd92CUwhueIrYTikScAqY2TIwXpPH0kBjfrVDus8s\n"
+        "vPAk\n"
+        "-----END CERTIFICATE-----";
+    blob.len = strlen( (char*) blob.data ) + 1;
+    blob.flags = CURL_BLOB_COPY;
+    CURLcode rc;
+    rc = curl_easy_setopt( m_pCurl, CURLOPT_CAINFO_BLOB, &blob );
+    if( rc != CURLE_OK )
+        throw DAVException( DAVException::DAV_SESSION_CREATE, rtl::OUString::createFromAscii("Error initializing Curl certificate" ) );
+
     m_aLogger.log( LogLevel::INFO, "CurlSession::CurlSession with URL $1$",
         rtl::OUStringToOString( inUri, RTL_TEXTENCODING_UTF8 ).getStr() );
 }
@@ -333,29 +372,17 @@ CURLcode CurlSession::Curl_SSLContextCallback( CURL *, void *ssl_ctx, void *user
     CurlSession *session = static_cast<CurlSession*>( userptr );
     SSL_CTX *context = static_cast<SSL_CTX*>( ssl_ctx );
     SSL_CTX_set_app_data( context, session );
-    SSL_CTX_set_verify( context, SSL_VERIFY_PEER, OPENSSL_ValidateServerCertificate );
+    SSL_CTX_set_cert_verify_callback( context, OPENSSL_VerifyCertificate, session );
     return CURLE_OK;
 }
 
-int CurlSession::OPENSSL_ValidateServerCertificate( int preverify_ok, X509_STORE_CTX *x509_ctx )
+int CurlSession::OPENSSL_VerifyCertificate( X509_STORE_CTX *x509_ctx, void *arg )
 {
-    SSL *ssl = static_cast<SSL*> (
-        X509_STORE_CTX_get_ex_data( x509_ctx, SSL_get_ex_data_X509_STORE_CTX_idx() ) );
-    SSL_CTX *ssl_ctx = SSL_get_SSL_CTX( ssl );
-    CurlSession *session = static_cast<CurlSession*>( SSL_CTX_get_app_data( ssl_ctx ) );
-    int verifyOk = session->validateServerX509Certificate( x509_ctx, preverify_ok );
-    // When a certificate's verification fails within OpenSSL, yet passes from the
-    // SSL_CTX_set_verify() callback (ie. this function) (by returning 1),
-    // OpenSSL allows the connection to proceed, yet stores that last verification
-    // error and allows it to be retrieved using SSL_get_verify_result(3).
-    //
-    // Unfortunately, Curl calls SSL_get_verify_result(3) internally, and treats
-    // errors as terminal, disconnecting with an error even when we return 1 here.
-    // Therefore, to approve a certificate that OpenSSL would reject, we have to
-    // both return 1, and overwrite the X509_STORE_CTX's last error with X509_V_OK:
-    if ( verifyOk )
-        X509_STORE_CTX_set_error( x509_ctx, X509_V_OK );
-    return verifyOk;
+    CurlSession *session = static_cast<CurlSession*>( arg );
+    int verifyResult = session->verifyServerX509Certificate( x509_ctx );
+    // We have to both return 1 or 0, and set the X509_V_* error code with X509_STORE_CTX_set_error():
+    X509_STORE_CTX_set_error( x509_ctx, verifyResult );
+    return verifyResult == X509_V_OK ? 1 : 0;
 }
 
 static uno::Sequence< sal_Int8 > convertCertificateToAsn1Der( X509 *certificate )
@@ -373,94 +400,56 @@ static uno::Sequence< sal_Int8 > convertCertificateToAsn1Der( X509 *certificate
         return uno::Sequence< sal_Int8 >();
 }
 
-int CurlSession::validateServerX509Certificate( X509_STORE_CTX *x509StoreContext, int verifyOk )
+int CurlSession::verifyServerX509Certificate( X509_STORE_CTX *x509StoreContext )
 {
-    X509 *serverCertificate = X509_STORE_CTX_get_current_cert( x509StoreContext );
-    int depth = X509_STORE_CTX_get_error_depth( x509StoreContext );
-    STACK_OF(X509) *chain =
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
-         X509_STORE_CTX_get0_chain( x509StoreContext );
-#else
-         X509_STORE_CTX_get_chain( x509StoreContext );
-#endif
+    X509 *serverCertificate = X509_STORE_CTX_get0_cert( x509StoreContext );
+    STACK_OF(X509) *chain = X509_STORE_CTX_get0_untrusted( x509StoreContext );
     
     std::vector< uno::Sequence< sal_Int8 > > asn1DerCertificates;
+    int verifyResult = X509_V_OK;
     if ( chain != NULL ) {
         int nCertificates = sk_X509_num( chain );
-        for ( int i = 0; i < nCertificates; i++ ) {
+        for ( int i = 0; i < nCertificates && verifyResult == X509_V_OK; i++ ) {
             X509 *certificate = sk_X509_value( chain, i );
             uno::Sequence< sal_Int8 > asn1DerCertificate = convertCertificateToAsn1Der( certificate );
-            if ( asn1DerCertificate.getLength() == 0 )
-                return 0;
-            asn1DerCertificates.push_back( asn1DerCertificate );
+            if( asn1DerCertificate.getLength() > 0 )
+                asn1DerCertificates.push_back( asn1DerCertificate );
+            else
+                verifyResult = X509_V_ERR_UNSPECIFIED;
         }
     } else {
         uno::Sequence< sal_Int8 > asn1DerCertificate = convertCertificateToAsn1Der( serverCertificate );
-        if ( asn1DerCertificate.getLength() == 0 )
-            return 0;
-        asn1DerCertificates.push_back( asn1DerCertificate );
+        if( asn1DerCertificate.getLength() > 0 )
+            asn1DerCertificates.push_back( asn1DerCertificate );
+        else
+            verifyResult = X509_V_ERR_UNSPECIFIED;
     }
-    verifyOk = verifyCertificateChain( asn1DerCertificates );
+    if( verifyResult == X509_V_OK )
+        verifyResult = verifyCertificateChain( asn1DerCertificates );
 
-    m_aLogger.log( LogLevel::FINE, "validateServerX509Certificate() returning $1$ at depth $2$",
-        (sal_Int32)verifyOk, (sal_Int32)depth );
-    return verifyOk;
+    rtl::OUString verifyErrorString = rtl::OUString::createFromAscii( X509_verify_cert_error_string( verifyResult ) );
+    m_aLogger.log( LogLevel::FINE, "validateServerX509Certificate() verifyResult=$1$ ($2$)",
+        (sal_Int32)verifyResult, verifyErrorString );
+    return verifyResult;
 }
 
 int CurlSession::verifyCertificateChain (
     std::vector< uno::Sequence< sal_Int8 > > &asn1DerCertificates )
 {
     // Check arguments.
-    if (asn1DerCertificates.size()<=0)
+    if( asn1DerCertificates.size() <= 0 )
     {
-        OSL_ASSERT(asn1DerCertificates.size()>0);
-        return 0;
-    }
-
-    // Create some crypto objects to decode and handle the base64
-    // encoded certificate chain.
-    uno::Reference< xml::crypto::XSEInitializer > xSEInitializer;
-    uno::Reference< security::XCertificateContainer > xCertificateContainer;
-    uno::Reference< xml::crypto::XXMLSecurityContext > xSecurityContext;
-    uno::Reference< xml::crypto::XSecurityEnvironment > xSecurityEnv;
-    try
-    {
-        // Create a certificate container.
-        xCertificateContainer = uno::Reference< security::XCertificateContainer >(
-            getMSF()->createInstance(
-                rtl::OUString::createFromAscii(
-                    "com.sun.star.security.CertificateContainer" ) ),
-            uno::UNO_QUERY_THROW);
-
-        xSEInitializer = uno::Reference< xml::crypto::XSEInitializer >(
-            getMSF()->createInstance(
-                rtl::OUString::createFromAscii( "com.sun.star.xml.crypto.SEInitializer" ) ),
-            uno::UNO_QUERY_THROW);
-
-        xSecurityContext = xSEInitializer->createSecurityContext( rtl::OUString() );
-        if (xSecurityContext.is())
-            xSecurityEnv = xSecurityContext->getSecurityEnvironment();
-
-        if ( ! xSecurityContext.is() || ! xSecurityEnv.is())
-        {
-            // Do we have to dispose xSEInitializer or xCertificateContainer?
-            m_aLogger.log( LogLevel::WARNING, "Failure creating security services for certificate verification" );
-            return 0;
-        }
-    }
-    catch ( uno::Exception const &e)
-    {
-        m_aLogger.log( LogLevel::WARNING, "Error creating security services: $1$", e.Message );
-        return 0;
+        m_aLogger.log( LogLevel::WARNING, "No certificates to verify - failing!" );
+        return X509_V_ERR_UNSPECIFIED;
     }
 
     // Decode the server certificate.
     uno::Reference< security::XCertificate > xServerCertificate(
-        xSecurityEnv->createCertificateFromRaw( asn1DerCertificates[0] ) );
+        m_xSecurityEnv->createCertificateFromRaw( asn1DerCertificates[0] ) );
     if ( ! xServerCertificate.is())
     {
         m_aLogger.log( LogLevel::WARNING, "Failed to create XCertificate" );
-        return 0;
+        return X509_V_ERR_UNSPECIFIED;
     }
 
     // Get the subject from the server certificate.
@@ -485,15 +474,15 @@ int CurlSession::verifyCertificateChain (
     // entry for the server then we do not have to authenticate any
     // certificate.
     const security::CertificateContainerStatus eStatus (
-        xCertificateContainer->hasCertificate(
+        m_xCertificateContainer->hasCertificate(
             getHostName(), sServerCertificateSubject ) );
     if (eStatus != security::CertificateContainerStatus_NOCERT)
     {
         m_aLogger.log( LogLevel::FINER, "Cached certificate found with status=$1$",
                 eStatus == security::CertificateContainerStatus_TRUSTED ? "trusted" : "untrusted" );
         return eStatus == security::CertificateContainerStatus_TRUSTED
-               ? 1
-               : 0;
+               ? X509_V_OK
+               : X509_V_ERR_CERT_UNTRUSTED;
     }
 
     // The shortcut failed, so try to verify the whole chain. This is
@@ -503,15 +492,15 @@ int CurlSession::verifyCertificateChain (
     for (nIndex=0; nIndex < asn1DerCertificates.size(); ++nIndex)
     {
         uno::Reference< security::XCertificate > xCertificate(
-            xSecurityEnv->createCertificateFromRaw( asn1DerCertificates[ nIndex ] ) );
+            m_xSecurityEnv->createCertificateFromRaw( asn1DerCertificates[ nIndex ] ) );
         if ( ! xCertificate.is())
         {
-            m_aLogger.log( LogLevel::FINE, "Failed to create XCertificate $1$", nIndex );
-            return 0;
+            m_aLogger.log( LogLevel::WARNING, "Failed to create XCertificate $1$", nIndex );
+            return X509_V_ERR_UNSPECIFIED;
         }
         aChain.push_back(xCertificate);
     }
-    const sal_Int64 nVerificationResult (xSecurityEnv->verifyCertificate(
+    const sal_Int64 nVerificationResult (m_xSecurityEnv->verifyCertificate(
             xServerCertificate,
             ::comphelper::containerToSequence(aChain)));
 
@@ -557,8 +546,8 @@ int CurlSession::verifyCertificateChain (
         if (nVerificationResult == 0)
         {
             m_aLogger.log( LogLevel::FINE, "Certificate (chain) is valid" );
-            xCertificateContainer->addCertificate(getHostName(), sServerCertificateSubject, sal_True);
-            return 1;
+            m_xCertificateContainer->addCertificate(getHostName(), sServerCertificateSubject, sal_True);
+            return X509_V_OK;
         }
         else if ((nVerificationResult & security::CertificateValidity::CHAIN_INCOMPLETE) != 0)
         {
@@ -566,14 +555,14 @@ int CurlSession::verifyCertificateChain (
             // neither automatically (as we just discovered) nor
             // manually (so there is no point in showing any dialog.)
             m_aLogger.log( LogLevel::WARNING, "Certificate (chain) is incomplete" );
-            return 0;
+            return X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT;
         }
         else if ((nVerificationResult & security::CertificateValidity::REVOKED) != 0)
         {
             // Certificate (chain) is invalid.
             m_aLogger.log( LogLevel::WARNING, "Certificate (chain) is revoked" );
-            xCertificateContainer->addCertificate(getHostName(), sServerCertificateSubject,  sal_False);
-            return 0;
+            m_xCertificateContainer->addCertificate(getHostName(), sServerCertificateSubject,  sal_False);
+            return X509_V_ERR_CERT_REVOKED;
         }
         else
         {
@@ -604,15 +593,15 @@ int CurlSession::verifyCertificateChain (
                 if ( xApprove.is() )
                 {
                     m_aLogger.log( LogLevel::FINE, "The user approved the certificate" );
-                    xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_True );
-                    return 1;
+                    m_xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_True );
+                    return X509_V_OK;
                 }
                 else
                 {
                     // Don't trust cert
-                    m_aLogger.log( LogLevel::FINE, "The user REJECTED the certificate" );
-                    xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_False );
-                    return 0;
+                    m_aLogger.log( LogLevel::WARNING, "The user REJECTED the certificate" );
+                    m_xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_False );
+                    return X509_V_ERR_CERT_REJECTED;
                 }
             }
         }
@@ -620,13 +609,13 @@ int CurlSession::verifyCertificateChain (
         {
             // Don't trust cert
             m_aLogger.log( LogLevel::WARNING, "Couldn't create the interaction handler for user feedback, rejecting the certificate" );
-            xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_False );
-            return 0;
+            m_xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_False );
+            return X509_V_ERR_CERT_REJECTED;
         }
     }
     m_aLogger.log( LogLevel::WARNING, "No XCommandEnvironment, rejecting the certificate" );
 
-    return 0;
+    return X509_V_ERR_CERT_REJECTED;
 }
 
 bool CurlSession::Curl_ProvideCredentials( long statusCode, void *userdata ) throw (DAVException)
diff --git a/main/ucb/source/ucp/webdav/CurlSession.hxx b/main/ucb/source/ucp/webdav/CurlSession.hxx
index 091b304324..96a03c6f8f 100644
--- a/main/ucb/source/ucp/webdav/CurlSession.hxx
+++ b/main/ucb/source/ucp/webdav/CurlSession.hxx
@@ -37,6 +37,10 @@
 #include "CurlUri.hxx"
 #include "CurlInputStream.hxx"
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/security/CertificateContainer.hpp>
+#include <com/sun/star/security/XCertificateContainer.hpp>
+#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
+#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
 #include <curl/curl.h>
 #include <openssl/ssl.h>
 
@@ -75,6 +79,10 @@ private:
 
     static CurlLockStore m_aCurlLockStore;
 
+    ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateContainer > m_xCertificateContainer;
+    ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityContext > m_xSecurityContext;
+    ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnv;
+
     bool isSSLNeeded();
 
 
@@ -89,10 +97,8 @@ private:
     static CURLcode         Curl_SSLContextCallback( CURL *curl,
                                                      void *ssl_ctx,
                                                      void *userptr );
-    static int              OPENSSL_ValidateServerCertificate( int preverify_ok,
-                                                               X509_STORE_CTX *x509_ctx );
-    int                     validateServerX509Certificate( X509_STORE_CTX *x509StoreContext,
-                                                           int preverifyOk );
+    static int              OPENSSL_VerifyCertificate( X509_STORE_CTX *x509_ctx, void *arg );
+    int                     verifyServerX509Certificate( X509_STORE_CTX *x509StoreContext );
     int                     verifyCertificateChain (
                                 std::vector< uno::Sequence< sal_Int8 > > &asn1DerCertificates );
 


(openoffice) 06/12: In the WebDAV content provider, allow the user to permit any TLS certificate in the chain that's invalid, not just the first.

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit f7ba5d5a709e464e56e5d80c5635469f9351434d
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Tue Aug 23 02:52:31 2022 +0200

    In the WebDAV content provider, allow the user to permit any TLS certificate
    in the chain that's invalid, not just the first.
    
    Patch by: me
    
    (cherry picked from commit c464040a4409a7ab63c22a7b2358ce0134c09c10)
---
 main/ucb/source/ucp/webdav/CurlSession.cxx | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/main/ucb/source/ucp/webdav/CurlSession.cxx b/main/ucb/source/ucp/webdav/CurlSession.cxx
index 721f1aa4cb..bf6494233f 100644
--- a/main/ucb/source/ucp/webdav/CurlSession.cxx
+++ b/main/ucb/source/ucp/webdav/CurlSession.cxx
@@ -373,25 +373,24 @@ int CurlSession::validateServerX509Certificate( X509_STORE_CTX *x509StoreContext
          X509_STORE_CTX_get_chain( x509StoreContext );
 #endif
     
-    if ( depth == 0 ) {
-        std::vector< uno::Sequence< sal_Int8 > > asn1DerCertificates;
-        if ( chain != NULL ) {
-            int nCertificates = sk_X509_num( chain );
-            for ( int i = 0; i < nCertificates; i++ ) {
-                X509 *certificate = sk_X509_value( chain, i );
-                uno::Sequence< sal_Int8 > asn1DerCertificate = convertCertificateToAsn1Der( certificate );
-                if ( asn1DerCertificate.getLength() == 0 )
-                    return 0;
-                asn1DerCertificates.push_back( asn1DerCertificate );
-            }
-        } else {
-            uno::Sequence< sal_Int8 > asn1DerCertificate = convertCertificateToAsn1Der( serverCertificate );
+    std::vector< uno::Sequence< sal_Int8 > > asn1DerCertificates;
+    if ( chain != NULL ) {
+        int nCertificates = sk_X509_num( chain );
+        for ( int i = 0; i < nCertificates; i++ ) {
+            X509 *certificate = sk_X509_value( chain, i );
+            uno::Sequence< sal_Int8 > asn1DerCertificate = convertCertificateToAsn1Der( certificate );
             if ( asn1DerCertificate.getLength() == 0 )
                 return 0;
             asn1DerCertificates.push_back( asn1DerCertificate );
         }
-        verifyOk = verifyCertificateChain( asn1DerCertificates );
+    } else {
+        uno::Sequence< sal_Int8 > asn1DerCertificate = convertCertificateToAsn1Der( serverCertificate );
+        if ( asn1DerCertificate.getLength() == 0 )
+            return 0;
+        asn1DerCertificates.push_back( asn1DerCertificate );
     }
+    verifyOk = verifyCertificateChain( asn1DerCertificates );
+
     m_aLogger.log( LogLevel::FINE, "validateServerX509Certificate() returning $1$ at depth $2$",
         (sal_Int32)verifyOk, (sal_Int32)depth );
     return verifyOk;