diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-20 16:46:59 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-20 16:55:20 +0200 |
commit | d6c3e998dbb61eedf37773082bf58ffbd11663b0 (patch) | |
tree | ded84435440d80257d0d79d17ad9647bd07f2151 /common/listener.cpp | |
parent | dfb0495ead6cf25f1e9e1ed03a78d249ae2f4498 (diff) | |
download | sink-d6c3e998dbb61eedf37773082bf58ffbd11663b0.tar.gz sink-d6c3e998dbb61eedf37773082bf58ffbd11663b0.zip |
Draft of ChangeReplay
Diffstat (limited to 'common/listener.cpp')
-rw-r--r-- | common/listener.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/listener.cpp b/common/listener.cpp index 16da770..6e6808a 100644 --- a/common/listener.cpp +++ b/common/listener.cpp | |||
@@ -114,6 +114,14 @@ void Listener::acceptConnection() | |||
114 | this, &Listener::clientDropped); | 114 | this, &Listener::clientDropped); |
115 | m_checkConnectionsTimer->stop(); | 115 | m_checkConnectionsTimer->stop(); |
116 | 116 | ||
117 | //If this is the first client, set the lower limit for revision cleanup | ||
118 | if (m_connections.size() == 1) { | ||
119 | loadResource(); | ||
120 | if (m_resource) { | ||
121 | m_resource->setLowerBoundRevision(0); | ||
122 | } | ||
123 | } | ||
124 | |||
117 | if (socket->bytesAvailable()) { | 125 | if (socket->bytesAvailable()) { |
118 | readFromSocket(socket); | 126 | readFromSocket(socket); |
119 | } | 127 | } |
@@ -146,6 +154,13 @@ void Listener::clientDropped() | |||
146 | 154 | ||
147 | void Listener::checkConnections() | 155 | void Listener::checkConnections() |
148 | { | 156 | { |
157 | //If this was the last client, disengage the lower limit for revision cleanup | ||
158 | if (m_connections.isEmpty()) { | ||
159 | loadResource(); | ||
160 | if (m_resource) { | ||
161 | m_resource->setLowerBoundRevision(std::numeric_limits<qint64>::max()); | ||
162 | } | ||
163 | } | ||
149 | m_checkConnectionsTimer->start(); | 164 | m_checkConnectionsTimer->start(); |
150 | } | 165 | } |
151 | 166 | ||