[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp loolwsd/Storage.cpp

Tor Lillqvist tml at collabora.com
Tue Oct 4 12:44:53 UTC 2016


 loolwsd/LOOLWSD.cpp |   14 +++++++-------
 loolwsd/Storage.cpp |    8 ++++----
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit c453f2626a60a02c9a20baaa3fff4846fee06253
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Oct 4 15:10:45 2016 +0300

    Let's not use lcl_ prefixes here

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 95ce1fc..23d73e6 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -177,7 +177,7 @@ static int careerSpanSeconds = 0;
 namespace {
 
 static inline
-void lcl_shutdownLimitReached(WebSocket& ws)
+void shutdownLimitReached(WebSocket& ws)
 {
     const std::string error = Poco::format(PAYLOAD_UNAVALABLE_LIMIT_REACHED, MAX_DOCUMENTS, MAX_CONNECTIONS);
     const std::string close = Poco::format(SERVICE_UNAVALABLE_LIMIT_REACHED, static_cast<int>(WebSocket::WS_POLICY_VIOLATION));
@@ -717,7 +717,7 @@ private:
             {
                 --LOOLWSD::NumDocBrokers;
                 Log::error("Maximum number of open documents reached.");
-                lcl_shutdownLimitReached(*ws);
+                shutdownLimitReached(*ws);
                 return;
             }
 #endif
@@ -945,7 +945,7 @@ public:
             Log::error("Maximum number of connections reached.");
             // accept hand shake
             WebSocket ws(request, response);
-            lcl_shutdownLimitReached(ws);
+            shutdownLimitReached(ws);
             return;
         }
 #endif
@@ -1362,14 +1362,14 @@ public:
 namespace {
 
 static inline
-ServerSocket* lcl_getServerSocket(int nClientPortNumber)
+ServerSocket* getServerSocket(int nClientPortNumber)
 {
     return (LOOLWSD::isSSLEnabled()) ? new SecureServerSocket(nClientPortNumber)
                        : new ServerSocket(nClientPortNumber);
 }
 
 static inline
-std::string lcl_getLaunchURI()
+std::string getLaunchURI()
 {
     std::string aAbsTopSrcDir = Poco::Path(Application::instance().commandPath()).parent().toString();
     aAbsTopSrcDir = Poco::Path(aAbsTopSrcDir).absolute().toString();
@@ -1618,7 +1618,7 @@ void LOOLWSD::initialize(Application& self)
 
 #if ENABLE_DEBUG
     std::cerr << "\nLaunch this in your browser:\n\n" <<
-        lcl_getLaunchURI() <<
+        getLaunchURI() <<
         "\n\nFull log is available in: " << LOOLWSD_LOGFILE << std::endl;
 #endif
 }
@@ -1901,7 +1901,7 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
 
     // Start a server listening on the port for clients
 
-    std::unique_ptr<ServerSocket> psvs(lcl_getServerSocket(ClientPortNumber));
+    std::unique_ptr<ServerSocket> psvs(getServerSocket(ClientPortNumber));
 
     ThreadPool threadPool(NumPreSpawnedChildren*6, MAX_SESSIONS * 2);
     HTTPServer srv(new ClientRequestHandlerFactory(), threadPool, *psvs, params1);
diff --git a/loolwsd/Storage.cpp b/loolwsd/Storage.cpp
index f320e2e..631b300 100644
--- a/loolwsd/Storage.cpp
+++ b/loolwsd/Storage.cpp
@@ -244,7 +244,7 @@ bool LocalStorage::saveLocalFileToStorage()
 namespace {
 
 static inline
-Poco::Net::HTTPClientSession* lcl_getHTTPClientSession(const Poco::URI& uri)
+Poco::Net::HTTPClientSession* getHTTPClientSession(const Poco::URI& uri)
 {
     return (LOOLWSD::isSSLEnabled() || LOOLWSD::isSSLTermination()) ? new Poco::Net::HTTPSClientSession(uri.getHost(), uri.getPort(), Poco::Net::SSLManager::instance().defaultClientContext())
                        : new Poco::Net::HTTPClientSession(uri.getHost(), uri.getPort());
@@ -256,7 +256,7 @@ StorageBase::FileInfo WopiStorage::getFileInfo(const Poco::URI& uri)
 {
     Log::debug("Getting info for wopi uri [" + uri.toString() + "].");
 
-    std::unique_ptr<Poco::Net::HTTPClientSession> psession(lcl_getHTTPClientSession(uri));
+    std::unique_ptr<Poco::Net::HTTPClientSession> psession(getHTTPClientSession(uri));
 
     Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, uri.getPathAndQuery(), Poco::Net::HTTPMessage::HTTP_1_1);
     request.set("User-Agent", "LOOLWSD WOPI Agent");
@@ -319,7 +319,7 @@ std::string WopiStorage::loadStorageFileToLocal()
     const auto url = uriObject.getPath() + "/contents?" + uriObject.getQuery();
     Log::debug("Wopi requesting: " + url);
 
-    std::unique_ptr<Poco::Net::HTTPClientSession> psession(lcl_getHTTPClientSession(uriObject));
+    std::unique_ptr<Poco::Net::HTTPClientSession> psession(getHTTPClientSession(uriObject));
 
     Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, url, Poco::Net::HTTPMessage::HTTP_1_1);
     request.set("User-Agent", "LOOLWSD WOPI Agent");
@@ -361,7 +361,7 @@ bool WopiStorage::saveLocalFileToStorage()
     const auto url = uriObject.getPath() + "/contents?" + uriObject.getQuery();
     Log::debug("Wopi posting: " + url);
 
-    std::unique_ptr<Poco::Net::HTTPClientSession> psession(lcl_getHTTPClientSession(uriObject));
+    std::unique_ptr<Poco::Net::HTTPClientSession> psession(getHTTPClientSession(uriObject));
 
     Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, url, Poco::Net::HTTPMessage::HTTP_1_1);
     request.set("X-WOPIOverride", "PUT");


More information about the Libreoffice-commits mailing list