diff options
author | Rüdiger Timm <rt@openoffice.org> | 2006-02-09 13:25:55 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2006-02-09 13:25:55 +0000 |
commit | 6c59b333c3de1329ee4fd8ac1ebbfea0650f24bd (patch) | |
tree | 47322c081d91966d41ec9379cb86549b142b9686 /ucb/source | |
parent | 6ebce809112555c87e440c5c78668fec671e0ce7 (diff) |
INTEGRATION: CWS nfslockproblem (1.3.32); FILE MERGED
2006/01/26 16:21:14 kso 1.3.32.1: #i61178# - conditional compile time support for neon 0.25.x
(neon API has again changed incompatible).
Diffstat (limited to 'ucb/source')
-rw-r--r-- | ucb/source/ucp/webdav/NeonHeadRequest.cxx | 63 |
1 files changed, 61 insertions, 2 deletions
diff --git a/ucb/source/ucp/webdav/NeonHeadRequest.cxx b/ucb/source/ucp/webdav/NeonHeadRequest.cxx index 39af20bd2eb0..ea01786632c5 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.3 $ + * $Revision: 1.4 $ * - * last change: $Author: rt $ $Date: 2005-09-09 16:11:23 $ + * last change: $Author: rt $ $Date: 2006-02-09 14:25:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -51,6 +51,58 @@ using namespace webdav_ucp; using namespace com::sun::star; +#ifdef NEONTWOFIVE +static void process_headers(ne_request *req, + DAVResource &rResource, + const std::vector< ::rtl::OUString > &rHeaderNames) +{ + void *cursor = NULL; + const char *name, *value; + + 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 ) ); + + // Note: Empty vector means that all headers are requested. + bool bIncludeIt = ( rHeaderNames.size() == 0 ); + + if ( !bIncludeIt ) + { + // Check whether this header was requested. + std::vector< ::rtl::OUString >::const_iterator it( + rHeaderNames.begin() ); + const std::vector< ::rtl::OUString >::const_iterator end( + rHeaderNames.end() ); + + while ( it != end ) + { + if ( (*it) == aHeaderName ) + break; + + ++it; + } + + if ( it != end ) + bIncludeIt = true; + } + + if ( bIncludeIt ) + { + // Create & set the PropertyValue + beans::PropertyValue thePropertyValue; + thePropertyValue.Handle = -1; + thePropertyValue.Name = aHeaderName; + thePropertyValue.State = beans::PropertyState_DIRECT_VALUE; + + thePropertyValue.Value <<= aHeaderValue; + + // Add the newly created PropertyValue + rResource.properties.push_back( thePropertyValue ); + } + } +} +#else struct NeonHeadRequestContext { DAVResource * pResource; @@ -113,6 +165,7 @@ extern "C" void NHR_ResponseHeaderCatcher( void * userdata, } } } +#endif // ------------------------------------------------------------------- @@ -137,11 +190,17 @@ NeonHeadRequest::NeonHeadRequest( HttpSession* inSession, inPath, RTL_TEXTENCODING_UTF8 ) ); +#ifndef NEONTWOFIVE NeonHeadRequestContext aCtx( &ioResource, &inHeaderNames ); ne_add_response_header_catcher( req, NHR_ResponseHeaderCatcher, &aCtx ); +#endif nError = ne_request_dispatch( req ); +#ifdef NEONTWOFIVE + process_headers(req, ioResource, inHeaderNames); +#endif + if ( nError == NE_OK && ne_get_status( req )->klass != 2 ) nError = NE_ERROR; |