[Libreoffice-commits] online.git: wsd/DocumentBroker.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Jan 23 05:44:00 UTC 2017


 wsd/DocumentBroker.cpp |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit 11d7d8c595b719c2dd330c4459de2bec77b62cc9
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Jan 22 23:12:51 2017 -0500

    wsd: log the fingerprint of WOPI files
    
    Change-Id: I99bd77c2ae892876d82bab64210bd132f34ed364
    Reviewed-on: https://gerrit.libreoffice.org/33439
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 9c3742e..d5fb25a 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -18,11 +18,14 @@
 #include <Poco/JSON/Object.h>
 #include <Poco/Path.h>
 #include <Poco/SHA1Engine.h>
+#include <Poco/DigestStream.h>
+#include <Poco/StreamCopier.h>
 #include <Poco/StringTokenizer.h>
 
 #include "Admin.hpp"
 #include "ClientSession.hpp"
 #include "Exceptions.hpp"
+#include "Message.hpp"
 #include "Protocol.hpp"
 #include "LOOLWSD.hpp"
 #include "Log.hpp"
@@ -345,6 +348,14 @@ bool DocumentBroker::load(std::shared_ptr<ClientSession>& session, const std::st
     if (!_storage->isLoaded())
     {
         const auto localPath = _storage->loadStorageFileToLocal();
+
+        std::ifstream istr(localPath, std::ios::binary);
+        Poco::SHA1Engine sha1;
+        Poco::DigestOutputStream dos(sha1);
+        Poco::StreamCopier::copyStream(istr, dos);
+        dos.close();
+        LOG_INF("SHA1 of [" << localPath << "]: " << Poco::DigestEngine::digestToHex(sha1.digest()));
+
         _uriJailed = Poco::URI(Poco::URI("file://"), localPath);
         _filename = fileInfo._filename;
 


More information about the Libreoffice-commits mailing list