summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2007-07-03 11:13:05 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2007-07-03 11:13:05 +0000
commitdf04e1dcc13256f250c2e87a8cb06a4365c5fea9 (patch)
tree19a9e7ed267e43f73e332188cc7df06ccbdd9da2
parent230526914a75f863e5fb1e3509bfe03cb432b09f (diff)
INTEGRATION: CWS neonupdate (1.6.54); FILE MERGED
2007/06/22 12:29:14 kso 1.6.54.2: RESYNC: (1.6-1.7); FILE MERGED 2007/06/21 15:15:26 kso 1.6.54.1: #i77023# - Removed support for neon < 0.26.
-rw-r--r--ucb/source/ucp/webdav/NeonHeadRequest.cxx84
1 files changed, 8 insertions, 76 deletions
diff --git a/ucb/source/ucp/webdav/NeonHeadRequest.cxx b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
index c3a9e62b5d35..f239b28ffbfb 100644
--- a/ucb/source/ucp/webdav/NeonHeadRequest.cxx
+++ b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: NeonHeadRequest.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: kz $ $Date: 2007-06-19 16:12:34 $
+ * last change: $Author: rt $ $Date: 2007-07-03 12:13:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -54,10 +54,11 @@
using namespace webdav_ucp;
using namespace com::sun::star;
-#if NEON_VERSION >= 0250
-static void process_headers(ne_request *req,
- DAVResource &rResource,
- const std::vector< ::rtl::OUString > &rHeaderNames)
+namespace {
+
+void process_headers(ne_request *req,
+ DAVResource &rResource,
+ const std::vector< ::rtl::OUString > &rHeaderNames)
{
void *cursor = NULL;
const char *name, *value;
@@ -103,70 +104,8 @@ static 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
// -------------------------------------------------------------------
// Constructor
@@ -190,16 +129,9 @@ NeonHeadRequest::NeonHeadRequest( HttpSession* inSession,
inPath,
RTL_TEXTENCODING_UTF8 ) );
-#if NEON_VERSION < 0250
- NeonHeadRequestContext aCtx( &ioResource, &inHeaderNames );
- ne_add_response_header_catcher( req, NHR_ResponseHeaderCatcher, &aCtx );
-#endif
-
nError = ne_request_dispatch( req );
-#if NEON_VERSION >= 0250
process_headers(req, ioResource, inHeaderNames);
-#endif
if ( nError == NE_OK && ne_get_status( req )->klass != 2 )
nError = NE_ERROR;