[Libreoffice-commits] core.git: ucb/source
Matúš Kukan
matus.kukan at collabora.com
Tue Mar 18 12:55:16 PDT 2014
ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx | 5 -
ucb/source/ucp/webdav/webdavprovider.cxx | 69 ---------------------
ucb/source/ucp/webdav/webdavuseragent.hxx | 34 ----------
3 files changed, 1 insertion(+), 107 deletions(-)
New commits:
commit 0e082ac24bfb4e6924539e4814901ce814880737
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Tue Mar 18 20:38:54 2014 +0100
webdav: Use just "LibreOffice" as "User-Agent" as in webdav-neon.
Change-Id: Ia69f0be3fbbeb33f4331bc66b9ac5204d330e42a
diff --git a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx
index 57093d4..0c89790 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 ecc3c9a..16684d8 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 7c954de..0000000
--- 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
More information about the Libreoffice-commits
mailing list