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

#include <SerfSession.hxx>

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

Public Member Functions

 SerfSession (const rtl::Reference< DAVSessionFactory > &rSessionFactory, const OUString &inUri, const ucbhelper::InternetProxyDecider &rProxyDecider)
 
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_bucket_alloc_t * getSerfBktAlloc ()
 
serf_context_t * getSerfContext ()
 
serf_connection_t * getSerfConnection ()
 
virtual bool CanUse (const OUString &inUri) override
 
virtual bool UsesProxy () override
 
const DAVRequestEnvironmentgetRequestEnvironment () const
 
virtual void PROPFIND (const OUString &inPath, const Depth inDepth, const std::vector< OUString > &inPropNames, std::vector< DAVResource > &ioResources, const DAVRequestEnvironment &rEnv) override
 
virtual void PROPFIND (const OUString &inPath, const Depth inDepth, std::vector< DAVResourceInfo > &ioResInfo, const DAVRequestEnvironment &rEnv) override
 
virtual void PROPPATCH (const OUString &inPath, const std::vector< ProppatchValue > &inValues, const DAVRequestEnvironment &rEnv) override
 
virtual void HEAD (const OUString &inPath, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv) override
 
bool isHeadRequestInProgress ()
 
virtual css::uno::Reference< css::io::XInputStream > GET (const OUString &inPath, const DAVRequestEnvironment &rEnv) override
 
virtual void GET (const OUString &inPath, css::uno::Reference< css::io::XOutputStream > &ioOutputStream, const DAVRequestEnvironment &rEnv) override
 
virtual css::uno::Reference< css::io::XInputStream > GET (const OUString &inPath, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv) override
 
virtual void GET (const OUString &inPath, css::uno::Reference< css::io::XOutputStream > &ioOutputStream, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv) override
 
virtual void PUT (const OUString &inPath, const css::uno::Reference< css::io::XInputStream > &inInputStream, const DAVRequestEnvironment &rEnv) override
 
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) override
 
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) override
 
virtual void MKCOL (const OUString &inPath, const DAVRequestEnvironment &rEnv) override
 
virtual void COPY (const OUString &inSourceURL, const OUString &inDestinationURL, const DAVRequestEnvironment &rEnv, bool inOverWrite=false) override
 
virtual void MOVE (const OUString &inSourceURL, const OUString &inDestinationURL, const DAVRequestEnvironment &rEnv, bool inOverWrite=false) override
 
virtual void DESTROY (const OUString &inPath, const DAVRequestEnvironment &rEnv) override
 
virtual void LOCK (const OUString &inURL, css::ucb::Lock &inLock, const DAVRequestEnvironment &rEnv) override
 
virtual sal_Int64 LOCK (const OUString &inURL, sal_Int64 nTimeout, const DAVRequestEnvironment &rEnv) override
 
virtual void UNLOCK (const OUString &inURL, const DAVRequestEnvironment &rEnv) override
 
virtual void abort () override
 
const OUString & getHostName () const
 
int getPort () const
 
bool isDomainMatch (const OUString &certHostName)
 
- Public Member Functions inherited from http_dav_ucp::DAVSession
void acquire ()
 
void release ()
 

Static Public Member Functions

static apr_pool_t * getAprPool ()
 

Protected Member Functions

virtual ~SerfSession () override
 
- Protected Member Functions inherited from http_dav_ucp::DAVSession
 DAVSession (rtl::Reference< DAVSessionFactory > const &rFactory)
 
virtual ~DAVSession ()
 

Private Member Functions

char * getHostinfo ()
 
bool isSSLNeeded ()
 
SerfRequestProcessorcreateReqProc (const OUString &inPath)
 
void Init ()
 
void Init (const DAVRequestEnvironment &rEnv)
 
void HandleError (std::shared_ptr< SerfRequestProcessor > rReqProc)
 
ucbhelper::InternetProxyServer getProxySettings () const
 
bool LOCK (const OUString &rLock, sal_Int32 *plastChanceToSendRefreshRequest)
 
void UNLOCK (const OUString &rLock)
 

Static Private Member Functions

static bool removeExpiredLocktoken (const OUString &inURL, const DAVRequestEnvironment &rEnv)
 
