Add/change some logs in WebDAV ucb.ucp layer.
At the same time replace old OSL_TRACE, OSL_FAIL, OSL_ENSURE with SAL_* as appropriate: OSL_TRACE =--> SAL_LOG or =--> SAL_WARN if requires some kind of attention by the developer. OSL_FAIL =--> SAL_WARN or =--> SAL_INFO if the warning is brought up later in the program flow. OSL_ENSURE =--> assert oe SAL_WARN_IF when appropriate. Change-Id: I1cf8f76acdec6f37746488b22cbf579802a9d79d Reviewed-on: https://gerrit.libreoffice.org/20034 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
committed by
Stephan Bergmann
parent
cc30af5b89
commit
dd9c15b36f
@@ -94,8 +94,7 @@ ContentProperties::ContentProperties( const DAVResource& rResource )
|
|||||||
: m_xProps( new PropertyValueMap ),
|
: m_xProps( new PropertyValueMap ),
|
||||||
m_bTrailingSlash( false )
|
m_bTrailingSlash( false )
|
||||||
{
|
{
|
||||||
OSL_ENSURE( !rResource.uri.isEmpty(),
|
assert( !rResource.uri.isEmpty() && "ContentProperties ctor - Empty resource URI!" );
|
||||||
"ContentProperties ctor - Empty resource URI!" );
|
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
try
|
try
|
||||||
|
@@ -1100,8 +1100,7 @@ void DAVResourceAccess::initialize()
|
|||||||
|
|
||||||
const OUString & DAVResourceAccess::getRequestURI() const
|
const OUString & DAVResourceAccess::getRequestURI() const
|
||||||
{
|
{
|
||||||
OSL_ENSURE( m_xSession.is(),
|
assert( m_xSession.is() && "DAVResourceAccess::getRequestURI - Not initialized!" );
|
||||||
"DAVResourceAccess::getRequestURI - Not initialized!" );
|
|
||||||
|
|
||||||
// In case a proxy is used we have to use the absolute URI for a request.
|
// In case a proxy is used we have to use the absolute URI for a request.
|
||||||
if ( m_xSession->UsesProxy() )
|
if ( m_xSession->UsesProxy() )
|
||||||
|
@@ -161,7 +161,7 @@ extern "C" int LockSequence_chardata_callback(
|
|||||||
pCtx->hasDepth = true;
|
pCtx->hasDepth = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
OSL_FAIL( "LockSequence_chardata_callback - Unknown depth!" );
|
SAL_WARN( "ucb.ucp.webdav", "LockSequence_chardata_callback - Unknown depth!" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_OWNER:
|
case STATE_OWNER:
|
||||||
@@ -185,6 +185,10 @@ extern "C" int LockSequence_chardata_callback(
|
|||||||
// field-content = <the OCTETs making up the field-value
|
// field-content = <the OCTETs making up the field-value
|
||||||
// and consisting of either *TEXT or combinations
|
// and consisting of either *TEXT or combinations
|
||||||
// of token, separators, and quoted-string>
|
// of token, separators, and quoted-string>
|
||||||
|
//
|
||||||
|
// RFC4918, <http://tools.ietf.org/html/rfc4918#section-10.7>
|
||||||
|
// "The timeout value for TimeType "Second" MUST
|
||||||
|
// NOT be greater than 2^32-1."
|
||||||
|
|
||||||
if ( rtl_str_compareIgnoreAsciiCase_WithLength(
|
if ( rtl_str_compareIgnoreAsciiCase_WithLength(
|
||||||
buf, len, "Infinite", 8 ) == 0 )
|
buf, len, "Infinite", 8 ) == 0 )
|
||||||
@@ -208,7 +212,7 @@ extern "C" int LockSequence_chardata_callback(
|
|||||||
{
|
{
|
||||||
pCtx->pLock->Timeout = sal_Int64( -1 );
|
pCtx->pLock->Timeout = sal_Int64( -1 );
|
||||||
pCtx->hasTimeout = true;
|
pCtx->hasTimeout = true;
|
||||||
OSL_FAIL( "LockSequence_chardata_callback - Unknown timeout!" );
|
SAL_WARN( "ucb.ucp.webdav", "LockSequence_chardata_callback - Unknown timeout!" );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -44,11 +44,30 @@ void process_headers( ne_request * req,
|
|||||||
void * cursor = nullptr;
|
void * cursor = nullptr;
|
||||||
const char * name, *value;
|
const char * name, *value;
|
||||||
|
|
||||||
|
#if defined SAL_LOG_INFO
|
||||||
|
{
|
||||||
|
if( !rHeaderNames.empty() )
|
||||||
|
{
|
||||||
|
std::vector< OUString >::const_iterator it(
|
||||||
|
rHeaderNames.begin() );
|
||||||
|
const std::vector< OUString >::const_iterator end(
|
||||||
|
rHeaderNames.end() );
|
||||||
|
|
||||||
|
while ( it != end )
|
||||||
|
{
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "HEAD - requested header: " << (*it) );
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
while ( ( cursor = ne_response_header_iterate( req, cursor,
|
while ( ( cursor = ne_response_header_iterate( req, cursor,
|
||||||
&name, &value ) ) != nullptr ) {
|
&name, &value ) ) != nullptr ) {
|
||||||
OUString aHeaderName( OUString::createFromAscii( name ) );
|
OUString aHeaderName( OUString::createFromAscii( name ) );
|
||||||
OUString aHeaderValue( OUString::createFromAscii( value ) );
|
OUString aHeaderValue( OUString::createFromAscii( value ) );
|
||||||
|
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "HEAD - received header: " << aHeaderName << ":" << aHeaderValue);
|
||||||
|
|
||||||
// Note: Empty vector means that all headers are requested.
|
// Note: Empty vector means that all headers are requested.
|
||||||
bool bIncludeIt = ( rHeaderNames.empty() );
|
bool bIncludeIt = ( rHeaderNames.empty() );
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ private:
|
|||||||
|
|
||||||
void TickerThread::execute()
|
void TickerThread::execute()
|
||||||
{
|
{
|
||||||
OSL_TRACE( "TickerThread: start." );
|
SAL_INFO( "ucb.ucp.webdav", "TickerThread: start." );
|
||||||
|
|
||||||
// we have to go through the loop more often to be able to finish ~quickly
|
// we have to go through the loop more often to be able to finish ~quickly
|
||||||
const int nNth = 25;
|
const int nNth = 25;
|
||||||
@@ -84,13 +84,24 @@ void TickerThread::execute()
|
|||||||
salhelper::Thread::wait( aTV );
|
salhelper::Thread::wait( aTV );
|
||||||
}
|
}
|
||||||
|
|
||||||
OSL_TRACE( "TickerThread: stop." );
|
SAL_INFO( "ucb.ucp.webdav", "TickerThread: stop." );
|
||||||
}
|
}
|
||||||
|
|
||||||
NeonLockStore::NeonLockStore()
|
NeonLockStore::NeonLockStore()
|
||||||
: m_pNeonLockStore( ne_lockstore_create() )
|
: m_pNeonLockStore( ne_lockstore_create() )
|
||||||
{
|
{
|
||||||
OSL_ENSURE( m_pNeonLockStore, "Unable to create neon lock store!" );
|
/*
|
||||||
|
* ne_lockstore_create() never returns a NULL; neon calls abort() in case of an out-of-memory
|
||||||
|
* situation.
|
||||||
|
* Please see:
|
||||||
|
* <http://www.webdav.org/neon/doc/html/refneon.html>
|
||||||
|
* topic title "Memory handling", copied here verbatim:
|
||||||
|
*
|
||||||
|
* "neon does not attempt to cope gracefully with an out-of-memory situation;
|
||||||
|
* instead, by default, the abort function is called to immediately terminate
|
||||||
|
* the process. An application may register a custom function which will be
|
||||||
|
* called before abort in such a situation; see ne_oom_callback."
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
NeonLockStore::~NeonLockStore()
|
NeonLockStore::~NeonLockStore()
|
||||||
@@ -100,8 +111,7 @@ NeonLockStore::~NeonLockStore()
|
|||||||
aGuard.reset(); // actually no threads should even try to access members now
|
aGuard.reset(); // actually no threads should even try to access members now
|
||||||
|
|
||||||
// release active locks, if any.
|
// release active locks, if any.
|
||||||
OSL_ENSURE( m_aLockInfoMap.empty(),
|
SAL_WARN_IF( !m_aLockInfoMap.empty(), "ucb.ucp.webdav", "NeonLockStore::~NeonLockStore - Releasing active locks!" );
|
||||||
"NeonLockStore::~NeonLockStore - Releasing active locks!" );
|
|
||||||
|
|
||||||
LockInfoMap::const_iterator it( m_aLockInfoMap.begin() );
|
LockInfoMap::const_iterator it( m_aLockInfoMap.begin() );
|
||||||
const LockInfoMap::const_iterator end( m_aLockInfoMap.end() );
|
const LockInfoMap::const_iterator end( m_aLockInfoMap.end() );
|
||||||
|
@@ -109,7 +109,7 @@ extern "C" int NPFR_propfind_iter( void* userdata,
|
|||||||
DAVPropertyValue thePropertyValue;
|
DAVPropertyValue thePropertyValue;
|
||||||
thePropertyValue.IsCaseSensitive = true;
|
thePropertyValue.IsCaseSensitive = true;
|
||||||
|
|
||||||
OSL_ENSURE( pname->nspace, "NPFR_propfind_iter - No namespace!" );
|
assert( pname->nspace && "NPFR_propfind_iter - No namespace!" );
|
||||||
|
|
||||||
DAVProperties::createUCBPropName( pname->nspace,
|
DAVProperties::createUCBPropName( pname->nspace,
|
||||||
pname->name,
|
pname->name,
|
||||||
@@ -121,8 +121,8 @@ extern "C" int NPFR_propfind_iter( void* userdata,
|
|||||||
if ( UCBDeadPropertyValue::createFromXML(
|
if ( UCBDeadPropertyValue::createFromXML(
|
||||||
value, thePropertyValue.Value ) )
|
value, thePropertyValue.Value ) )
|
||||||
{
|
{
|
||||||
OSL_ENSURE( thePropertyValue.Value.hasValue(),
|
SAL_WARN_IF( !thePropertyValue.Value.hasValue(),
|
||||||
"NPFR_propfind_iter - No value!" );
|
"ucb.ucp.webdav", "NPFR_propfind_iter - No value for UCBDeadProperty!" );
|
||||||
bHasValue = true;
|
bHasValue = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -123,15 +123,14 @@ static sal_uInt16 makeStatusCode( const OUString & rStatusText )
|
|||||||
|
|
||||||
if ( rStatusText.getLength() < 3 )
|
if ( rStatusText.getLength() < 3 )
|
||||||
{
|
{
|
||||||
OSL_FAIL(
|
SAL_WARN( "ucb.ucp.webdav", "makeStatusCode - status text string to short!" );
|
||||||
"makeStatusCode - status text string to short!" );
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Int32 nPos = rStatusText.indexOf( ' ' );
|
sal_Int32 nPos = rStatusText.indexOf( ' ' );
|
||||||
if ( nPos == -1 )
|
if ( nPos == -1 )
|
||||||
{
|
{
|
||||||
OSL_FAIL( "makeStatusCode - wrong status text format!" );
|
SAL_WARN( "ucb.ucp.webdav", "makeStatusCode - wrong status text format!" );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,8 +315,7 @@ extern "C" int NeonSession_NeonAuth( void * inUserData,
|
|||||||
OUStringToOString( theUserName, RTL_TEXTENCODING_UTF8 ) );
|
OUStringToOString( theUserName, RTL_TEXTENCODING_UTF8 ) );
|
||||||
if ( aUser.getLength() > ( NE_ABUFSIZ - 1 ) )
|
if ( aUser.getLength() > ( NE_ABUFSIZ - 1 ) )
|
||||||
{
|
{
|
||||||
OSL_FAIL(
|
SAL_WARN( "ucb.ucp.webdav", "NeonSession_NeonAuth - username too long!" );
|
||||||
"NeonSession_NeonAuth - username to long!" );
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,8 +323,7 @@ extern "C" int NeonSession_NeonAuth( void * inUserData,
|
|||||||
OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ) );
|
OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ) );
|
||||||
if ( aPass.getLength() > ( NE_ABUFSIZ - 1 ) )
|
if ( aPass.getLength() > ( NE_ABUFSIZ - 1 ) )
|
||||||
{
|
{
|
||||||
OSL_FAIL(
|
SAL_WARN( "ucb.ucp.webdav", "NeonSession_NeonAuth - password too long!" );
|
||||||
"NeonSession_NeonAuth - password to long!" );
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -599,6 +596,7 @@ NeonSession::NeonSession( const rtl::Reference< DAVSessionFactory > & rSessionFa
|
|||||||
m_aScheme = theUri.GetScheme();
|
m_aScheme = theUri.GetScheme();
|
||||||
m_aHostName = theUri.GetHost();
|
m_aHostName = theUri.GetHost();
|
||||||
m_nPort = theUri.GetPort();
|
m_nPort = theUri.GetPort();
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "NeonSession ctor - URL < " << inUri << ">" );
|
||||||
}
|
}
|
||||||
|
|
||||||
NeonSession::~NeonSession( )
|
NeonSession::~NeonSession( )
|
||||||
@@ -827,22 +825,20 @@ void NeonSession::PROPFIND( const OUString & inPath,
|
|||||||
const DAVRequestEnvironment & rEnv )
|
const DAVRequestEnvironment & rEnv )
|
||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
#if defined SAL_LOG_INFO
|
|
||||||
{ //debug
|
|
||||||
SAL_INFO( "ucb.ucp.webdav", "PROPFIND - inPath: <" << inPath << "> inDepth: " << inDepth );
|
|
||||||
OUString aProps;
|
|
||||||
for(std::vector< OUString >::const_iterator it = inPropNames.begin();
|
|
||||||
it < inPropNames.end(); ++it)
|
|
||||||
{
|
|
||||||
aProps += *it;
|
|
||||||
aProps += ", ";
|
|
||||||
}
|
|
||||||
SAL_INFO( "ucb.ucp.webdav", " properties: " << aProps);
|
|
||||||
} //debug
|
|
||||||
#endif
|
|
||||||
|
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
|
||||||
|
#if defined SAL_LOG_INFO
|
||||||
|
{ //debug
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "PROPFIND - relative URL: <" << inPath << "> Depth: " << inDepth );
|
||||||
|
for(std::vector< OUString >::const_iterator it = inPropNames.begin();
|
||||||
|
it < inPropNames.end(); ++it)
|
||||||
|
{
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "PROFIND - property requested: " << *it );
|
||||||
|
}
|
||||||
|
} //debug
|
||||||
|
#endif
|
||||||
|
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
int theRetVal = NE_OK;
|
int theRetVal = NE_OK;
|
||||||
@@ -863,9 +859,8 @@ void NeonSession::PROPFIND( const OUString & inPath,
|
|||||||
const DAVRequestEnvironment & rEnv )
|
const DAVRequestEnvironment & rEnv )
|
||||||
throw( std::exception )
|
throw( std::exception )
|
||||||
{
|
{
|
||||||
SAL_INFO( "ucb.ucp.webdav", "PROPFIND - inPath: <" << inPath << "> inDepth: " << inDepth );
|
|
||||||
|
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "PROPFIND - relative URL: <" << inPath << "> Depth: " << inDepth );
|
||||||
|
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
@@ -882,14 +877,11 @@ void NeonSession::PROPFIND( const OUString & inPath,
|
|||||||
for ( std::vector< DAVResourceInfo >::const_iterator itres = ioResInfo.begin();
|
for ( std::vector< DAVResourceInfo >::const_iterator itres = ioResInfo.begin();
|
||||||
itres < ioResInfo.end(); ++itres)
|
itres < ioResInfo.end(); ++itres)
|
||||||
{
|
{
|
||||||
OUString aProps;
|
|
||||||
for ( std::vector< OUString >::const_iterator it = (*itres).properties.begin();
|
for ( std::vector< OUString >::const_iterator it = (*itres).properties.begin();
|
||||||
it < (*itres).properties.end(); ++it)
|
it < (*itres).properties.end(); ++it)
|
||||||
{
|
{
|
||||||
aProps += *it;
|
SAL_INFO( "ucb.ucp.webdav", "PROPFIND - returned property (name only): " << *it );
|
||||||
aProps += ", ";
|
|
||||||
}
|
}
|
||||||
SAL_INFO( "ucb.ucp.webdav", " returned property names: " << aProps);
|
|
||||||
}
|
}
|
||||||
} //debug
|
} //debug
|
||||||
#endif
|
#endif
|
||||||
@@ -902,6 +894,8 @@ void NeonSession::PROPPATCH( const OUString & inPath,
|
|||||||
const DAVRequestEnvironment & rEnv )
|
const DAVRequestEnvironment & rEnv )
|
||||||
throw( std::exception )
|
throw( std::exception )
|
||||||
{
|
{
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "PROPPATCH - relative URL <" << inPath << ">" );
|
||||||
|
|
||||||
/* @@@ Which standard live properties can be set by the client?
|
/* @@@ Which standard live properties can be set by the client?
|
||||||
This is a known WebDAV RFC issue ( verified: 04/10/2001 )
|
This is a known WebDAV RFC issue ( verified: 04/10/2001 )
|
||||||
--> http://www.ics.uci.edu/pub/ietf/webdav/protocol/issues.html
|
--> http://www.ics.uci.edu/pub/ietf/webdav/protocol/issues.html
|
||||||
@@ -980,7 +974,7 @@ void NeonSession::PROPPATCH( const OUString & inPath,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_FAIL( "NeonSession::PROPPATCH - unsupported type!" );
|
SAL_WARN( "ucb.ucp.webdav", "PROPPATCH - Unsupported type!" );
|
||||||
// Error!
|
// Error!
|
||||||
pItems[ n ].value = nullptr;
|
pItems[ n ].value = nullptr;
|
||||||
theRetVal = NE_ERROR;
|
theRetVal = NE_ERROR;
|
||||||
@@ -1032,6 +1026,7 @@ void NeonSession::HEAD( const OUString & inPath,
|
|||||||
throw( std::exception )
|
throw( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "HEAD - relative URL <" << inPath << ">" );
|
||||||
|
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
@@ -1051,6 +1046,7 @@ NeonSession::GET( const OUString & inPath,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "GET - relative URL <" << inPath << ">" );
|
||||||
|
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
@@ -1074,6 +1070,7 @@ void NeonSession::GET( const OUString & inPath,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "GET - relative URL <" << inPath << ">" );
|
||||||
|
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
@@ -1096,6 +1093,7 @@ NeonSession::GET( const OUString & inPath,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "GET - relative URL <" << inPath << ">" );
|
||||||
|
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
@@ -1124,6 +1122,7 @@ void NeonSession::GET( const OUString & inPath,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "GET - relative URL <" << inPath << ">" );
|
||||||
|
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
@@ -1147,6 +1146,7 @@ void NeonSession::PUT( const OUString & inPath,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "PUT - relative URL <" << inPath << ">" );
|
||||||
|
|
||||||
uno::Sequence< sal_Int8 > aDataToSend;
|
uno::Sequence< sal_Int8 > aDataToSend;
|
||||||
if ( !getDataFromInputStream( inInputStream, aDataToSend, false ) )
|
if ( !getDataFromInputStream( inInputStream, aDataToSend, false ) )
|
||||||
@@ -1173,6 +1173,7 @@ NeonSession::POST( const OUString & inPath,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "POST - relative URL <" << inPath << ">" );
|
||||||
|
|
||||||
uno::Sequence< sal_Int8 > aDataToSend;
|
uno::Sequence< sal_Int8 > aDataToSend;
|
||||||
if ( !getDataFromInputStream( inInputStream, aDataToSend, true ) )
|
if ( !getDataFromInputStream( inInputStream, aDataToSend, true ) )
|
||||||
@@ -1206,6 +1207,7 @@ void NeonSession::POST( const OUString & inPath,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "POST - relative URL <" << inPath << ">" );
|
||||||
|
|
||||||
uno::Sequence< sal_Int8 > aDataToSend;
|
uno::Sequence< sal_Int8 > aDataToSend;
|
||||||
if ( !getDataFromInputStream( inInputStream, aDataToSend, true ) )
|
if ( !getDataFromInputStream( inInputStream, aDataToSend, true ) )
|
||||||
@@ -1232,6 +1234,7 @@ void NeonSession::MKCOL( const OUString & inPath,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "MKCOL - relative URL <" << inPath << ">" );
|
||||||
|
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
@@ -1249,6 +1252,7 @@ void NeonSession::COPY( const OUString & inSourceURL,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "COPY - inSourceURL: "<<inSourceURL<<" inDestinationURL: "<<inDestinationURL);
|
||||||
|
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
@@ -1275,6 +1279,7 @@ void NeonSession::MOVE( const OUString & inSourceURL,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "MOVE - inSourceURL: "<<inSourceURL<<" inDestinationURL: "<<inDestinationURL);
|
||||||
|
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
@@ -1297,6 +1302,7 @@ void NeonSession::DESTROY( const OUString & inPath,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "DESTROY - relative URL <" << inPath << ">" );
|
||||||
|
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
@@ -1328,7 +1334,7 @@ namespace
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_TRACE( "No chance to refresh lock before timeout!" );
|
SAL_WARN( "ucb.ucp.webdav", "LOCK - no chance to refresh lock before timeout!" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return lastChanceToSendRefreshRequest;
|
return lastChanceToSendRefreshRequest;
|
||||||
@@ -1343,6 +1349,7 @@ void NeonSession::LOCK( const OUString & inPath,
|
|||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "LOCK (create) - relative URL: <" << inPath << ">" );
|
||||||
|
|
||||||
// before issuing the lock command,
|
// before issuing the lock command,
|
||||||
// better check first if we already have one on this href
|
// better check first if we already have one on this href
|
||||||
@@ -1424,18 +1431,15 @@ void NeonSession::LOCK( const OUString & inPath,
|
|||||||
aTokens[ 0 ] = OUString::createFromAscii( theLock->token );
|
aTokens[ 0 ] = OUString::createFromAscii( theLock->token );
|
||||||
rLock.LockTokens = aTokens;
|
rLock.LockTokens = aTokens;
|
||||||
|
|
||||||
OSL_TRACE( "NeonSession::LOCK: created lock for %s. token: %s",
|
SAL_INFO( "ucb.ucp.webdav", "LOCK (create) - Created lock for <" << makeAbsoluteURL( inPath )
|
||||||
OUStringToOString( makeAbsoluteURL( inPath ),
|
<< "> token: <" << theLock->token << "> timeout: " << theLock->timeout << " sec.");
|
||||||
RTL_TEXTENCODING_UTF8 ).getStr(),
|
|
||||||
theLock->token );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ne_lock_destroy( theLock );
|
ne_lock_destroy( theLock );
|
||||||
|
|
||||||
OSL_TRACE( "NeonSession::LOCK: obtaining lock for %s failed!",
|
SAL_INFO( "ucb.ucp.webdav", "LOCK (create) - Obtaining lock for <"
|
||||||
OUStringToOString( makeAbsoluteURL( inPath ),
|
<< makeAbsoluteURL( inPath ) << " failed!" );
|
||||||
RTL_TEXTENCODING_UTF8 ).getStr() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleError( theRetVal, inPath, rEnv );
|
HandleError( theRetVal, inPath, rEnv );
|
||||||
@@ -1447,10 +1451,12 @@ bool NeonSession::LOCK( NeonLock * pLock,
|
|||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
|
||||||
#if OSL_DEBUG_LEVEL > 0
|
#if defined SAL_LOG_INFO
|
||||||
char * p = ne_uri_unparse( &(pLock->uri) );
|
{
|
||||||
OSL_TRACE( "NeonSession::LOCK: Refreshing lock for %s.", p );
|
char * p = ne_uri_unparse( &(pLock->uri) );
|
||||||
ne_free( p );
|
SAL_INFO( "ucb.ucp.webdav", "LOCK (refresh) - relative URL: <" << p << "> token: <" << pLock->token << ">" );
|
||||||
|
ne_free( p );
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// refresh existing lock.
|
// refresh existing lock.
|
||||||
@@ -1463,12 +1469,16 @@ bool NeonSession::LOCK( NeonLock * pLock,
|
|||||||
rlastChanceToSendRefreshRequest
|
rlastChanceToSendRefreshRequest
|
||||||
= lastChanceToSendRefreshRequest( startCall, pLock->timeout );
|
= lastChanceToSendRefreshRequest( startCall, pLock->timeout );
|
||||||
|
|
||||||
OSL_TRACE( "Lock successfully refreshed." );
|
SAL_INFO( "ucb.ucp.webdav", "LOCK (refresh) - Lock successfully refreshed." );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_TRACE( "Lock not refreshed!" );
|
#if defined SAL_LOG_WARN
|
||||||
|
char * p = ne_uri_unparse( &(pLock->uri) );
|
||||||
|
SAL_WARN( "ucb.ucp.webdav", "LOCK (refresh) - not refreshed! Relative URL: <" << p << "> token: <" << pLock->token << ">" );
|
||||||
|
ne_free( p );
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1485,6 +1495,7 @@ void NeonSession::UNLOCK( const OUString & inPath,
|
|||||||
if ( !theLock )
|
if ( !theLock )
|
||||||
throw DAVException( DAVException::DAV_NOT_LOCKED );
|
throw DAVException( DAVException::DAV_NOT_LOCKED );
|
||||||
|
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "UNLOCK - relative URL: <" << inPath << "> token: <" << theLock->token << ">" );
|
||||||
Init( rEnv );
|
Init( rEnv );
|
||||||
|
|
||||||
int theRetVal = ne_unlock( m_pHttpSession, theLock );
|
int theRetVal = ne_unlock( m_pHttpSession, theLock );
|
||||||
@@ -1496,9 +1507,8 @@ void NeonSession::UNLOCK( const OUString & inPath,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_TRACE( "NeonSession::UNLOCK: unlocking of %s failed.",
|
SAL_INFO( "ucb.ucp.webdav", "UNLOCK - Unlocking of <"
|
||||||
OUStringToOString( makeAbsoluteURL( inPath ),
|
<< makeAbsoluteURL( inPath ) << "> failed." );
|
||||||
RTL_TEXTENCODING_UTF8 ).getStr() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleError( theRetVal, inPath, rEnv );
|
HandleError( theRetVal, inPath, rEnv );
|
||||||
@@ -1508,20 +1518,34 @@ bool NeonSession::UNLOCK( NeonLock * pLock )
|
|||||||
{
|
{
|
||||||
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
osl::Guard< osl::Mutex > theGuard( m_aMutex );
|
||||||
|
|
||||||
#if OSL_DEBUG_LEVEL > 0
|
#if defined SAL_LOG_INFO
|
||||||
char * p = ne_uri_unparse( &(pLock->uri) );
|
{
|
||||||
OSL_TRACE( "NeonSession::UNLOCK: Unlocking %s.", p );
|
char * p = ne_uri_unparse( &(pLock->uri) );
|
||||||
ne_free( p );
|
SAL_INFO( "ucb.ucp.webdav", "UNLOCK (from store) - relative URL: <" << p << "> token: <" << pLock->token << ">" );
|
||||||
|
ne_free( p );
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( ne_unlock( m_pHttpSession, pLock ) == NE_OK )
|
if ( ne_unlock( m_pHttpSession, pLock ) == NE_OK )
|
||||||
{
|
{
|
||||||
OSL_TRACE( "UNLOCK succeeded." );
|
#if defined SAL_LOG_INFO
|
||||||
|
{
|
||||||
|
char * p = ne_uri_unparse( &(pLock->uri) );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "UNLOCK (from store) - relative URL: <" << p << "> token: <" << pLock->token << "> succeeded." );
|
||||||
|
ne_free( p );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_TRACE( "UNLOCK failed!" );
|
#if defined SAL_LOG_WARN
|
||||||
|
{
|
||||||
|
char * p = ne_uri_unparse( &(pLock->uri) );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "UNLOCK (from store) - relative URL: <" << p << "> token: <" << pLock->token << "> failed!" );
|
||||||
|
ne_free( p );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1529,7 +1553,7 @@ bool NeonSession::UNLOCK( NeonLock * pLock )
|
|||||||
void NeonSession::abort()
|
void NeonSession::abort()
|
||||||
throw ( std::exception )
|
throw ( std::exception )
|
||||||
{
|
{
|
||||||
SAL_INFO("ucb.ucp.webdav", "neon commands cannot be aborted");
|
SAL_INFO( "ucb.ucp.webdav", "neon commands cannot be aborted" );
|
||||||
}
|
}
|
||||||
|
|
||||||
const ucbhelper::InternetProxyServer & NeonSession::getProxySettings() const
|
const ucbhelper::InternetProxyServer & NeonSession::getProxySettings() const
|
||||||
@@ -1616,11 +1640,8 @@ bool NeonSession::removeExpiredLocktoken( const OUString & inURL,
|
|||||||
|
|
||||||
// No lockdiscovery prop in propfind result / locktoken not found
|
// No lockdiscovery prop in propfind result / locktoken not found
|
||||||
// in propfind result -> not locked
|
// in propfind result -> not locked
|
||||||
OSL_TRACE( "NeonSession::removeExpiredLocktoken: Removing "
|
SAL_WARN( "ucb.ucp.webdav", "Removing expired lock token for <" << inURL
|
||||||
" expired lock token for %s. token: %s",
|
<< "> token: " << theLock->token );
|
||||||
OUStringToOString( inURL,
|
|
||||||
RTL_TEXTENCODING_UTF8 ).getStr(),
|
|
||||||
theLock->token );
|
|
||||||
|
|
||||||
m_aNeonLockStore.removeLock( theLock );
|
m_aNeonLockStore.removeLock( theLock );
|
||||||
ne_lock_destroy( theLock );
|
ne_lock_destroy( theLock );
|
||||||
@@ -1653,7 +1674,7 @@ void NeonSession::HandleError( int nError,
|
|||||||
|
|
||||||
sal_uInt16 code = makeStatusCode( aText );
|
sal_uInt16 code = makeStatusCode( aText );
|
||||||
|
|
||||||
SAL_WARN( "ucb.ucp.webdav","Neon received http error: '" << aText << "'");
|
SAL_WARN( "ucb.ucp.webdav", "Neon received http error: '" << aText << "'" );
|
||||||
if ( code == SC_LOCKED )
|
if ( code == SC_LOCKED )
|
||||||
{
|
{
|
||||||
if ( m_aNeonLockStore.findByUri(
|
if ( m_aNeonLockStore.findByUri(
|
||||||
@@ -1682,7 +1703,7 @@ void NeonSession::HandleError( int nError,
|
|||||||
throw DAVException( DAVException::DAV_HTTP_ERROR, aText, code );
|
throw DAVException( DAVException::DAV_HTTP_ERROR, aText, code );
|
||||||
}
|
}
|
||||||
case NE_LOOKUP: // Name lookup failed.
|
case NE_LOOKUP: // Name lookup failed.
|
||||||
SAL_WARN( "ucb.ucp.webdav","Name lookup failed" );
|
SAL_WARN( "ucb.ucp.webdav", "Name lookup failed" );
|
||||||
throw DAVException( DAVException::DAV_HTTP_LOOKUP,
|
throw DAVException( DAVException::DAV_HTTP_LOOKUP,
|
||||||
NeonUri::makeConnectionEndPointString(
|
NeonUri::makeConnectionEndPointString(
|
||||||
m_aHostName, m_nPort ) );
|
m_aHostName, m_nPort ) );
|
||||||
@@ -1693,6 +1714,7 @@ void NeonSession::HandleError( int nError,
|
|||||||
m_aHostName, m_nPort ) );
|
m_aHostName, m_nPort ) );
|
||||||
|
|
||||||
case NE_PROXYAUTH: // User authentication failed on proxy
|
case NE_PROXYAUTH: // User authentication failed on proxy
|
||||||
|
SAL_WARN( "ucb.ucp.webdav", "DAVException::DAV_HTTP_AUTHPROXY" );
|
||||||
throw DAVException( DAVException::DAV_HTTP_AUTHPROXY,
|
throw DAVException( DAVException::DAV_HTTP_AUTHPROXY,
|
||||||
NeonUri::makeConnectionEndPointString(
|
NeonUri::makeConnectionEndPointString(
|
||||||
m_aProxyName, m_nProxyPort ) );
|
m_aProxyName, m_nProxyPort ) );
|
||||||
@@ -1703,12 +1725,13 @@ void NeonSession::HandleError( int nError,
|
|||||||
m_aHostName, m_nPort ) );
|
m_aHostName, m_nPort ) );
|
||||||
|
|
||||||
case NE_TIMEOUT: // Connection timed out
|
case NE_TIMEOUT: // Connection timed out
|
||||||
|
SAL_WARN( "ucb.ucp.webdav", "DAVException::DAV_HTTP_TIMEOUT" );
|
||||||
throw DAVException( DAVException::DAV_HTTP_TIMEOUT,
|
throw DAVException( DAVException::DAV_HTTP_TIMEOUT,
|
||||||
NeonUri::makeConnectionEndPointString(
|
NeonUri::makeConnectionEndPointString(
|
||||||
m_aHostName, m_nPort ) );
|
m_aHostName, m_nPort ) );
|
||||||
|
|
||||||
case NE_FAILED: // The precondition failed
|
case NE_FAILED: // The precondition failed
|
||||||
SAL_WARN( "ucb.ucp.webdav","The precondition failed" );
|
SAL_WARN( "ucb.ucp.webdav", "The precondition failed" );
|
||||||
throw DAVException( DAVException::DAV_HTTP_FAILED,
|
throw DAVException( DAVException::DAV_HTTP_FAILED,
|
||||||
NeonUri::makeConnectionEndPointString(
|
NeonUri::makeConnectionEndPointString(
|
||||||
m_aHostName, m_nPort ) );
|
m_aHostName, m_nPort ) );
|
||||||
@@ -1721,6 +1744,7 @@ void NeonSession::HandleError( int nError,
|
|||||||
case NE_REDIRECT:
|
case NE_REDIRECT:
|
||||||
{
|
{
|
||||||
NeonUri aUri( ne_redirect_location( m_pHttpSession ) );
|
NeonUri aUri( ne_redirect_location( m_pHttpSession ) );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "DAVException::DAV_HTTP_REDIRECT: new URI: " << aUri.GetURI() );
|
||||||
throw DAVException(
|
throw DAVException(
|
||||||
DAVException::DAV_HTTP_REDIRECT, aUri.GetURI() );
|
DAVException::DAV_HTTP_REDIRECT, aUri.GetURI() );
|
||||||
}
|
}
|
||||||
@@ -1820,6 +1844,7 @@ int NeonSession::GET( ne_session * sess,
|
|||||||
{
|
{
|
||||||
char buffer[8192];
|
char buffer[8192];
|
||||||
|
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "GET - received header: " << name << ": " << value );
|
||||||
ne_snprintf(buffer, sizeof buffer, "%s: %s", name, value);
|
ne_snprintf(buffer, sizeof buffer, "%s: %s", name, value);
|
||||||
runResponseHeaderHandler(userdata, buffer);
|
runResponseHeaderHandler(userdata, buffer);
|
||||||
}
|
}
|
||||||
|
@@ -110,7 +110,7 @@ extern "C" int UCBDeadPropertyValue_chardata_callback(
|
|||||||
switch ( state )
|
switch ( state )
|
||||||
{
|
{
|
||||||
case STATE_TYPE:
|
case STATE_TYPE:
|
||||||
OSL_ENSURE( !pCtx->pType,
|
assert( !pCtx->pType &&
|
||||||
"UCBDeadPropertyValue_endelement_callback - "
|
"UCBDeadPropertyValue_endelement_callback - "
|
||||||
"Type already set!" );
|
"Type already set!" );
|
||||||
pCtx->pType
|
pCtx->pType
|
||||||
@@ -118,7 +118,7 @@ extern "C" int UCBDeadPropertyValue_chardata_callback(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_VALUE:
|
case STATE_VALUE:
|
||||||
OSL_ENSURE( !pCtx->pValue,
|
assert( !pCtx->pValue &&
|
||||||
"UCBDeadPropertyValue_endelement_callback - "
|
"UCBDeadPropertyValue_endelement_callback - "
|
||||||
"Value already set!" );
|
"Value already set!" );
|
||||||
pCtx->pValue
|
pCtx->pValue
|
||||||
@@ -213,7 +213,7 @@ static OUString decodeValue( const OUString & rValue )
|
|||||||
|
|
||||||
if ( nPos == nEnd )
|
if ( nPos == nEnd )
|
||||||
{
|
{
|
||||||
OSL_FAIL( "UCBDeadPropertyValue::decodeValue - syntax error!" );
|
SAL_WARN( "ucb.ucp.webdav", "decodeValue() - syntax error!" );
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@ static OUString decodeValue( const OUString & rValue )
|
|||||||
|
|
||||||
if ( nPos > nEnd - 4 )
|
if ( nPos > nEnd - 4 )
|
||||||
{
|
{
|
||||||
OSL_FAIL( "UCBDeadPropertyValue::decodeValue - syntax error!" );
|
SAL_WARN( "ucb.ucp.webdav", "decodeValue() - syntax error!" );
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ static OUString decodeValue( const OUString & rValue )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_FAIL( "UCBDeadPropertyValue::decodeValue - syntax error!" );
|
SAL_WARN( "ucb.ucp.webdav", "decodeValue() - syntax error!" );
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -250,7 +250,7 @@ static OUString decodeValue( const OUString & rValue )
|
|||||||
|
|
||||||
if ( nPos > nEnd - 3 )
|
if ( nPos > nEnd - 3 )
|
||||||
{
|
{
|
||||||
OSL_FAIL( "UCBDeadPropertyValue::decodeValue - syntax error!" );
|
SAL_WARN( "ucb.ucp.webdav", "decodeValue() - syntax error!" );
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ static OUString decodeValue( const OUString & rValue )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_FAIL( "UCBDeadPropertyValue::decodeValue - syntax error!" );
|
SAL_WARN( "ucb.ucp.webdav", "decodeValue() - syntax error!" );
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -273,7 +273,7 @@ static OUString decodeValue( const OUString & rValue )
|
|||||||
|
|
||||||
if ( nPos > nEnd - 3 )
|
if ( nPos > nEnd - 3 )
|
||||||
{
|
{
|
||||||
OSL_FAIL( "UCBDeadPropertyValue::decodeValue - syntax error!" );
|
SAL_WARN( "ucb.ucp.webdav", "decodeValue() - syntax error!" );
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,13 +286,13 @@ static OUString decodeValue( const OUString & rValue )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_FAIL( "UCBDeadPropertyValue::decodeValue - syntax error!" );
|
SAL_WARN( "ucb.ucp.webdav", "decodeValue() - syntax error!" );
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_FAIL( "UCBDeadPropertyValue::decodeValue - syntax error!" );
|
SAL_WARN( "ucb.ucp.webdav", "decodeValue() - syntax error!" );
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -403,7 +403,7 @@ bool UCBDeadPropertyValue::createFromXML( const OString & rInData,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_FAIL( "UCBDeadPropertyValue::createFromXML - "
|
SAL_WARN( "ucb.ucp.webdav", "createFromXML() - "
|
||||||
"Unsupported property type!" );
|
"Unsupported property type!" );
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
@@ -501,8 +501,7 @@ bool UCBDeadPropertyValue::toXML( const uno::Any & rInData,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_FAIL( "UCBDeadPropertyValue::toXML - "
|
SAL_WARN( "ucb.ucp.webdav", "toXML() - unsupported property type!" );
|
||||||
"Unsupported property type!" );
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -877,20 +877,20 @@ void Content::addProperty( const ucb::PropertyCommandArgument& aCmdArg,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
OSL_FAIL( "Content::addProperty - "
|
SAL_WARN( "ucb.ucp.webdav", "Content::addProperty - "
|
||||||
"Unsupported resource type!" );
|
"Unsupported resource type!" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch ( uno::Exception const & )
|
catch ( uno::Exception const & )
|
||||||
{
|
{
|
||||||
OSL_FAIL( "Content::addProperty - "
|
SAL_WARN( "ucb.ucp.webdav", "Content::addProperty - "
|
||||||
"Unable to determine resource type!" );
|
"Unable to determine resource type!" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_FAIL( "Content::addProperty - "
|
SAL_WARN( "ucb.ucp.webdav", "Content::addProperty - "
|
||||||
"Unable to determine resource type!" );
|
"Unable to determine resource type!" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -963,20 +963,20 @@ void Content::removeProperty( const OUString& Name,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
OSL_FAIL( "Content::removeProperty - "
|
SAL_WARN( "ucb.ucp.webdav", "Content::removeProperty - "
|
||||||
"Unsupported resource type!" );
|
"Unsupported resource type!" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch ( uno::Exception const & )
|
catch ( uno::Exception const & )
|
||||||
{
|
{
|
||||||
OSL_FAIL( "Content::removeProperty - "
|
SAL_WARN( "ucb.ucp.webdav", "Content::removeProperty - "
|
||||||
"Unable to determine resource type!" );
|
"Unable to determine resource type!" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_FAIL( "Content::removeProperty - "
|
SAL_WARN( "ucb.ucp.webdav", "Content::removeProperty - "
|
||||||
"Unable to determine resource type!" );
|
"Unable to determine resource type!" );
|
||||||
// throw beans::UnknownPropertyException();
|
// throw beans::UnknownPropertyException();
|
||||||
}
|
}
|
||||||
@@ -1069,8 +1069,7 @@ Content::createNewContent( const ucb::ContentInfo& Info )
|
|||||||
|
|
||||||
OUString aURL = m_xIdentifier->getContentIdentifier();
|
OUString aURL = m_xIdentifier->getContentIdentifier();
|
||||||
|
|
||||||
OSL_ENSURE( !aURL.isEmpty(),
|
assert( !aURL.isEmpty() && "WebdavContent::createNewContent - empty identifier!" );
|
||||||
"WebdavContent::createNewContent - empty identifier!" );
|
|
||||||
|
|
||||||
if ( ( aURL.lastIndexOf( '/' ) + 1 ) != aURL.getLength() )
|
if ( ( aURL.lastIndexOf( '/' ) + 1 ) != aURL.getLength() )
|
||||||
aURL += "/";
|
aURL += "/";
|
||||||
@@ -1833,8 +1832,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
|
|||||||
}
|
}
|
||||||
catch ( DAVException const & e )
|
catch ( DAVException const & e )
|
||||||
{
|
{
|
||||||
// OSL_FAIL( // "Content::setPropertyValues - PROPPATCH failed!" );
|
SAL_WARN( "ucb.ucp.webdav", "Content::setPropertyValues - PROPPATCH failed!" );
|
||||||
|
|
||||||
cancelCommandExecution( e, xEnv );
|
cancelCommandExecution( e, xEnv );
|
||||||
// unreachable
|
// unreachable
|
||||||
}
|
}
|
||||||
@@ -2266,7 +2264,7 @@ void Content::insert(
|
|||||||
|
|
||||||
if ( aEscapedTitle.isEmpty() )
|
if ( aEscapedTitle.isEmpty() )
|
||||||
{
|
{
|
||||||
OSL_FAIL( "Content::insert - Title missing!" );
|
SAL_WARN( "ucb.ucp.webdav", "Content::insert - Title missing!" );
|
||||||
|
|
||||||
uno::Sequence<OUString> aProps { "Title" };
|
uno::Sequence<OUString> aProps { "Title" };
|
||||||
ucbhelper::cancelCommandExecution(
|
ucbhelper::cancelCommandExecution(
|
||||||
@@ -2342,7 +2340,7 @@ void Content::insert(
|
|||||||
// break;
|
// break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
OSL_FAIL( "Content::insert - "
|
SAL_WARN( "ucb.ucp.webdav", "Content::insert - "
|
||||||
"Unknown interaction selection!" );
|
"Unknown interaction selection!" );
|
||||||
throw ucb::CommandFailedException(
|
throw ucb::CommandFailedException(
|
||||||
OUString( "Unknown interaction selection!" ),
|
OUString( "Unknown interaction selection!" ),
|
||||||
@@ -2870,7 +2868,7 @@ Content::ResourceType Content::resourceTypeForLocks(
|
|||||||
switch( e.getStatus() )
|
switch( e.getStatus() )
|
||||||
{
|
{
|
||||||
case SC_NOT_FOUND:
|
case SC_NOT_FOUND:
|
||||||
SAL_WARN( "ucb.ucp.webdav", "resourceTypeForLocks - URL: <"
|
SAL_WARN( "ucb.ucp.webdav", "resourceTypeForLocks() - URL: <"
|
||||||
<< m_xIdentifier->getContentIdentifier() << "> was not found. ");
|
<< m_xIdentifier->getContentIdentifier() << "> was not found. ");
|
||||||
eResourceTypeForLocks = NOT_FOUND;
|
eResourceTypeForLocks = NOT_FOUND;
|
||||||
break;
|
break;
|
||||||
@@ -2885,13 +2883,13 @@ Content::ResourceType Content::resourceTypeForLocks(
|
|||||||
case SC_NOT_IMPLEMENTED: // http://tools.ietf.org/html/rfc7231#section-6.6.2
|
case SC_NOT_IMPLEMENTED: // http://tools.ietf.org/html/rfc7231#section-6.6.2
|
||||||
case SC_METHOD_NOT_ALLOWED: // http://tools.ietf.org/html/rfc7231#section-6.5.5
|
case SC_METHOD_NOT_ALLOWED: // http://tools.ietf.org/html/rfc7231#section-6.5.5
|
||||||
// they all mean the resource is NON_DAV
|
// they all mean the resource is NON_DAV
|
||||||
SAL_WARN( "ucb.ucp.webdav", "resourceTypeForLocks DAVException (SC_FORBIDDEN, SC_NOT_IMPLEMENTED or SC_METHOD_NOT_ALLOWED) - URL: <"
|
SAL_WARN( "ucb.ucp.webdav", "resourceTypeForLocks() DAVException (SC_FORBIDDEN, SC_NOT_IMPLEMENTED or SC_METHOD_NOT_ALLOWED) - URL: <"
|
||||||
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
||||||
eResourceTypeForLocks = NON_DAV;
|
eResourceTypeForLocks = NON_DAV;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//fallthrough
|
//fallthrough
|
||||||
SAL_WARN( "ucb.ucp.webdav", "resourceTypeForLocks DAVException - URL: <"
|
SAL_WARN( "ucb.ucp.webdav", "resourceTypeForLocks() DAVException - URL: <"
|
||||||
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
||||||
eResourceTypeForLocks = UNKNOWN;
|
eResourceTypeForLocks = UNKNOWN;
|
||||||
}
|
}
|
||||||
@@ -2910,7 +2908,7 @@ Content::ResourceType Content::resourceTypeForLocks(
|
|||||||
"different resource types for <" << rURL << ">: "
|
"different resource types for <" << rURL << ">: "
|
||||||
<< +eResourceTypeForLocks << " vs. " << +m_eResourceTypeForLocks);
|
<< +eResourceTypeForLocks << " vs. " << +m_eResourceTypeForLocks);
|
||||||
}
|
}
|
||||||
SAL_INFO( "ucb.ucp.webdav", "resourceTypeForLocks - URL: <"
|
SAL_INFO( "ucb.ucp.webdav", "resourceTypeForLocks() - URL: <"
|
||||||
<< m_xIdentifier->getContentIdentifier() << ">, m_eResourceTypeForLocks: " << m_eResourceTypeForLocks );
|
<< m_xIdentifier->getContentIdentifier() << ">, m_eResourceTypeForLocks: " << m_eResourceTypeForLocks );
|
||||||
return m_eResourceTypeForLocks;
|
return m_eResourceTypeForLocks;
|
||||||
}
|
}
|
||||||
@@ -2973,7 +2971,7 @@ void Content::lock(
|
|||||||
{
|
{
|
||||||
case DAVException::DAV_LOCKED:
|
case DAVException::DAV_LOCKED:
|
||||||
{
|
{
|
||||||
SAL_WARN( "ucb.ucp.webdav", "lock: resource already locked - URL: <"
|
SAL_WARN( "ucb.ucp.webdav", "lock() resource already locked - URL: <"
|
||||||
<< m_xIdentifier->getContentIdentifier() << ">");
|
<< m_xIdentifier->getContentIdentifier() << ">");
|
||||||
throw
|
throw
|
||||||
ucb::InteractiveLockingLockedException(
|
ucb::InteractiveLockingLockedException(
|
||||||
@@ -2986,7 +2984,7 @@ void Content::lock(
|
|||||||
break;
|
break;
|
||||||
case DAVException::DAV_HTTP_AUTH:
|
case DAVException::DAV_HTTP_AUTH:
|
||||||
{
|
{
|
||||||
SAL_WARN( "ucb.ucp.webdav", "lock: DAVException Authentication error - URL: <"
|
SAL_WARN( "ucb.ucp.webdav", "lock() DAVException Authentication error - URL: <"
|
||||||
<< m_xIdentifier->getContentIdentifier() << ">" );
|
<< m_xIdentifier->getContentIdentifier() << ">" );
|
||||||
// this could mean:
|
// this could mean:
|
||||||
// - interaction handler for credential management not present (happens, depending
|
// - interaction handler for credential management not present (happens, depending
|
||||||
@@ -3013,7 +3011,7 @@ void Content::lock(
|
|||||||
// this returned error is part of base http 1.1 RFCs
|
// this returned error is part of base http 1.1 RFCs
|
||||||
case SC_NOT_IMPLEMENTED:
|
case SC_NOT_IMPLEMENTED:
|
||||||
case SC_METHOD_NOT_ALLOWED:
|
case SC_METHOD_NOT_ALLOWED:
|
||||||
SAL_WARN( "ucb.ucp.webdav", "lock: DAVException (SC_NOT_IMPLEMENTED or SC_METHOD_NOT_ALLOWED) - URL: <"
|
SAL_WARN( "ucb.ucp.webdav", "lock() DAVException (SC_NOT_IMPLEMENTED or SC_METHOD_NOT_ALLOWED) - URL: <"
|
||||||
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
||||||
// act as nothing happened
|
// act as nothing happened
|
||||||
// that's because when a resource is first created
|
// that's because when a resource is first created
|
||||||
@@ -3041,7 +3039,7 @@ void Content::lock(
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
SAL_WARN( "ucb.ucp.webdav","lock: DAVException - URL: <"
|
SAL_WARN( "ucb.ucp.webdav","lock() DAVException - URL: <"
|
||||||
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
||||||
cancelCommandExecution( e, Environment );
|
cancelCommandExecution( e, Environment );
|
||||||
// Unreachable
|
// Unreachable
|
||||||
@@ -3073,7 +3071,7 @@ void Content::unlock(
|
|||||||
switch( e.getError() )
|
switch( e.getError() )
|
||||||
{
|
{
|
||||||
case DAVException::DAV_NOT_LOCKED:
|
case DAVException::DAV_NOT_LOCKED:
|
||||||
SAL_WARN( "ucb.ucp.webdav", "unlock: DAVException::DAV_NOT_LOCKED - URL: <"
|
SAL_WARN( "ucb.ucp.webdav", "unlock() DAVException::DAV_NOT_LOCKED - URL: <"
|
||||||
<< m_xIdentifier->getContentIdentifier() << ">");
|
<< m_xIdentifier->getContentIdentifier() << ">");
|
||||||
// means that we don't own any lock on this resource
|
// means that we don't own any lock on this resource
|
||||||
// intercepted here to remove a confusing indication to the user
|
// intercepted here to remove a confusing indication to the user
|
||||||
@@ -3089,7 +3087,7 @@ void Content::unlock(
|
|||||||
// this returned error is part of base http 1.1 RFCs
|
// this returned error is part of base http 1.1 RFCs
|
||||||
case SC_NOT_IMPLEMENTED:
|
case SC_NOT_IMPLEMENTED:
|
||||||
case SC_METHOD_NOT_ALLOWED:
|
case SC_METHOD_NOT_ALLOWED:
|
||||||
SAL_WARN( "ucb.ucp.webdav", "unlock: DAVException (SC_NOT_IMPLEMENTED or SC_METHOD_NOT_ALLOWED) - URL: <"
|
SAL_WARN( "ucb.ucp.webdav", "unlock() DAVException (SC_NOT_IMPLEMENTED or SC_METHOD_NOT_ALLOWED) - URL: <"
|
||||||
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
@@ -3102,7 +3100,7 @@ void Content::unlock(
|
|||||||
//fallthrough
|
//fallthrough
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
SAL_WARN( "ucb.ucp.webdav","unlock: DAVException - URL: <"
|
SAL_WARN( "ucb.ucp.webdav","unlock() DAVException - URL: <"
|
||||||
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
<< m_xIdentifier->getContentIdentifier() << ">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
|
||||||
cancelCommandExecution( e, Environment );
|
cancelCommandExecution( e, Environment );
|
||||||
// Unreachable
|
// Unreachable
|
||||||
@@ -3123,7 +3121,7 @@ bool Content::exchangeIdentity(
|
|||||||
// Already persistent?
|
// Already persistent?
|
||||||
if ( m_bTransient )
|
if ( m_bTransient )
|
||||||
{
|
{
|
||||||
OSL_FAIL( "Content::exchangeIdentity - Not persistent!" );
|
SAL_WARN( "ucb.ucp.webdav", "Content::exchangeIdentity - Not persistent!" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3171,7 +3169,7 @@ bool Content::exchangeIdentity(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OSL_FAIL( "Content::exchangeIdentity - "
|
SAL_WARN( "ucb.ucp.webdav", "Content::exchangeIdentity - "
|
||||||
"Panic! Cannot exchange identity!" );
|
"Panic! Cannot exchange identity!" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -3502,6 +3500,7 @@ Content::ResourceType Content::getResourceType(
|
|||||||
"different resource types for <" << rURL << ">: "
|
"different resource types for <" << rURL << ">: "
|
||||||
<< +eResourceType << " vs. " << +m_eResourceType);
|
<< +eResourceType << " vs. " << +m_eResourceType);
|
||||||
}
|
}
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "m_eResourceType for <"<<rURL<<">: " << m_eResourceType );
|
||||||
return m_eResourceType;
|
return m_eResourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -378,12 +378,34 @@ bool DataSupplier::getData()
|
|||||||
propertyNames,
|
propertyNames,
|
||||||
resources,
|
resources,
|
||||||
getResultSet()->getEnvironment() );
|
getResultSet()->getEnvironment() );
|
||||||
}
|
#if defined SAL_LOG_INFO
|
||||||
catch ( DAVException & )
|
{
|
||||||
|
//print the resource for every URI returned
|
||||||
|
std::vector< DAVResource >::const_iterator it3 = resources.begin();
|
||||||
|
std::vector< DAVResource >::const_iterator end3 = resources.end();
|
||||||
|
while ( it3 != end3 )
|
||||||
|
{
|
||||||
|
NeonUri aCurrURI( (*it3).uri );
|
||||||
|
OUString aCurrPath = aCurrURI.GetPath();
|
||||||
|
aCurrPath = NeonUri::unescape( aCurrPath );
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "getData() - resource URL: <" << (*it3).uri << ">, unescaped to: <" << aCurrPath << "> )" );
|
||||||
|
std::vector< DAVPropertyValue >::const_iterator it4 = (*it3).properties.begin();
|
||||||
|
std::vector< DAVPropertyValue >::const_iterator end4 = (*it3).properties.end();
|
||||||
|
while ( it4 != end4 )
|
||||||
|
{
|
||||||
|
SAL_INFO( "ucb.ucp.webdav", "PROPFIND - property name: " << (*it4).Name );
|
||||||
|
++it4;
|
||||||
|
}
|
||||||
|
++it3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
catch ( DAVException & )
|
||||||
{
|
{
|
||||||
// OSL_FAIL( "PROPFIND : DAVException" );
|
SAL_WARN( "ucb.ucp.webdav", "Running PROPFIND: DAVException" );
|
||||||
m_pImpl->m_bThrowException = true;
|
m_pImpl->m_bThrowException = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !m_pImpl->m_bThrowException )
|
if ( !m_pImpl->m_bThrowException )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user