diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-03-18 20:38:54 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-03-18 20:54:30 +0100 |
commit | 0e082ac24bfb4e6924539e4814901ce814880737 (patch) | |
tree | 80a7fdba3e2b834a6e734c17dfa8e4f0ba8e4dc1 | |
parent | d69346b170a627b039ac1309d427aa3ef764f628 (diff) |
webdav: Use just "LibreOffice" as "User-Agent" as in webdav-neon.
Change-Id: Ia69f0be3fbbeb33f4331bc66b9ac5204d330e42a
-rw-r--r-- | ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavprovider.cxx | 69 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavuseragent.hxx | 34 |
3 files changed, 1 insertions, 107 deletions
diff --git a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx index 57093d4c304d..0c8979093988 100644 --- a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx +++ b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx @@ -18,7 +18,6 @@ */ #include "SerfRequestProcessorImpl.hxx" -#include "webdavuseragent.hxx" namespace { @@ -105,10 +104,8 @@ void SerfRequestProcessorImpl::setRequestHeaders( serf_bucket_t* inoutSerfHeader if ( !bHasUserAgent ) { - const OUString &rUserAgent = WebDAVUserAgent::get(); serf_bucket_headers_set( inoutSerfHeaderBucket, - "User-Agent", - OUStringToOString( rUserAgent, RTL_TEXTENCODING_UTF8 ).getStr() ); + "User-Agent", "LibreOffice" ); } serf_bucket_headers_set( inoutSerfHeaderBucket, "Accept-Encoding", "gzip"); diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx index ecc3c9af959a..16684d8d8bfa 100644 --- a/ucb/source/ucp/webdav/webdavprovider.cxx +++ b/ucb/source/ucp/webdav/webdavprovider.cxx @@ -20,7 +20,6 @@ #include <ucbhelper/contentidentifier.hxx> #include "webdavprovider.hxx" #include "webdavcontent.hxx" -#include "webdavuseragent.hxx" #include <osl/mutex.hxx> #include <rtl/ustrbuf.hxx> @@ -32,30 +31,6 @@ using namespace com::sun::star; using namespace http_dav_ucp; -OUString &WebDAVUserAgent::operator()() const -{ - OUStringBuffer aBuffer; - aBuffer.append( "$ooName/$ooSetupVersion" ); -#if OSL_DEBUG_LEVEL > 0 -#ifdef APR_VERSION - aBuffer.append( " apr/" APR_VERSION ); -#endif - -#ifdef APR_UTIL_VERSION - aBuffer.append( " apr-util/" APR_UTIL_VERSION ); -#endif - -#ifdef SERF_VERSION - aBuffer.append( " serf/" SERF_VERSION ); -#endif -#endif - static OUString aUserAgent( aBuffer.makeStringAndClear() ); - return aUserAgent; -} - - - - // ContentProvider Implementation. @@ -67,50 +42,6 @@ ContentProvider::ContentProvider( m_xDAVSessionFactory( new DAVSessionFactory() ), m_pProps( 0 ) { - static bool bInit = false; - if ( bInit ) - return; - bInit = true; - try - { - uno::Reference< lang::XMultiServiceFactory > xConfigProvider( - rContext->getServiceManager()->createInstanceWithContext( - OUString("com.sun.star.configuration.ConfigurationProvider"), rContext), - uno::UNO_QUERY_THROW ); - - beans::NamedValue aNodePath; - aNodePath.Name = "nodepath"; - aNodePath.Value <<= OUString( "/org.openoffice.Setup/Product"); - - uno::Sequence< uno::Any > aArgs( 1 ); - aArgs[0] <<= aNodePath; - - uno::Reference< container::XNameAccess > xConfigAccess( - xConfigProvider->createInstanceWithArguments( - OUString("com.sun.star.configuration.ConfigurationAccess"), aArgs), - uno::UNO_QUERY_THROW ); - - OUString aVal; - xConfigAccess->getByName(OUString("ooName")) >>= aVal; - - OUString &aUserAgent = WebDAVUserAgent::get(); - sal_Int32 nIndex = aUserAgent.indexOf( "$ooName" ); - if ( !aVal.getLength() || nIndex == -1 ) - return; - aUserAgent = aUserAgent.replaceAt( nIndex, RTL_CONSTASCII_LENGTH( "$ooName" ), aVal ); - - xConfigAccess->getByName(OUString("ooSetupVersion")) >>= aVal; - nIndex = aUserAgent.indexOf( "$ooSetupVersion" ); - if ( !aVal.getLength() || nIndex == -1 ) - return; - aUserAgent = aUserAgent.replaceAt( nIndex, RTL_CONSTASCII_LENGTH( "$ooSetupVersion" ), aVal ); - - } - catch ( const uno::Exception &e ) - { - SAL_INFO("ucb.ucp.webdav", "ContentProvider -caught exception! : " << e.Message); - (void) e; - } } diff --git a/ucb/source/ucp/webdav/webdavuseragent.hxx b/ucb/source/ucp/webdav/webdavuseragent.hxx deleted file mode 100644 index 7c954dedabf8..000000000000 --- a/ucb/source/ucp/webdav/webdavuseragent.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_WEBDAV_UCP_USERAGENT_HXX -#define INCLUDED_WEBDAV_UCP_USERAGENT_HXX - -#include <rtl/ustring.hxx> -#include <rtl/instance.hxx> - -namespace http_dav_ucp { - -struct WebDAVUserAgent - : public ::rtl::StaticWithInit< OUString, WebDAVUserAgent > -{ - OUString &operator()() const; -}; - -} - -#endif |