summaryrefslogtreecommitdiffstats
path: root/wsd/Admin.hpp
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2017-03-15 16:13:13 +0000
committerMichael Meeks <michael.meeks@collabora.com>2017-03-15 16:13:13 +0000
commit909b5f8ac3aa57c4bc786fa03c5d999805e6d7ca (patch)
tree4f84f4cbf3c2ebb693aa4ef9d24ab49ee037c537 /wsd/Admin.hpp
parentSwitch to using websocket here. (diff)
downloadonline-909b5f8ac3aa57c4bc786fa03c5d999805e6d7ca.tar.gz
online-909b5f8ac3aa57c4bc786fa03c5d999805e6d7ca.zip
Admin: should be its own socket-poll goodness.
Diffstat (limited to 'wsd/Admin.hpp')
-rw-r--r--wsd/Admin.hpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/wsd/Admin.hpp b/wsd/Admin.hpp
index c15cbbb818..4332e27293 100644
--- a/wsd/Admin.hpp
+++ b/wsd/Admin.hpp
@@ -36,7 +36,9 @@ public:
const std::weak_ptr<StreamSocket>& socket,
const Poco::Net::HTTPRequest& request);
- static void handleInitialRequest(const std::weak_ptr<StreamSocket> &socket,
+ /// Handle the initial Admin WS upgrade request.
+ /// @returns true if we should give this socket to the Admin poll.
+ static bool handleInitialRequest(const std::weak_ptr<StreamSocket> &socket,
const Poco::Net::HTTPRequest& request);
private:
@@ -57,7 +59,7 @@ private:
class MemoryStatsTask;
/// An admin command processor.
-class Admin
+class Admin : public SocketPoll
{
Admin();
public:
@@ -69,6 +71,12 @@ public:
return admin;
}
+ void start()
+ {
+ // FIXME: not if admin console is not enabled ?
+ startThread();
+ }
+
unsigned getTotalMemoryUsage();
/// Update the Admin Model.
@@ -101,6 +109,8 @@ public:
void updateLastActivityTime(const std::string& docKey);
void updateMemoryDirty(const std::string& docKey, int dirty);
+ void dumpState(std::ostream& os) override;
+
private:
AdminModel _model;
std::mutex _modelMutex;