[Libreoffice-commits] online.git: kit/Kit.cpp net/loolnb.cpp net/Socket.hpp wsd/LOOLWSD.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Mar 13 04:11:43 UTC 2017


 kit/Kit.cpp     |    1 +
 net/Socket.hpp  |    4 ++--
 net/loolnb.cpp  |    2 +-
 wsd/LOOLWSD.cpp |   12 ++++++------
 4 files changed, 10 insertions(+), 9 deletions(-)

New commits:
commit 2e2f62eddeeb92761df1e1316aaa59687e2aac69
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Mar 12 18:34:06 2017 -0400

    wsd: improved logging
    
    Change-Id: I6c4a5bcd54c0748cc413afbfcfb34c365b347669
    Reviewed-on: https://gerrit.libreoffice.org/35118
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index c14007a..9886a8c 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1754,6 +1754,7 @@ void lokit_main(const std::string& childRoot,
         // Open websocket connection between the child process and WSD.
         HTTPClientSession cs("127.0.0.1", MasterPortNumber);
         cs.setTimeout(Poco::Timespan(10, 0)); // 10 second
+        LOG_DBG("Connecting to Master " << cs.getHost() << ':' << cs.getPort());
         HTTPRequest request(HTTPRequest::HTTP_GET, requestUrl);
         HTTPResponse response;
         auto ws = std::make_shared<LOOLWebSocket>(cs, request, response);
diff --git a/net/Socket.hpp b/net/Socket.hpp
index 88ef163..7071acd 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -427,9 +427,9 @@ public:
         auto it = std::find(_pollSockets.begin(), _pollSockets.end(), socket);
         assert(it != _pollSockets.end());
 
-        LOG_TRC("Release socket #" << socket->getFD() << " from " << _name);
-
         _pollSockets.erase(it);
+        LOG_TRC("Release socket #" << socket->getFD() << " from " << _name <<
+                " leaving " << _pollSockets.size());
     }
 
     const std::string& name() const { return _name; }
diff --git a/net/loolnb.cpp b/net/loolnb.cpp
index 041397a..566ab1e 100644
--- a/net/loolnb.cpp
+++ b/net/loolnb.cpp
@@ -86,7 +86,7 @@ public:
                     << "Connection: Closed\r\n"
                     << "\r\n"
                     << numberString;
-                ;
+
                 std::string str = oss.str();
                 socket->_outBuffer.insert(socket->_outBuffer.end(), str.begin(), str.end());
                 return;
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 98250b4..8444f07 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -1466,13 +1466,13 @@ private:
     /// Keep our socket around ...
     void onConnect(const std::weak_ptr<StreamSocket>& socket) override
     {
-        LOG_TRC("Prisoner - new socket\n");
+        LOG_TRC("Prisoner - new socket");
         _socket = socket;
     }
 
     void onDisconnect() override
     {
-        LOG_TRC("Prisoner connection disconnected\n");
+        LOG_TRC("Prisoner connection disconnected");
     }
 
     /// Called after successful socket reads.
@@ -1510,7 +1510,7 @@ private:
             auto logger = Log::info();
             if (logger.enabled())
             {
-                logger << "Prisoner HTTP Request: "
+                logger << "Prisoner HTTP Request from #" << socket->getFD() << ": "
                        << request.getMethod() << ' '
                        << request.getURI() << ' '
                        << request.getVersion();
@@ -1641,8 +1641,8 @@ private:
             disposeSession();
 
         const size_t curConnections = --LOOLWSD::NumConnections;
-        LOG_TRC("Disconnected connection #" << _connectionNum << " of " <<
-                (curConnections + 1) << " existing as session [" << _id << "].");
+        LOG_TRC("Disconnected connection #" << _connectionNum << " (of " <<
+                (curConnections + 1) << ") as session [" << _id << "].");
     }
 
     /// Called after successful socket reads.
@@ -1683,7 +1683,7 @@ private:
             auto logger = Log::info();
             if (logger.enabled())
             {
-                logger << "Client HTTP Request: "
+                logger << "Client HTTP Request: #" << socket->getFD() << ": "
                        << request.getMethod() << ' '
                        << request.getURI() << ' '
                        << request.getVersion();


More information about the Libreoffice-commits mailing list