summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/webdav
diff options
context:
space:
mode:
authorKai Sommerfeld <kso@openoffice.org>2010-10-13 14:32:41 +0200
committerKai Sommerfeld <kso@openoffice.org>2010-10-13 14:32:41 +0200
commite06b0f34ec36ddf5470d3a40d0d41c47e3814670 (patch)
tree3960add2b74ecbf5ed116fec095e33a7826e9bea /ucb/source/ucp/webdav
parent854b13739b6bd5c14113eba08b5d3eceb473f892 (diff)
#i115050# - Drop support for neon < 0.26.0
Diffstat (limited to 'ucb/source/ucp/webdav')
-rw-r--r--ucb/source/ucp/webdav/LinkSequence.cxx4
-rw-r--r--ucb/source/ucp/webdav/LockEntrySequence.cxx4
-rw-r--r--ucb/source/ucp/webdav/LockSequence.cxx4
-rw-r--r--ucb/source/ucp/webdav/NeonHeadRequest.cxx89
-rw-r--r--ucb/source/ucp/webdav/NeonPropFindRequest.cxx18
-rw-r--r--ucb/source/ucp/webdav/NeonSession.cxx20
-rw-r--r--ucb/source/ucp/webdav/NeonUri.cxx18
-rw-r--r--ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx4
8 files changed, 10 insertions, 151 deletions
diff --git a/ucb/source/ucp/webdav/LinkSequence.cxx b/ucb/source/ucp/webdav/LinkSequence.cxx
index 39d8d9cecc38..31ec14ba0adf 100644
--- a/ucb/source/ucp/webdav/LinkSequence.cxx
+++ b/ucb/source/ucp/webdav/LinkSequence.cxx
@@ -168,11 +168,7 @@ bool LinkSequence::createFromXML( const rtl::OString & rInData,
rInData.getStr() + nStart,
nEnd - nStart + TOKEN_LENGTH );
-#if NEON_VERSION >= 0x0250
success = !ne_xml_failed( parser );
-#else
- success = !!ne_xml_valid( parser );
-#endif
ne_xml_destroy( parser );
diff --git a/ucb/source/ucp/webdav/LockEntrySequence.cxx b/ucb/source/ucp/webdav/LockEntrySequence.cxx
index 762170e7e057..1e577a47981b 100644
--- a/ucb/source/ucp/webdav/LockEntrySequence.cxx
+++ b/ucb/source/ucp/webdav/LockEntrySequence.cxx
@@ -215,11 +215,7 @@ bool LockEntrySequence::createFromXML( const rtl::OString & rInData,
rInData.getStr() + nStart,
nEnd - nStart + TOKEN_LENGTH );
-#if NEON_VERSION >= 0x0250
success = !ne_xml_failed( parser );
-#else
- success = !!ne_xml_valid( parser );
-#endif
ne_xml_destroy( parser );
diff --git a/ucb/source/ucp/webdav/LockSequence.cxx b/ucb/source/ucp/webdav/LockSequence.cxx
index bc9b9f0175f7..f95badaf19d2 100644
--- a/ucb/source/ucp/webdav/LockSequence.cxx
+++ b/ucb/source/ucp/webdav/LockSequence.cxx
@@ -343,11 +343,7 @@ bool LockSequence::createFromXML( const rtl::OString & rInData,
rInData.getStr() + nStart,
nEnd - nStart + TOKEN_LENGTH );
-#if NEON_VERSION >= 0x0250
success = !ne_xml_failed( parser );
-#else
- success = !!ne_xml_valid( parser );
-#endif
ne_xml_destroy( parser );
diff --git a/ucb/source/ucp/webdav/NeonHeadRequest.cxx b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
index 2880a86a727d..1e5294882a03 100644
--- a/ucb/source/ucp/webdav/NeonHeadRequest.cxx
+++ b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
@@ -37,16 +37,15 @@ using namespace com::sun::star;
namespace {
-#if NEON_VERSION >= 0x0250
-void process_headers(ne_request *req,
- DAVResource &rResource,
- const std::vector< ::rtl::OUString > &rHeaderNames)
+void process_headers( ne_request * req,
+ DAVResource & rResource,
+ const std::vector< ::rtl::OUString > & rHeaderNames )
{
- void *cursor = NULL;
- const char *name, *value;
+ void * cursor = NULL;
+ const char * name, *value;
- while ((cursor = ne_response_header_iterate(req, cursor,
- &name, &value)) != NULL) {
+ while ( ( cursor = ne_response_header_iterate( req, cursor,
+ &name, &value ) ) != NULL ) {
rtl::OUString aHeaderName( rtl::OUString::createFromAscii( name ) );
rtl::OUString aHeaderValue( rtl::OUString::createFromAscii( value ) );
@@ -86,69 +85,6 @@ void process_headers(ne_request *req,
}
}
}
-#else
-struct NeonHeadRequestContext
-{
- DAVResource * pResource;
- const std::vector< ::rtl::OUString > * pHeaderNames;
-
- NeonHeadRequestContext( DAVResource * p,
- const std::vector< ::rtl::OUString > * pHeaders )
- : pResource( p ), pHeaderNames( pHeaders ) {}
-};
-
-extern "C" void NHR_ResponseHeaderCatcher( void * userdata,
- const char * value )
-{
- rtl::OUString aHeader( rtl::OUString::createFromAscii( value ) );
- sal_Int32 nPos = aHeader.indexOf( ':' );
-
- if ( nPos != -1 )
- {
- rtl::OUString aHeaderName( aHeader.copy( 0, nPos ) );
-
- NeonHeadRequestContext * pCtx
- = static_cast< NeonHeadRequestContext * >( userdata );
-
- // Note: Empty vector means that all headers are requested.
- bool bIncludeIt = ( pCtx->pHeaderNames->size() == 0 );
-
- if ( !bIncludeIt )
- {
- // Check whether this header was requested.
- std::vector< ::rtl::OUString >::const_iterator it(
- pCtx->pHeaderNames->begin() );
- const std::vector< ::rtl::OUString >::const_iterator end(
- pCtx->pHeaderNames->end() );
-
- while ( it != end )
- {
- if ( (*it) == aHeaderName )
- break;
-
- ++it;
- }
-
- if ( it != end )
- bIncludeIt = true;
- }
-
- if ( bIncludeIt )
- {
- // Create & set the PropertyValue
- DAVPropertyValue thePropertyValue;
- thePropertyValue.Name = aHeaderName;
- thePropertyValue.IsCaseSensitive = false;
-
- if ( nPos < aHeader.getLength() )
- thePropertyValue.Value <<= aHeader.copy( nPos + 1 ).trim();
-
- // Add the newly created PropertyValue
- pCtx->pResource->properties.push_back( thePropertyValue );
- }
- }
-}
-#endif
} // namespace
@@ -156,7 +92,7 @@ extern "C" void NHR_ResponseHeaderCatcher( void * userdata,
// Constructor
// -------------------------------------------------------------------
-NeonHeadRequest::NeonHeadRequest( HttpSession* inSession,
+NeonHeadRequest::NeonHeadRequest( HttpSession * inSession,
const rtl::OUString & inPath,
const std::vector< ::rtl::OUString > &
inHeaderNames,
@@ -174,16 +110,9 @@ NeonHeadRequest::NeonHeadRequest( HttpSession* inSession,
inPath,
RTL_TEXTENCODING_UTF8 ) );
-#if NEON_VERSION < 0x0250
- NeonHeadRequestContext aCtx( &ioResource, &inHeaderNames );
- ne_add_response_header_catcher( req, NHR_ResponseHeaderCatcher, &aCtx );
-#endif
-
nError = ne_request_dispatch( req );
-#if NEON_VERSION >= 0x0250
- process_headers(req, ioResource, inHeaderNames);
-#endif
+ process_headers( req, ioResource, inHeaderNames );
if ( nError == NE_OK && ne_get_status( req )->klass != 2 )
nError = NE_ERROR;
diff --git a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
index 85b5ea0393e0..f794516d20aa 100644
--- a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
+++ b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
@@ -191,22 +191,13 @@ extern "C" int NPFR_propfind_iter( void* userdata,
// -------------------------------------------------------------------
extern "C" void NPFR_propfind_results( void* userdata,
-#if NEON_VERSION >= 0x0260
const ne_uri* uri,
-#else
- const char* href,
-#endif
const NeonPropFindResultSet* set )
{
// @@@ href is not the uri! DAVResource ctor wants uri!
-#if NEON_VERSION >= 0x0260
DAVResource theResource(
OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) );
-#else
- DAVResource theResource(
- OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) );
-#endif
ne_propset_iterate( set, NPFR_propfind_iter, &theResource );
@@ -233,22 +224,13 @@ extern "C" int NPFR_propnames_iter( void* userdata,
// -------------------------------------------------------------------
extern "C" void NPFR_propnames_results( void* userdata,
-#if NEON_VERSION >= 0x0260
const ne_uri* uri,
-#else
- const char* href,
-#endif
const NeonPropFindResultSet* results )
{
// @@@ href is not the uri! DAVResourceInfo ctor wants uri!
// Create entry for the resource.
-#if NEON_VERSION >= 0x0260
DAVResourceInfo theResource(
OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) );
-#else
- DAVResourceInfo theResource(
- OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) );
-#endif
// Fill entry.
ne_propset_iterate( results, NPFR_propnames_iter, &theResource );
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index 254fae546940..dca92a040af0 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -184,11 +184,7 @@ struct NeonRequestContext
// A simple Neon response_block_reader for use with an XInputStream
// -------------------------------------------------------------------
-#if NEON_VERSION >= 0x0250
extern "C" int NeonSession_ResponseBlockReader(void * inUserData,
-#else
-extern "C" void NeonSession_ResponseBlockReader(void * inUserData,
-#endif
const char * inBuf,
size_t inLen )
{
@@ -204,9 +200,7 @@ extern "C" void NeonSession_ResponseBlockReader(void * inUserData,
if ( xInputStream.is() )
xInputStream->AddToStream( inBuf, inLen );
}
-#if NEON_VERSION >= 0x0250
return 0;
-#endif
}
// -------------------------------------------------------------------
@@ -214,11 +208,7 @@ extern "C" void NeonSession_ResponseBlockReader(void * inUserData,
// A simple Neon response_block_reader for use with an XOutputStream
// -------------------------------------------------------------------
-#if NEON_VERSION >= 0x0250
extern "C" int NeonSession_ResponseBlockWriter( void * inUserData,
-#else
-extern "C" void NeonSession_ResponseBlockWriter( void * inUserData,
-#endif
const char * inBuf,
size_t inLen )
{
@@ -236,9 +226,7 @@ extern "C" void NeonSession_ResponseBlockWriter( void * inUserData,
xOutputStream->writeBytes( aSeq );
}
}
-#if NEON_VERSION >= 0x0250
return 0;
-#endif
}
// -------------------------------------------------------------------
@@ -1926,17 +1914,11 @@ int NeonSession::GET( ne_session * sess,
void *cursor = NULL;
const char *name, *value;
-#if NEON_VERSION < 0x0250
- if ( getheaders )
- ne_add_response_header_catcher(
- req, runResponseHeaderHandler, userdata );
-#endif
ne_decompress * dc
= ne_decompress_reader( req, ne_accept_2xx, reader, userdata );
ret = ne_request_dispatch( req );
-#if NEON_VERSION >= 0x0250
if ( getheaders )
{
while ( ( cursor = ne_response_header_iterate(
@@ -1948,7 +1930,7 @@ int NeonSession::GET( ne_session * sess,
runResponseHeaderHandler(userdata, buffer);
}
}
-#endif
+
if ( ret == NE_OK && ne_get_status( req )->klass != 2 )
ret = NE_ERROR;
diff --git a/ucb/source/ucp/webdav/NeonUri.cxx b/ucb/source/ucp/webdav/NeonUri.cxx
index 774faa06b9dd..27f24c631161 100644
--- a/ucb/source/ucp/webdav/NeonUri.cxx
+++ b/ucb/source/ucp/webdav/NeonUri.cxx
@@ -59,36 +59,24 @@ using namespace webdav_ucp;
namespace {
const ne_uri g_sUriDefaultsHTTP = { "http",
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
DEFAULT_HTTP_PORT,
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
NULL };
const ne_uri g_sUriDefaultsHTTPS = { "https",
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
DEFAULT_HTTPS_PORT,
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
NULL };
const ne_uri g_sUriDefaultsFTP = { "ftp",
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
DEFAULT_FTP_PORT,
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
NULL };
} // namespace
@@ -174,11 +162,7 @@ void NeonUri::init( const rtl::OString & rUri, const ne_uri * pUri )
pUri->scheme ? pUri->scheme : pUriDefs->scheme,
RTL_TEXTENCODING_UTF8 );
mUserInfo = rtl::OStringToOUString(
-#if NEON_VERSION >= 0x0260
pUri->userinfo ? pUri->userinfo : pUriDefs->userinfo,
-#else
- pUri->authinfo ? pUri->authinfo : pUriDefs->authinfo,
-#endif
RTL_TEXTENCODING_UTF8 );
mHostName = rtl::OStringToOUString(
pUri->host ? pUri->host : pUriDefs->host,
@@ -188,7 +172,6 @@ void NeonUri::init( const rtl::OString & rUri, const ne_uri * pUri )
pUri->path ? pUri->path : pUriDefs->path,
RTL_TEXTENCODING_UTF8 );
-#if NEON_VERSION >= 0x0260
if ( pUri->query )
{
mPath += rtl::OUString::createFromAscii( "?" );
@@ -202,7 +185,6 @@ void NeonUri::init( const rtl::OString & rUri, const ne_uri * pUri )
mPath += rtl::OStringToOUString(
pUri->fragment, RTL_TEXTENCODING_UTF8 );
}
-#endif
}
// -------------------------------------------------------------------
diff --git a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
index 1ce4c70e6b21..42f30c665b61 100644
--- a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
+++ b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
@@ -373,11 +373,7 @@ bool UCBDeadPropertyValue::createFromXML( const rtl::OString & rInData,
ne_xml_parse( parser, rInData.getStr(), rInData.getLength() );
-#if NEON_VERSION >= 0x0250
success = !ne_xml_failed( parser );
-#else
- success = !!ne_xml_valid( parser );
-#endif
ne_xml_destroy( parser );