From 93a0696e74e96e5a5ca821f33cb791b87e876f49 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 16 Sep 2015 10:17:56 +0200 Subject: Related rhbz#1259746: Buffer file content read from GIO UCP ...for one, this avoids sending seek requests down the GIO/GVFS stack, which can silently fail with corrupt data read from certain broken servers for current versions of the GIO/GVFS stack; for another, it should considerably speed up loading documents via the GIO UCP, as LO's document type detection is notorious for issuing lots of seek and (small-chunk and/or re-) read operations on a file. (This issue has become more relevant after 51e0d789c344547956764c3b5f0ef5a304f4e0aa "rhbz#1134285: Access dav, davs URLs via GVFS," where the old route via the WebDAV UCP was apparently not affected by those broken servers, so happened to start affecting opening certain remote files in LO via Nautilus.) Change-Id: I91f91128b2d1a16f976eafeacf216a91747f4df1 --- ucb/source/ucp/gio/gio_content.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ucb/source/ucp/gio/gio_content.cxx') diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index 83b07fcbfd23..70f7fd1b6a31 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -59,6 +59,7 @@ #include #include +#include #include #include #include @@ -846,9 +847,9 @@ bool Content::feedSink( uno::Reference< uno::XInterface > xSink, if (!pStream) convertToException(pError, static_cast< cppu::OWeakObject * >(this)); - uno::Reference< io::XInputStream > xIn = new ::gio::InputStream(pStream); - if ( !xIn.is() ) - return false; + uno::Reference< io::XInputStream > xIn( + new comphelper::OSeekableInputWrapper( + new ::gio::InputStream(pStream), m_xContext)); if ( xOut.is() ) copyData( xIn, xOut ); -- cgit