summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2018-05-03 17:52:35 +0100
committerJan Holesovsky <kendy@collabora.com>2018-05-18 15:16:39 +0200
commit9e7dff79f3cc9140f1a81bca2ce6cf8ddd46f8f6 (patch)
tree9a29df1642594f4284d12c88d1affad1b07513c3 /tools
parentThe WebSocketHandler::handleClientUpgrade() needs to handle a Response, (diff)
downloadonline-9e7dff79f3cc9140f1a81bca2ce6cf8ddd46f8f6.tar.gz
online-9e7dff79f3cc9140f1a81bca2ce6cf8ddd46f8f6.zip
re-factor socket factories to take a client parameter.
Change-Id: I0be98eb583b4f8081dd8ad23e688e93c55220367
Diffstat (limited to 'tools')
-rw-r--r--tools/WebSocketDump.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/WebSocketDump.cpp b/tools/WebSocketDump.cpp
index bc7a04781d..74faa310ef 100644
--- a/tools/WebSocketDump.cpp
+++ b/tools/WebSocketDump.cpp
@@ -140,7 +140,10 @@ private:
if (request.find("Upgrade") != request.end() && Poco::icompare(request["Upgrade"], "websocket") == 0)
{
- socket->setHandler(std::make_shared<DumpSocketHandler>(_socket, request));
+ auto dumpHandler = std::make_shared<DumpSocketHandler>(_socket, request);
+ socket->setHandler(dumpHandler);
+ dumpHandler->sendMessage("version");
+ dumpHandler->sendMessage("documents");
}
else
{
@@ -194,9 +197,9 @@ class DumpSocketFactory final : public SocketFactory
std::shared_ptr<Socket> create(const int physicalFd) override
{
#if 0 && ENABLE_SSL
- return StreamSocket::create<SslStreamSocket>(physicalFd, std::unique_ptr<SocketHandlerInterface>{ new ClientRequestDispatcher });
+ return StreamSocket::create<SslStreamSocket>(physicalFd, false, std::unique_ptr<SocketHandlerInterface>{ new ClientRequestDispatcher });
#else
- return StreamSocket::create<StreamSocket>(physicalFd, std::unique_ptr<SocketHandlerInterface>{ new ClientRequestDispatcher });
+ return StreamSocket::create<StreamSocket>(physicalFd, false, std::unique_ptr<SocketHandlerInterface>{ new ClientRequestDispatcher });
#endif
}
};