[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp loolwsd/LOOLWSD.hpp
Henry Castro
hcastro at collabora.com
Sun Feb 21 12:28:44 UTC 2016
loolwsd/LOOLWSD.cpp | 1 -
loolwsd/LOOLWSD.hpp | 12 +-----------
2 files changed, 1 insertion(+), 12 deletions(-)
New commits:
commit ba47e28581fbb3ff7076ba3c01b3e826f18a3731
Author: Henry Castro <hcastro at collabora.com>
Date: Sun Feb 21 08:26:29 2016 -0400
loolwsd: re-work UriToDocumentURIMap
This is not in synchronization with lokit process because
it is normal that lokit dies now.
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 276c5fe..b242df9 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -156,7 +156,6 @@ using Poco::URI;
// Document management mutex.
std::mutex DocumentURI::DocumentURIMutex;
-std::map<std::string, std::shared_ptr<DocumentURI>> DocumentURI::UriToDocumentURIMap;
/// Handles the filename part of the convert-to POST request payload.
class ConvertToPartHandler : public Poco::Net::PartHandler
diff --git a/loolwsd/LOOLWSD.hpp b/loolwsd/LOOLWSD.hpp
index 279f201..db26497 100644
--- a/loolwsd/LOOLWSD.hpp
+++ b/loolwsd/LOOLWSD.hpp
@@ -50,14 +50,6 @@ public:
// In that case, we can use a pool and index by publicPath.
std::unique_lock<std::mutex> lock(DocumentURIMutex);
- // Find the document if already open.
- auto it = UriToDocumentURIMap.lower_bound(publicFilePath);
- if (it != UriToDocumentURIMap.end() && it->first == publicFilePath)
- {
- Log::info("DocumentURI [" + it->first + "] found.");
- return it->second;
- }
-
// The URL is the publicly visible one, not visible in the chroot jail.
// We need to map it to a jailed path and copy the file there.
auto uriJailed = uriPublic;
@@ -114,8 +106,7 @@ public:
auto document = std::shared_ptr<DocumentURI>(new DocumentURI(uriPublic, uriJailed, childId));
Log::info("DocumentURI [" + publicFilePath + "] created.");
- it = UriToDocumentURIMap.emplace_hint(it, publicFilePath, document);
- return it->second;
+ return document;
}
Poco::URI getPublicUri() const { return _uriPublic; }
@@ -136,7 +127,6 @@ private:
// DocumentURI management mutex.
static std::mutex DocumentURIMutex;
- static std::map<std::string, std::shared_ptr<DocumentURI>> UriToDocumentURIMap;
private:
const Poco::URI _uriPublic;
More information about the Libreoffice-commits
mailing list