Kaydet (Commit) b3c48feb authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

CMIS UCP: Use the URL host as ID for cached sessions

Using the binding URL as ID for the cached sessions is bad as there may
be several repositories on the same binding URL... which means different
libcmis::Session objects.

Change-Id: Id3605ee4fdfbfc32b72615fb573220e94c8748af
üst 32f7d2d6
......@@ -162,13 +162,14 @@ namespace cmis
m_sURL = m_xIdentifier->getContentIdentifier( );
cmis::URL url( m_sURL );
// Look for a cached session
m_pSession = pProvider->getSession( url.getBindingUrl( ) );
// Look for a cached session, key is binding url + repo id
INetURLObject aUrlObj( m_sURL );
m_pSession = pProvider->getSession( aUrlObj.GetHost( ) );
if ( NULL == m_pSession )
{
// Initiate a CMIS session and register it as we found nothing
m_pSession = libcmis::SessionFactory::createSession( url.getSessionParams( ) );
pProvider->registerSession( url.getBindingUrl( ), m_pSession );
pProvider->registerSession( aUrlObj.GetHost( ), m_pSession );
}
m_sObjectPath = url.getObjectPath( );
......
......@@ -88,16 +88,10 @@ ContentProvider::ContentProvider(
const uno::Reference< lang::XMultiServiceFactory >& rSMgr )
: ::ucbhelper::ContentProviderImplHelper( rSMgr )
{
#if OSL_DEBUG_LEVEL > 1
fprintf(stderr, "ContentProvider::ContentProvider( )\n" );
#endif
}
ContentProvider::~ContentProvider()
{
#if OSL_DEBUG_LEVEL > 1
fprintf(stderr, "ContentProvider::~ContentProvider( )\n" );
#endif
}
XINTERFACE_IMPL_3( ContentProvider,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment