diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2012-01-17 04:59:56 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2012-01-17 05:03:42 +0100 |
commit | 09954fc863c8ee900f157cab4458e1dcf51493d3 (patch) | |
tree | e8614237ecaa60406b7ba34c4822778b8c523f0c /extensions | |
parent | SvPtrarr->std::vector (diff) | |
download | core-09954fc863c8ee900f157cab4458e1dcf51493d3.tar.gz core-09954fc863c8ee900f157cab4458e1dcf51493d3.zip |
Fix UpdateCheck clog up server by keeping connection alive
The update check protocol uses the webdav ucp, which uses neon,
which in turn defaults to keeping the connection alive. this is nice
for webdav, but disastrous for millions of clients phoning home to
the same server.
Using neon directly in updatefeed.cxx is not an option, due to the
thread safety problems around that (see e.g. rhbz#544619) - so we
had to extend it to accept connection options, and reuse the
existing webdav provider.
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/update/feed/updatefeed.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index 09a98a76074c..944b7beb8f16 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -31,6 +31,7 @@ #include <cppuhelper/implbase4.hxx> #include <cppuhelper/implementationentry.hxx> #include <com/sun/star/beans/Property.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp> @@ -47,7 +48,7 @@ #include <com/sun/star/ucb/XContentIdentifierFactory.hpp> #include <com/sun/star/ucb/XContentProvider.hpp> #include "com/sun/star/ucb/XInteractionSupplyAuthentication.hpp" -#include <com/sun/star/ucb/OpenCommandArgument2.hpp> +#include <com/sun/star/ucb/OpenCommandArgument3.hpp> #include <com/sun/star/ucb/OpenMode.hpp> #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/task/PasswordContainerInteractionHandler.hpp> @@ -481,10 +482,18 @@ UpdateInformationProvider::load(const rtl::OUString& rURL) uno::Reference< ucb::XCommandProcessor > xCommandProcessor(m_xContentProvider->queryContent(xId), uno::UNO_QUERY_THROW); rtl::Reference< ActiveDataSink > aSink(new ActiveDataSink()); - ucb::OpenCommandArgument2 aOpenArgument; + // Disable KeepAlive in webdav - don't want millions of office + // instances phone home & clog up servers + uno::Sequence< beans::PropertyValue > aProps( 1 ); + aProps[ 0 ] = beans::PropertyValue( + UNISTRING("KeepAlive"), -1, + uno::makeAny(sal_False), beans::PropertyState_DIRECT_VALUE); + + ucb::OpenCommandArgument3 aOpenArgument; aOpenArgument.Mode = ucb::OpenMode::DOCUMENT; aOpenArgument.Priority = 32768; aOpenArgument.Sink = *aSink; + aOpenArgument.OpeningFlags = aProps; ucb::Command aCommand; aCommand.Name = UNISTRING("open"); |