diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-22 12:01:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-07-24 13:24:55 +0000 |
commit | 738cf411e9315d17c7eb8be47ded643a00dfe5c5 (patch) | |
tree | c261abfb8bb2b3f4787ef02850107422a65ea77e /package/inc | |
parent | eb7516064df402f35f8bbfa7c1962f49aa6a7c00 (diff) |
Resolves: tdf#88314 close temp file after each thread completes
and reopen them when we need their data.
That way we don't have as many open files as substreams in the
package, so we don't run out of file handles
Change-Id: Ic124e275abf15f4578c77ee271d185f40cb844b1
Reviewed-on: https://gerrit.libreoffice.org/17289
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'package/inc')
-rw-r--r-- | package/inc/ZipOutputEntry.hxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/package/inc/ZipOutputEntry.hxx b/package/inc/ZipOutputEntry.hxx index 2a5aa0483ce8..d8d0ee65c6a6 100644 --- a/package/inc/ZipOutputEntry.hxx +++ b/package/inc/ZipOutputEntry.hxx @@ -37,7 +37,8 @@ class ZipOutputEntry { ::com::sun::star::uno::Sequence< sal_Int8 > m_aDeflateBuffer; ZipUtils::Deflater m_aDeflater; - css::uno::Reference< css::io::XTempFile > m_xTempFile; + css::uno::Reference< css::uno::XComponentContext > m_xContext; + OUString m_aTempURL; css::uno::Reference< css::io::XOutputStream > m_xOutStream; ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XCipherContext > m_xCipherContext; @@ -58,14 +59,18 @@ public: ~ZipOutputEntry(); - css::uno::Reference< css::io::XInputStream > getData(); + /* This block of methods is for threaded zipping, where we compress to a temp stream, whose + data is retrieved via getData */ + void createBufferFile(); + void setParallelDeflateException(const ::css::uno::Any &rAny) { m_aParallelDeflateException = rAny; } + css::uno::Reference< css::io::XInputStream > getData() const; + ::css::uno::Any getParallelDeflateException() const { return m_aParallelDeflateException; } + void closeBufferFile(); + ZipEntry* getZipEntry() { return m_pCurrentEntry; } ZipPackageStream* getZipPackageStream() { return m_pCurrentStream; } bool isEncrypt() { return m_bEncryptCurrentEntry; } - void setParallelDeflateException(const ::css::uno::Any &rAny) { m_aParallelDeflateException = rAny; } - ::css::uno::Any getParallelDeflateException() const { return m_aParallelDeflateException; } - void closeEntry(); void write(const css::uno::Sequence< sal_Int8 >& rBuffer); |