summaryrefslogtreecommitdiff
path: root/tools/Replay.hpp
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-02-10 01:05:34 -0500
committerAshod Nakashian <ashnakash@gmail.com>2017-02-10 07:05:37 +0000
commit3831cd016970932c503f0bbec18c7af2537299e5 (patch)
treef82868537d446355b14607c3c3bb5502abaee035 /tools/Replay.hpp
parentd0b9de7615de82fc711f5d2c7fa28639cd2bab35 (diff)
wsd: drop bad sessions when send fails while replaying
Change-Id: I77c2ecd65f20a65e40d78fdc4d7d8ca2b4821270 Reviewed-on: https://gerrit.libreoffice.org/34116 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'tools/Replay.hpp')
-rw-r--r--tools/Replay.hpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/Replay.hpp b/tools/Replay.hpp
index 684401f4a..585a0ce84 100644
--- a/tools/Replay.hpp
+++ b/tools/Replay.hpp
@@ -239,7 +239,14 @@ protected:
if (sessionIt != it->second.end())
{
// Send the command.
- sessionIt->second->send(rec.Payload);
+ if (!sessionIt->second->send(rec.Payload))
+ {
+ it->second.erase(sessionIt);
+ }
+ }
+ else
+ {
+ std::cout << "ERROR: Session [" << rec.SessionId << "] does not exist.\n";
}
}
else
@@ -252,6 +259,10 @@ protected:
std::cout << "ERROR: Unknown PID [" << rec.Pid << "] maps to no active document.\n";
}
}
+ else
+ {
+ std::cout << "ERROR: Unknown trace file direction [" << static_cast<char>(rec.Dir) << "].\n";
+ }
epochCurrent = std::chrono::steady_clock::now();
epochFile = rec.TimestampNs;