diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-01-24 14:19:02 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-01-24 14:20:09 +0100 |
commit | 7744ed922e0e22c7cdb8fbc7ecd685ecccc68dca (patch) | |
tree | b6d5a71b7cc891d0e5bbe008e079985413fde858 /ucb | |
parent | 04f21f9ad6c4b5be606f3c62fd10b3f1c2df283a (diff) |
CMIS: use the proxy settings from the options
Change-Id: I5b856ac166b67097e1921ec71eb5b7e1819fec41
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 9 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_repo_content.cxx | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 6757694bf6c5..a8b1c8643c59 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -60,6 +60,7 @@ #include <ucbhelper/std_inputstream.hxx> #include <ucbhelper/std_outputstream.hxx> #include <ucbhelper/propertyvalueset.hxx> +#include <ucbhelper/proxydecider.hxx> #include "auth_provider.hxx" #include "cmis_content.hxx" @@ -256,6 +257,14 @@ namespace cmis libcmis::Session* Content::getSession( const uno::Reference< ucb::XCommandEnvironment >& xEnv ) { + // Set the proxy if needed. We are doing that all times as the proxy data shouldn't be cached. + ucbhelper::InternetProxyDecider aProxyDecider( m_xContext ); + INetURLObject aBindingUrl( m_aURL.getBindingUrl( ) ); + const ucbhelper::InternetProxyServer& rProxy = aProxyDecider.getProxy( + INetURLObject::GetScheme( aBindingUrl.GetProtocol( ) ), aBindingUrl.GetHost(), aBindingUrl.GetPort() ); + rtl::OUString sProxy = rProxy.aName + ":" + rtl::OUString::valueOf( rProxy.nPort ); + libcmis::SessionFactory::setProxySettings( OUSTR_TO_STDSTR( sProxy ), string(), string(), string() ); + // Look for a cached session, key is binding url + repo id rtl::OUString sSessionId = m_aURL.getBindingUrl( ) + m_aURL.getRepositoryId( ); if ( NULL == m_pSession ) diff --git a/ucb/source/ucp/cmis/cmis_repo_content.cxx b/ucb/source/ucp/cmis/cmis_repo_content.cxx index c37d5903e860..afd503c2e011 100644 --- a/ucb/source/ucp/cmis/cmis_repo_content.cxx +++ b/ucb/source/ucp/cmis/cmis_repo_content.cxx @@ -41,6 +41,7 @@ #include <ucbhelper/commandenvironment.hxx> #include <ucbhelper/contentidentifier.hxx> #include <ucbhelper/propertyvalueset.hxx> +#include <ucbhelper/proxydecider.hxx> #include "auth_provider.hxx" #include "cmis_content.hxx" @@ -138,6 +139,14 @@ namespace cmis void RepoContent::getRepositories( const uno::Reference< ucb::XCommandEnvironment > & xEnv ) { + // Set the proxy if needed. We are doing that all times as the proxy data shouldn't be cached. + ucbhelper::InternetProxyDecider aProxyDecider( m_xContext ); + INetURLObject aBindingUrl( m_aURL.getBindingUrl( ) ); + const ucbhelper::InternetProxyServer& rProxy = aProxyDecider.getProxy( + INetURLObject::GetScheme( aBindingUrl.GetProtocol( ) ), aBindingUrl.GetHost(), aBindingUrl.GetPort() ); + rtl::OUString sProxy = rProxy.aName + ":" + rtl::OUString::valueOf( rProxy.nPort ); + libcmis::SessionFactory::setProxySettings( OUSTR_TO_STDSTR( sProxy ), string(), string(), string() ); + if ( m_aRepositories.empty() ) { // Get the auth credentials |