static bool getDataFromInputStream (const css::uno::Reference< css::io::XInputStream > &xStream, css::uno::Sequence< sal_Int8 > &rData, bool bAppendTrailingZeroByte)
 

Private Attributes

osl::Mutex m_aMutex
 
SerfUri m_aUri
 
OUString m_aProxyName
 
sal_Int32 m_nProxyPort
 
serf_connection_t * m_pSerfConnection
 
serf_context_t * m_pSerfContext
 
serf_bucket_alloc_t * m_pSerfBucket_Alloc
 
bool m_bIsHeadRequestInProgress
 
bool m_bUseChunkedEncoding
 
sal_Int16 m_bNoOfTransferEncodingSwitches
 
const ucbhelper::InternetProxyDeciderm_rProxyDecider
 
DAVRequestEnvironment m_aEnv
 

Friends

class SerfLockStore
 

Additional Inherited Members

- Protected Attributes inherited from http_dav_ucp::DAVSession
rtl::Reference< DAVSessionFactorym_xFactory
 

Detailed Description

Definition at line 44 of file SerfSession.hxx.

Constructor & Destructor Documentation

SerfSession::~SerfSession ( )
overrideprotectedvirtual

Definition at line 84 of file SerfSession.cxx.

References m_pSerfConnection.

SerfSession::SerfSession ( const rtl::Reference< DAVSessionFactory > &  rSessionFactory,
const OUString &  inUri,
const ucbhelper::InternetProxyDecider rProxyDecider 
)
Exceptions
DAVException

Definition at line 59 of file SerfSession.cxx.

References getAprPool(), m_aMutex, m_pSerfBucket_Alloc, and m_pSerfContext.

Member Function Documentation

void SerfSession::abort ( )
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 1111 of file SerfSession.cxx.

serf_bucket_t * SerfSession::acceptSerfResponse ( serf_request_t *  inSerfRequest,
serf_bucket_t *  inSerfStreamBucket,
apr_pool_t *  inAprPool 
)
bool SerfSession::CanUse ( const OUString &  inUri)
overridevirtual
void SerfSession::COPY ( const OUString &  inSource,
const OUString &  inDestination,
const DAVRequestEnvironment rEnv,
bool  inOverwrite = false 
)
overridevirtual
SerfRequestProcessor * SerfSession::createReqProc ( const OUString &  inPath)
private

Definition at line 584 of file SerfSession.cxx.

References m_bUseChunkedEncoding.

Referenced by COPY(), DESTROY(), GET(), HEAD(), LOCK(), MKCOL(), MOVE(), PROPFIND(), PROPPATCH(), PUT(), and UNLOCK().

void SerfSession::DESTROY ( const OUString &  inPath,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 938 of file SerfSession.cxx.

References createReqProc(), HandleError(), Init(), and m_aMutex.

uno::Reference< io::XInputStream > SerfSession::GET ( const OUString &  inPath,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 699 of file SerfSession.cxx.

References createReqProc(), HandleError(), Init(), and m_aMutex.

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

Implements http_dav_ucp::DAVSession.

uno::Reference< io::XInputStream > SerfSession::GET ( const OUString &  inPath,
const std::vector< OUString > &  inHeaderNames,
DAVResource ioResource,
const DAVRequestEnvironment rEnv 
)
overridevirtual
virtual void http_dav_ucp::SerfSession::GET ( const OUString &  inPath,
css::uno::Reference< css::io::XOutputStream > &  o,
const std::vector< OUString > &  inHeaderNames,
DAVResource ioResource,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

apr_pool_t * SerfSession::getAprPool ( )
static
bool SerfSession::getDataFromInputStream ( const css::uno::Reference< css::io::XInputStream > &  xStream,
css::uno::Sequence< sal_Int8 > &  rData,
bool  bAppendTrailingZeroByte 
)
staticprivate

Definition at line 1349 of file SerfSession.cxx.

References nPos.

Referenced by PUT().

char * SerfSession::getHostinfo ( )
private

Definition at line 209 of file SerfSession.cxx.

References http_dav_ucp::SerfUri::getAprUri(), and m_aUri.

Referenced by setupSerfConnection().

const OUString& http_dav_ucp::SerfSession::getHostName ( ) const
inline
int http_dav_ucp::SerfSession::getPort ( ) const
inline
ucbhelper::InternetProxyServer SerfSession::getProxySettings ( ) const
private
const DAVRequestEnvironment& http_dav_ucp::SerfSession::getRequestEnvironment ( ) const
inline
serf_bucket_alloc_t * SerfSession::getSerfBktAlloc ( )

Definition at line 184 of file SerfSession.cxx.

References m_pSerfBucket_Alloc.

Referenced by setupSerfConnection().

serf_connection_t * SerfSession::getSerfConnection ( )

Definition at line 194 of file SerfSession.cxx.

References m_pSerfConnection.

Referenced by HandleError(), and http_dav_ucp::SerfRequestProcessor::runProcessor().

serf_context_t * SerfSession::getSerfContext ( )
void SerfSession::HandleError ( std::shared_ptr< SerfRequestProcessor rReqProc)
private
void SerfSession::HEAD ( const OUString &  inPath,
const std::vector< OUString > &  inHeaderNames,
DAVResource ioResource,
const DAVRequestEnvironment rEnv 
)
overridevirtual
void SerfSession::Init ( void  )
private
void SerfSession::Init ( const DAVRequestEnvironment rEnv)
private
Exceptions
DAVException

Definition at line 94 of file SerfSession.cxx.

References Init(), m_aEnv, and m_aMutex.

bool SerfSession::isDomainMatch ( const OUString &  certHostName)

Definition at line 1436 of file SerfSession.cxx.

References getHostName().

Referenced by verifySerfCertificateChain().

bool SerfSession::isHeadRequestInProgress ( )
bool SerfSession::isSSLNeeded ( )
private

Definition at line 204 of file SerfSession.cxx.

References http_dav_ucp::SerfUri::GetScheme(), and m_aUri.

Referenced by Init(), and setupSerfConnection().

virtual void http_dav_ucp::SerfSession::LOCK ( const OUString &  inPath,
css::ucb::Lock &  inLock,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

sal_Int64 SerfSession::LOCK ( const OUString &  inPath,
sal_Int64  nTimeout,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 1003 of file SerfSession.cxx.

References m_aMutex.

bool SerfSession::LOCK ( const OUString &  rLock,
sal_Int32 *  plastChanceToSendRefreshRequest 
)
private

Definition at line 1043 of file SerfSession.cxx.

References createReqProc(), HandleError(), m_aMutex, and SAL_INFO.

void SerfSession::MKCOL ( const OUString &  inPath,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 881 of file SerfSession.cxx.

References createReqProc(), HandleError(), Init(), and m_aMutex.

void SerfSession::MOVE ( const OUString &  inSource,
const OUString &  inDestination,
const DAVRequestEnvironment rEnv,
bool  inOverwrite = false 
)
overridevirtual
virtual css::uno::Reference< css::io::XInputStream > http_dav_ucp::SerfSession::POST ( const OUString &  inPath,
const OUString &  rContentType,
const OUString &  rReferer,
const css::uno::Reference< css::io::XInputStream > &  inInputStream,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

virtual void http_dav_ucp::SerfSession::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 
)
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

void SerfSession::PROPFIND ( const OUString &  inPath,
const Depth  inDepth,
const std::vector< OUString > &  inPropertyNames,
std::vector< DAVResource > &  ioResources,
const DAVRequestEnvironment rEnv 
)
overridevirtual
void SerfSession::PROPFIND ( const OUString &  inPath,
const Depth  inDepth,
std::vector< DAVResourceInfo > &  ioResInfo,
const DAVRequestEnvironment rEnv 
)
overridevirtual
void SerfSession::PROPPATCH ( const OUString &  inPath,
const std::vector< ProppatchValue > &  inValues,
const DAVRequestEnvironment rEnv 
)
overridevirtual
Exceptions
DAVException

Implements http_dav_ucp::DAVSession.

Definition at line 652 of file SerfSession.cxx.

References createReqProc(), HandleError(), Init(), and m_aMutex.

apr_status_t SerfSession::provideSerfCredentials ( bool  bGiveProvidedCredentialsASecondTry,
char **  outUsername,
char **  outPassword,
serf_request_t *  inRequest,
int  inCode,
const char *  inAuthProtocol,
const char *  inRealm,
apr_pool_t *  inAprPool 
)
void SerfSession::PUT ( const OUString &  inPath,
const css::uno::Reference< css::io::XInputStream > &  s,
const DAVRequestEnvironment rEnv 
)
overridevirtual
bool SerfSession::removeExpiredLocktoken ( const OUString &  inURL,
const DAVRequestEnvironment rEnv 
)
staticprivate

Definition at line 1163 of file SerfSession.cxx.

apr_status_t SerfSession::setupSerfConnection ( apr_socket_t *  inAprSocket,
serf_bucket_t **  outSerfInputBucket,
serf_bucket_t **  outSerfOutputBucket,
apr_pool_t *  inAprPool 
)

Set the callback that is called to authenticate the certificate (chain).

Definition at line 243 of file SerfSession.cxx.

References getHostinfo(), getSerfBktAlloc(), getSerfContext(), isSSLNeeded(), and Serf_CertificateChainValidation().

Referenced by Serf_ConnectSetup().

void SerfSession::UNLOCK ( const OUString &  inPath,
const DAVRequestEnvironment rEnv 
)
overridevirtual
void SerfSession::UNLOCK ( const OUString &  rLock)
private

Definition at line 1092 of file SerfSession.cxx.

References createReqProc(), HandleError(), m_aMutex, and SAL_INFO.

bool SerfSession::UsesProxy ( )
overridevirtual

Implements http_dav_ucp::DAVSession.

Definition at line 237 of file SerfSession.cxx.

References Init(), and m_aProxyName.

apr_status_t SerfSession::verifySerfCertificateChain ( int  nFailures,
const serf_ssl_certificate_t *const *  pCertificateChainBase64Encoded,
int  nCertificateChainLength 
)

Friends And Related Function Documentation

friend class SerfLockStore
friend

Definition at line 228 of file SerfSession.hxx.

Member Data Documentation

DAVRequestEnvironment http_dav_ucp::SerfSession::m_aEnv
private

Definition at line 63 of file SerfSession.hxx.

Referenced by getRequestEnvironment(), HandleError(), Init(), and PROPFIND().

osl::Mutex http_dav_ucp::SerfSession::m_aMutex
private

Definition at line 47 of file SerfSession.hxx.

Referenced by COPY(), DESTROY(), GET(), HEAD(), Init(), LOCK(), MKCOL(), MOVE(), PROPFIND(), PROPPATCH(), PUT(), and UNLOCK().

OUString http_dav_ucp::SerfSession::m_aProxyName
private

Definition at line 51 of file SerfSession.hxx.

Referenced by Init(), and UsesProxy().

SerfUri http_dav_ucp::SerfSession::m_aUri
private

Definition at line 49 of file SerfSession.hxx.

Referenced by CanUse(), getHostinfo(), getProxySettings(), Init(), and isSSLNeeded().

bool http_dav_ucp::SerfSession::m_bIsHeadRequestInProgress
private

Definition at line 57 of file SerfSession.hxx.

Referenced by HEAD(), and isHeadRequestInProgress().

sal_Int16 http_dav_ucp::SerfSession::m_bNoOfTransferEncodingSwitches
private

Definition at line 59 of file SerfSession.hxx.

Referenced by HandleError().

bool http_dav_ucp::SerfSession::m_bUseChunkedEncoding
private

Definition at line 58 of file SerfSession.hxx.

Referenced by createReqProc(), HandleError(), and Init().

sal_Int32 http_dav_ucp::SerfSession::m_nProxyPort
private

Definition at line 52 of file SerfSession.hxx.

Referenced by Init().

serf_bucket_alloc_t* http_dav_ucp::SerfSession::m_pSerfBucket_Alloc
private

Definition at line 56 of file SerfSession.hxx.

Referenced by getSerfBktAlloc(), and SerfSession().

serf_connection_t* http_dav_ucp::SerfSession::m_pSerfConnection
private

Definition at line 54 of file SerfSession.hxx.

Referenced by getSerfConnection(), Init(), and ~SerfSession().

serf_context_t* http_dav_ucp::SerfSession::m_pSerfContext
private

Definition at line 55 of file SerfSession.hxx.

Referenced by getSerfContext(), Init(), and SerfSession().

const ucbhelper::InternetProxyDecider& http_dav_ucp::SerfSession::m_rProxyDecider
private

Definition at line 61 of file SerfSession.hxx.

Referenced by getProxySettings().


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