[Libreoffice-commits] online.git: loleaflet/js net/Socket.cpp wsd/ProxyProtocol.cpp

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 24 17:55:17 UTC 2020


 loleaflet/js/global.js |    4 ++--
 net/Socket.cpp         |    1 -
 wsd/ProxyProtocol.cpp  |    7 +++++++
 3 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 6e7977bbb8396f205a3f3e697a81d00a5e835f83
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Tue Apr 14 17:01:41 2020 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Apr 24 19:55:00 2020 +0200

    Proxy: improve debugging and connection handling.
    
    Change-Id: I1d48c4ec7fb80eaab1aabc83b0c210b7cf138ef2
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92815
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index aacf59496..cc1ab2090 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -260,7 +260,6 @@
 		this.sendQueue = '';
 		this.sendTimeout = undefined;
 		this.doSend = function () {
-			that.sendTimeout = undefined;
 			console.debug('send msg "' + that.sendQueue + '"');
 			var req = new XMLHttpRequest();
 			req.open('POST', that.getEndPoint('write'));
@@ -279,6 +278,7 @@
 			}
 			req.send(that.sendQueue);
 			that.sendQueue = '';
+			that.sendTimeout = undefined;
 		};
 		this.getSessionId = function() {
 			var req = new XMLHttpRequest();
@@ -318,7 +318,7 @@
 		// horrors ...
 		this.waitConnect = function() {
 			console.debug('proxy: waiting - ' + that.readWaiting + ' on session ' + that.sessionId);
-			if (that.readWaiting > 4) // max 4 waiting connections concurrently.
+			if (that.readWaiting >= 4) // max 4 waiting connections concurrently.
 				return;
 			if (that.sessionId == 'fetchsession')
 				return; // waiting for our session id.
diff --git a/net/Socket.cpp b/net/Socket.cpp
index 24041bc4b..0b7a2f2ff 100644
--- a/net/Socket.cpp
+++ b/net/Socket.cpp
@@ -219,7 +219,6 @@ int SocketPoll::poll(int64_t timeoutMaxMicroS)
         timeout.tv_sec = timeoutMaxMicroS / (1000 * 1000);
         timeout.tv_nsec = (timeoutMaxMicroS % (1000 * 1000)) * 1000;
         rc = ::ppoll(&_pollFds[0], size + 1, &timeout, nullptr);
-        LOG_TRC("ppoll result " << rc << " errno " << strerror(errno));
 #  else
         int timeoutMaxMs = (timeoutMaxMicroS + 9999) / 1000;
         LOG_TRC("Legacy Poll start, timeoutMs: " << timeoutMaxMs);
diff --git a/wsd/ProxyProtocol.cpp b/wsd/ProxyProtocol.cpp
index 3ed43e979..c8a259abe 100644
--- a/wsd/ProxyProtocol.cpp
+++ b/wsd/ProxyProtocol.cpp
@@ -219,6 +219,13 @@ void ProxyProtocolHandler::getIOStats(uint64_t &sent, uint64_t &recv)
 void ProxyProtocolHandler::dumpState(std::ostream& os)
 {
     os << "proxy protocol sockets: " << _outSockets.size() << " writeQueue: " << _writeQueue.size() << ":\n";
+    os << "\t";
+    for (auto &it : _outSockets)
+    {
+        auto sock = it.lock();
+        os << "#" << (sock ? sock->getFD() : -2) << " ";
+    }
+    os << "\n";
     for (auto it : _writeQueue)
         Util::dumpHex(os, "\twrite queue entry:", "\t\t", *it);
     if (_msgHandler)


More information about the Libreoffice-commits mailing list