LibreOffice Module ucb (master) 1
Public Member Functions | Private Attributes | Friends | List of all members
http_dav_ucp::CurlSession Class Reference

implementation of libcurl HTTP/DAV back-end More...

#include <CurlSession.hxx>

Inheritance diagram for http_dav_ucp::CurlSession:
[legend]
Collaboration diagram for http_dav_ucp::CurlSession:
[legend]

Public Member Functions

 CurlSession (css::uno::Reference< css::uno::XComponentContext > xContext, ::rtl::Reference< DAVSessionFactory > const &rpFactory, OUString const &rURI, css::uno::Sequence< css::beans::NamedValue > const &rFlags, ::ucbhelper::InternetProxyDecider const &rProxyDecider)
 
virtual ~CurlSession () override
 
virtual auto CanUse (OUString const &rURI, css::uno::Sequence< css::beans::NamedValue > const &rFlags) -> bool override
 
virtual auto UsesProxy () -> bool override
 
virtual auto OPTIONS (OUString const &rURIReference, DAVOptions &rOptions, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto PROPFIND (OUString const &rURIReference, Depth depth, ::std::vector< OUString > const &rPropertyNames, ::std::vector< DAVResource > &o_rResources, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto PROPFIND (OUString const &rURIReference, Depth depth, ::std::vector< DAVResourceInfo > &o_rResourceInfos, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto PROPPATCH (OUString const &rURIReference, ::std::vector< ProppatchValue > const &rValues, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto HEAD (OUString const &rURIReference, ::std::vector< OUString > const &rHeaderNames, DAVResource &io_rResource, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto GET (OUString const &rURIReference, DAVRequestEnvironment const &rEnv) -> css::uno::Reference< css::io::XInputStream > override
 
virtual auto GET (OUString const &rURIReference, css::uno::Reference< css::io::XOutputStream > &rxOutStream, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto GET (OUString const &rURIReference, ::std::vector< OUString > const &rHeaderNames, DAVResource &io_rResource, DAVRequestEnvironment const &rEnv) -> css::uno::Reference< css::io::XInputStream > override
 
virtual auto GET (OUString const &rURIReference, css::uno::Reference< css::io::XOutputStream > &rxOutStream, ::std::vector< OUString > const &rHeaderNames, DAVResource &io_rResource, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto PUT (OUString const &rURIReference, css::uno::Reference< css::io::XInputStream > const &rxInStream, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto POST (OUString const &rURIReference, OUString const &rContentType, OUString const &rReferer, css::uno::Reference< css::io::XInputStream > const &rxInStream, DAVRequestEnvironment const &rEnv) -> css::uno::Reference< css::io::XInputStream > override
 
virtual auto POST (OUString const &rURIReference, OUString const &rContentType, OUString const &rReferer, css::uno::Reference< css::io::XInputStream > const &rxInStream, css::uno::Reference< css::io::XOutputStream > &rxOutStream, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto MKCOL (OUString const &rURIReference, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto COPY (OUString const &rSourceURIReference, OUString const &rDestinationURI, DAVRequestEnvironment const &rEnv, bool isOverwrite=false) -> void override
 
virtual auto MOVE (OUString const &rSourceURIReference, OUString const &rDestinationURI, DAVRequestEnvironment const &rEnv, bool isOverwrite=false) -> void override
 
virtual auto DESTROY (OUString const &rURIReference, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto LOCK (OUString const &rURIReference, css::ucb::Lock &rLock, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto UNLOCK (OUString const &rURIReference, DAVRequestEnvironment const &rEnv) -> void override
 
virtual auto abort () -> void override
 
auto NonInteractive_LOCK (OUString const &rURI, ::std::u16string_view rLockToken, sal_Int32 &o_rLastChanceToSendRefreshRequest, bool &o_rIsAuthFailed) -> bool
 
auto NonInteractive_UNLOCK (OUString const &rURI) -> void
 
- Public Member Functions inherited from http_dav_ucp::DAVSession
void acquire ()
 
void release ()
 
virtual bool CanUse (const OUString &rURI, const ::com::sun::star::uno::Sequence<::com::sun::star::beans::NamedValue > &rFlags)=0
 
virtual bool UsesProxy ()=0
 
virtual void OPTIONS (const OUString &inPath, DAVOptions &rOptions, const DAVRequestEnvironment &rEnv)=0
 
virtual void PROPFIND (const OUString &inPath, const Depth inDepth, const std::vector< OUString > &inPropertyNames, std::vector< DAVResource > &ioResources, const DAVRequestEnvironment &rEnv)=0
 
virtual void PROPFIND (const OUString &inPath, const Depth inDepth, std::vector< DAVResourceInfo > &ioResInfo, const DAVRequestEnvironment &rEnv)=0
 
virtual void PROPPATCH (const OUString &inPath, const std::vector< ProppatchValue > &inValues, const DAVRequestEnvironment &rEnv)=0
 
virtual void HEAD (const OUString &inPath, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv)=0
 
virtual css::uno::Reference< css::io::XInputStream > GET (const OUString &inPath, const DAVRequestEnvironment &rEnv)=0
 
virtual void GET (const OUString &inPath, css::uno::Reference< css::io::XOutputStream > &o, const DAVRequestEnvironment &rEnv)=0
 
virtual css::uno::Reference< css::io::XInputStream > GET (const OUString &inPath, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv)=0
 
virtual void GET (const OUString &inPath, css::uno::Reference< css::io::XOutputStream > &o, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv)=0
 
virtual void PUT (const OUString &inPath, const css::uno::Reference< css::io::XInputStream > &s, const DAVRequestEnvironment &rEnv)=0
 
virtual css::uno::Reference< css::io::XInputStream > POST (const OUString &inPath, const OUString &rContentType, const OUString &rReferer, const css::uno::Reference< css::io::XInputStream > &inInputStream, const DAVRequestEnvironment &rEnv)=0
 
virtual void POST (const OUString &inPath, const OUString &rContentType, const OUString &rReferer, const css::uno::Reference< css::io::XInputStream > &inInputStream, css::uno::Reference< css::io::XOutputStream > &oOutputStream, const DAVRequestEnvironment &rEnv)=0
 
virtual void MKCOL (const OUString &inPath, const DAVRequestEnvironment &rEnv)=0
 
virtual void COPY (const OUString &inSource, const OUString &inDestination, const DAVRequestEnvironment &rEnv, bool inOverwrite=false)=0
 
virtual void MOVE (const OUString &inSource, const OUString &inDestination, const DAVRequestEnvironment &rEnv, bool inOverwrite=false)=0
 
virtual void DESTROY (const OUString &inPath, const DAVRequestEnvironment &rEnv)=0
 
virtual void LOCK (const OUString &inPath, css::ucb::Lock &inLock, const DAVRequestEnvironment &rEnv)=0
 
virtual void UNLOCK (const OUString &inPath, const DAVRequestEnvironment &rEnv)=0
 
virtual void abort ()=0
 

Private Attributes

::std::mutex m_Mutex
 mutex required to access all other non-const members More...
 
css::uno::Reference< css::uno::XComponentContext > const m_xContext
 
css::uno::Sequence< css::beans::NamedValue > const m_Flags
 flags may be passed to constructor, e.g. "KeepAlive" More...
 
CurlUri const m_URI
 
char m_ErrorBuffer [CURL_ERROR_SIZE]
 buffer for libcurl detailed error messages More...
 
::ucbhelper::InternetProxyServer const m_Proxy
 proxy is used if aName is non-empty More...
 
bool m_isAuthenticated = false
 once authentication was successful, rely on m_pCurl's data More...
 
bool m_isAuthenticatedProxy = false
 
int m_nReadTimeout = 0
 read timeout in milliseconds (connection timeout is stored in m_pCurl) More...
 
::std::atomic< bool > m_AbortFlag = false
 flag to signal abort to transferring thread More...
 
::std::unique_ptr< CURLM, deleter_from_fn< CURLM, curl_multi_cleanup > > m_pCurlMulti
 libcurl multi handle More...
 
::std::unique_ptr< CURL, deleter_from_fn< CURL, curl_easy_cleanup > > m_pCurl
 libcurl easy handle More...
 

Friends

struct CurlProcessor
 

Additional Inherited Members

- Protected Member Functions inherited from http_dav_ucp::DAVSession
 DAVSession (rtl::Reference< DAVSessionFactory > xFactory)
 
virtual ~DAVSession ()
 

Detailed Description

implementation of libcurl HTTP/DAV back-end

Definition at line 23 of file CurlSession.hxx.

Constructor & Destructor Documentation

◆ CurlSession()

http_dav_ucp::CurlSession::CurlSession ( css::uno::Reference< css::uno::XComponentContext >  xContext,
::rtl::Reference< DAVSessionFactory > const &  rpFactory,
OUString const &  rURI,
css::uno::Sequence< css::beans::NamedValue > const &  rFlags,
::ucbhelper::InternetProxyDecider const &  rProxyDecider 
)
explicit

◆ ~CurlSession()

http_dav_ucp::CurlSession::~CurlSession ( )
overridevirtual

Definition at line 731 of file CurlSession.cxx.

Member Function Documentation

◆ abort()

auto http_dav_ucp::CurlSession::abort ( ) -> void
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 755 of file CurlSession.cxx.

◆ CanUse()

auto http_dav_ucp::CurlSession::CanUse ( OUString const &  rURI,
css::uno::Sequence< css::beans::NamedValue > const &  rFlags 
) -> bool
overridevirtual

◆ COPY()

auto http_dav_ucp::CurlSession::COPY ( OUString const &  inSource,
OUString const &  inDestination,
DAVRequestEnvironment const &  rEnv,
bool  inOverwrite = false 
) -> void
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 2120 of file CurlSession.cxx.

References SAL_INFO.

◆ DESTROY()

auto http_dav_ucp::CurlSession::DESTROY ( OUString const &  inPath,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 2138 of file CurlSession.cxx.

References SAL_INFO.

◆ GET() [1/4]

auto http_dav_ucp::CurlSession::GET ( OUString const &  rURIReference,
::std::vector< OUString > const &  rHeaderNames,
DAVResource io_rResource,
DAVRequestEnvironment const &  rEnv 
) -> css::uno::Reference<css::io::XInputStream>
overridevirtual

Definition at line 1899 of file CurlSession.cxx.

References m_xContext, and SAL_INFO.

◆ GET() [2/4]

virtual auto http_dav_ucp::CurlSession::GET ( OUString const &  rURIReference,
css::uno::Reference< css::io::XOutputStream > &  rxOutStream,
::std::vector< OUString > const &  rHeaderNames,
DAVResource io_rResource,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual

◆ GET() [3/4]

virtual auto http_dav_ucp::CurlSession::GET ( OUString const &  inPath,
css::uno::Reference< css::io::XOutputStream > &  o,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

◆ GET() [4/4]

auto http_dav_ucp::CurlSession::GET ( OUString const &  inPath,
DAVRequestEnvironment const &  rEnv 
) -> css::uno::Reference< css::io::XInputStream >
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 1856 of file CurlSession.cxx.

References m_xContext, and SAL_INFO.

◆ HEAD()

auto http_dav_ucp::CurlSession::HEAD ( OUString const &  rURIReference,
::std::vector< OUString > const &  rHeaderNames,
DAVResource io_rResource,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual

Definition at line 1840 of file CurlSession.cxx.

References SAL_INFO.

◆ LOCK()

auto http_dav_ucp::CurlSession::LOCK ( OUString const &  inPath,
css::ucb::Lock &  inLock,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 2222 of file CurlSession.cxx.

References http_dav_ucp::CurlUri::GetURI(), m_xContext, and SAL_INFO.

◆ MKCOL()

auto http_dav_ucp::CurlSession::MKCOL ( OUString const &  inPath,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 2076 of file CurlSession.cxx.

References SAL_INFO.

◆ MOVE()

auto http_dav_ucp::CurlSession::MOVE ( OUString const &  inSource,
OUString const &  inDestination,
DAVRequestEnvironment const &  rEnv,
bool  inOverwrite = false 
) -> void
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 2129 of file CurlSession.cxx.

References SAL_INFO.

◆ NonInteractive_LOCK()

auto http_dav_ucp::CurlSession::NonInteractive_LOCK ( OUString const &  rURI,
::std::u16string_view  rLockToken,
sal_Int32 &  o_rLastChanceToSendRefreshRequest,
bool &  o_rIsAuthFailed 
) -> bool

◆ NonInteractive_UNLOCK()

auto http_dav_ucp::CurlSession::NonInteractive_UNLOCK ( OUString const &  rURI) -> void

Definition at line 2434 of file CurlSession.cxx.

References SAL_INFO.

◆ OPTIONS()

auto http_dav_ucp::CurlSession::OPTIONS ( OUString const &  rURIReference,
DAVOptions rOptions,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual

Implements http_dav_ucp::DAVSession.

Definition at line 1523 of file CurlSession.cxx.

References http_dav_ucp::CurlUri::GetURI(), result, SAL_INFO, v, and value.

◆ POST() [1/2]

virtual auto http_dav_ucp::CurlSession::POST ( OUString const &  inPath,
OUString const &  rContentType,
OUString const &  rReferer,
css::uno::Reference< css::io::XInputStream > const &  inInputStream,
css::uno::Reference< css::io::XOutputStream > &  oOutputStream,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

◆ POST() [2/2]

virtual auto http_dav_ucp::CurlSession::POST ( OUString const &  inPath,
OUString const &  rContentType,
OUString const &  rReferer,
css::uno::Reference< css::io::XInputStream > const &  inInputStream,
DAVRequestEnvironment const &  rEnv 
) -> css::uno::Reference< css::io::XInputStream >
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

◆ PROPFIND() [1/2]

auto http_dav_ucp::CurlSession::PROPFIND ( OUString const &  rURIReference,
Depth  depth,
::std::vector< DAVResourceInfo > &  o_rResourceInfos,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual

Definition at line 1740 of file CurlSession.cxx.

References SAL_INFO.

◆ PROPFIND() [2/2]

auto http_dav_ucp::CurlSession::PROPFIND ( OUString const &  rURIReference,
Depth  depth,
::std::vector< OUString > const &  rPropertyNames,
::std::vector< DAVResource > &  o_rResources,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual

Definition at line 1725 of file CurlSession.cxx.

References args, and SAL_INFO.

◆ PROPPATCH()

auto http_dav_ucp::CurlSession::PROPPATCH ( OUString const &  rURIReference,
::std::vector< ProppatchValue > const &  rValues,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual

◆ PUT()

auto http_dav_ucp::CurlSession::PUT ( OUString const &  inPath,
css::uno::Reference< css::io::XInputStream > const &  s,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 1945 of file CurlSession.cxx.

References http_dav_ucp::CurlUri::GetURI(), OUStringToOString(), and SAL_INFO.

◆ UNLOCK()

auto http_dav_ucp::CurlSession::UNLOCK ( OUString const &  inPath,
DAVRequestEnvironment const &  rEnv 
) -> void
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 2365 of file CurlSession.cxx.

References http_dav_ucp::CurlUri::GetURI(), and SAL_INFO.

◆ UsesProxy()

auto http_dav_ucp::CurlSession::UsesProxy ( ) -> bool
overridevirtual

Implements http_dav_ucp::DAVSession.

Definition at line 749 of file CurlSession.cxx.

Friends And Related Function Documentation

◆ CurlProcessor

friend struct CurlProcessor
friend

Definition at line 50 of file CurlSession.hxx.

Member Data Documentation

◆ m_AbortFlag

::std::atomic<bool> http_dav_ucp::CurlSession::m_AbortFlag = false
private

flag to signal abort to transferring thread

Definition at line 42 of file CurlSession.hxx.

◆ m_ErrorBuffer

char http_dav_ucp::CurlSession::m_ErrorBuffer[CURL_ERROR_SIZE]
private

buffer for libcurl detailed error messages

Definition at line 33 of file CurlSession.hxx.

Referenced by CurlSession().

◆ m_Flags

css::uno::Sequence<css::beans::NamedValue> const http_dav_ucp::CurlSession::m_Flags
private

flags may be passed to constructor, e.g. "KeepAlive"

Definition at line 30 of file CurlSession.hxx.

Referenced by CurlSession().

◆ m_isAuthenticated

bool http_dav_ucp::CurlSession::m_isAuthenticated = false
private

once authentication was successful, rely on m_pCurl's data

Definition at line 37 of file CurlSession.hxx.

◆ m_isAuthenticatedProxy

bool http_dav_ucp::CurlSession::m_isAuthenticatedProxy = false
private

Definition at line 38 of file CurlSession.hxx.

◆ m_Mutex

::std::mutex http_dav_ucp::CurlSession::m_Mutex
private

mutex required to access all other non-const members

Definition at line 27 of file CurlSession.hxx.

◆ m_nReadTimeout

int http_dav_ucp::CurlSession::m_nReadTimeout = 0
private

read timeout in milliseconds (connection timeout is stored in m_pCurl)

Definition at line 40 of file CurlSession.hxx.

Referenced by CurlSession().

◆ m_pCurl

::std::unique_ptr<CURL, deleter_from_fn<CURL, curl_easy_cleanup> > http_dav_ucp::CurlSession::m_pCurl
private

libcurl easy handle

Definition at line 47 of file CurlSession.hxx.

Referenced by CurlSession().

◆ m_pCurlMulti

::std::unique_ptr<CURLM, deleter_from_fn<CURLM, curl_multi_cleanup> > http_dav_ucp::CurlSession::m_pCurlMulti
private

libcurl multi handle

Definition at line 45 of file CurlSession.hxx.

Referenced by CurlSession().

◆ m_Proxy

::ucbhelper::InternetProxyServer const http_dav_ucp::CurlSession::m_Proxy
private

proxy is used if aName is non-empty

Definition at line 35 of file CurlSession.hxx.

Referenced by CurlSession().

◆ m_URI

CurlUri const http_dav_ucp::CurlSession::m_URI
private

Definition at line 31 of file CurlSession.hxx.

Referenced by CurlSession().

◆ m_xContext

css::uno::Reference<css::uno::XComponentContext> const http_dav_ucp::CurlSession::m_xContext
private

Definition at line 28 of file CurlSession.hxx.


The documentation for this class was generated from the following files: