[Libreoffice-commits] online.git: 3 commits - loleaflet/spec loolwsd/ChildProcessSession.cpp loolwsd/MasterProcessSession.cpp loolwsd/protocol.txt
Pranav Kant
pranavk at collabora.com
Thu Feb 18 19:02:41 UTC 2016
loleaflet/spec/tilebench/TileBenchSpec.js | 2 ++
loolwsd/ChildProcessSession.cpp | 11 ++++++++++-
loolwsd/MasterProcessSession.cpp | 14 +++++++++++++-
loolwsd/protocol.txt | 5 +++++
4 files changed, 30 insertions(+), 2 deletions(-)
New commits:
commit 5332e3f48c36955d6bbf53272dc645aaeae09a20
Author: Pranav Kant <pranavk at collabora.com>
Date: Fri Feb 19 00:08:07 2016 +0530
loleaflet: Make tile benchmark test work again
This broke after we introduced 'tilecombine' message.
Change-Id: Id273a859b22cac6b50ba759241d0b36d27829700
diff --git a/loleaflet/spec/tilebench/TileBenchSpec.js b/loleaflet/spec/tilebench/TileBenchSpec.js
index 87874e8..4d3077b 100644
--- a/loleaflet/spec/tilebench/TileBenchSpec.js
+++ b/loleaflet/spec/tilebench/TileBenchSpec.js
@@ -117,6 +117,7 @@ describe('TileBench', function () {
incoming.push(logs[i]);
}
else if (logs[i].direction === L.OUTGOING) {
+ logs[i].msg = logs[i].msg.replace('tilecombine','tile');
outgoing.push(logs[i]);
}
}
@@ -126,6 +127,7 @@ describe('TileBench', function () {
for (j = 0; j < incoming.length; j++) {
if (outgoing[i].msg === incoming[j].msg) {
time_deltas.push(incoming[j].time - outgoing[i].time);
+ break;
}
}
}
commit 9cf0cbf3a68f8717eed5c2dda882f92a2879fc36
Author: Pranav Kant <pranavk at collabora.com>
Date: Fri Feb 19 00:00:33 2016 +0530
loolwsd: Allow sending 'tilecombine' messages with 'timestamp'
... and revert back with this parameter in 'tile:' response
messages so that client can identify the response.
This is also required to make client-side tile benchmarking tests
work again.
Change-Id: I307aabf622b17f4dce727d1faf3c83eb566ba905
diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
index b32d4c5..6102a16 100644
--- a/loolwsd/ChildProcessSession.cpp
+++ b/loolwsd/ChildProcessSession.cpp
@@ -773,6 +773,7 @@ void ChildProcessSession::sendCombinedTiles(const char* /*buffer*/, int /*length
{
int part, pixelWidth, pixelHeight, tileWidth, tileHeight;
std::string tilePositionsX, tilePositionsY;
+ std::string reqTimestamp;
if (tokens.count() < 8 ||
!getTokenInteger(tokens[1], "part", part) ||
@@ -795,6 +796,9 @@ void ChildProcessSession::sendCombinedTiles(const char* /*buffer*/, int /*length
return;
}
+ if (tokens.count() > 8)
+ getTokenString(tokens[8], "timestamp", reqTimestamp);
+
Util::Rectangle renderArea;
StringTokenizer positionXtokens(tilePositionsX, ",", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
@@ -874,7 +878,12 @@ void ChildProcessSession::sendCombinedTiles(const char* /*buffer*/, int /*length
" tileposx=" + std::to_string(tileRect.getLeft()) +
" tileposy=" + std::to_string(tileRect.getTop()) +
" tilewidth=" + std::to_string(tileWidth) +
- " tileheight=" + std::to_string(tileHeight) + "\n";
+ " tileheight=" + std::to_string(tileHeight);
+
+ if (reqTimestamp != "")
+ response += " timestamp=" + reqTimestamp;
+
+ response += "\n";
std::vector<char> output;
output.reserve(pixelWidth * pixelHeight * 4 + response.size());
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index b7b4275..de04450 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -605,6 +605,7 @@ void MasterProcessSession::sendCombinedTiles(const char* /*buffer*/, int /*lengt
{
int part, pixelWidth, pixelHeight, tileWidth, tileHeight;
std::string tilePositionsX, tilePositionsY;
+ std::string reqTimestamp;
if (tokens.count() < 8 ||
!getTokenInteger(tokens[1], "part", part) ||
@@ -627,6 +628,9 @@ void MasterProcessSession::sendCombinedTiles(const char* /*buffer*/, int /*lengt
return;
}
+ if (tokens.count() > 8)
+ getTokenString(tokens[8], "timestamp", reqTimestamp);
+
Util::Rectangle renderArea;
StringTokenizer positionXtokens(tilePositionsX, ",", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
@@ -669,7 +673,12 @@ void MasterProcessSession::sendCombinedTiles(const char* /*buffer*/, int /*lengt
" tileposx=" + std::to_string(x) +
" tileposy=" + std::to_string(y) +
" tilewidth=" + std::to_string(tileWidth) +
- " tileheight=" + std::to_string(tileHeight) + "\n";
+ " tileheight=" + std::to_string(tileHeight);
+
+ if (reqTimestamp != "")
+ response += " timestamp=" + reqTimestamp;
+
+ response += "\n";
std::vector<char> output;
output.reserve(4 * pixelWidth * pixelHeight);
@@ -711,6 +720,9 @@ void MasterProcessSession::sendCombinedTiles(const char* /*buffer*/, int /*lengt
" tilewidth=" + std::to_string(tileWidth) +
" tileheight=" + std::to_string(tileHeight);
+ if (reqTimestamp != "")
+ forward += " timestamp=" + reqTimestamp;
+
forwardToPeer(forward.c_str(), forward.size());
}
commit cabb9d7fc33aa5772b48a8ec14c7441b3470bd87
Author: Pranav Kant <pranavk at collabora.com>
Date: Thu Feb 18 23:55:30 2016 +0530
loolwsd: Add a missing command, 'tilecombine' to documentation
Change-Id: Iedefef83cefca6e88e9676a0bc810ecb766b59ee
diff --git a/loolwsd/protocol.txt b/loolwsd/protocol.txt
index afef2af..3b35bde 100644
--- a/loolwsd/protocol.txt
+++ b/loolwsd/protocol.txt
@@ -114,6 +114,11 @@ tile part=<partNumber> width=<width> height=<height> tileposx=<xpos> tileposy=<y
All parameters are numbers.
+tilecombine <parameters>
+
+ Accept same parameters as 'tile' message except parameters 'tileposx' and 'tileposy'
+ can be a comma separated list, and number of elements in both must be same.
+
unload [save|force]
unloads the document.
More information about the Libreoffice-commits
mailing list