summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorKai Sommerfeld <kso@openoffice.org>2010-09-20 16:05:13 +0200
committerKai Sommerfeld <kso@openoffice.org>2010-09-20 16:05:13 +0200
commitba28593e334b42d828b953213faa97ee20d1b08f (patch)
treeaecbac6e61dbbcb719db290d828c2859de542781 /ucb
parent88fa46c734b3733daa1c4988be89d4b982054d90 (diff)
#i114622# - Workaround for buggy Oracle Beehive server response for lockdiscovery property.
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav/LockSequence.cxx24
1 files changed, 20 insertions, 4 deletions
diff --git a/ucb/source/ucp/webdav/LockSequence.cxx b/ucb/source/ucp/webdav/LockSequence.cxx
index cd5f12708d58..98e61954032f 100644
--- a/ucb/source/ucp/webdav/LockSequence.cxx
+++ b/ucb/source/ucp/webdav/LockSequence.cxx
@@ -35,6 +35,8 @@
using namespace webdav_ucp;
using namespace com::sun::star;
+#define BEEHIVE_BUGS_WORKAROUND
+
//////////////////////////////////////////////////////////////////////////
struct LockSequenceParseContext
@@ -128,7 +130,11 @@ extern "C" int LockSequence_startelement_callback(
extern "C" int LockSequence_chardata_callback(
void *userdata,
int state,
+#ifdef BEEHIVE_BUGS_WORKAROUND
+ const char *buf1,
+#else
const char *buf,
+#endif
size_t len )
{
LockSequenceParseContext * pCtx
@@ -136,6 +142,15 @@ extern "C" int LockSequence_chardata_callback(
if ( !pCtx->pLock )
pCtx->pLock = new ucb::Lock;
+#ifdef BEEHIVE_BUGS_WORKAROUND
+ // Beehive sends XML values containing trailing newlines.
+ if ( buf1[ len - 1 ] == 0x0a )
+ len--;
+
+ char * buf = new char[ len + 1 ]();
+ strncpy( buf, buf1, len );
+#endif
+
switch ( state )
{
case STATE_DEPTH:
@@ -203,12 +218,8 @@ extern "C" int LockSequence_chardata_callback(
// @@@
// }
else
- {
- pCtx->pLock->Timeout = sal_Int64( -1 );
- pCtx->hasTimeout = true;
OSL_ENSURE( sal_False,
"LockSequence_chardata_callback - Unknown timeout!" );
- }
break;
case STATE_HREF:
@@ -223,6 +234,11 @@ extern "C" int LockSequence_chardata_callback(
}
}
+
+#ifdef BEEHIVE_BUGS_WORKAROUND
+ delete [] buf;
+#endif
+
return 0; // zero to continue, non-zero to abort parsing
}