summaryrefslogtreecommitdiff
path: root/loolwsd/LOKitClient.cpp
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2016-09-28 22:07:07 +0300
committerTor Lillqvist <tml@collabora.com>2016-09-29 00:23:14 +0300
commit96e6ad750260061d179d265b83d8044e6d46f5d5 (patch)
tree7e98660fb419fece68f3e36caee940ad186548cb /loolwsd/LOKitClient.cpp
parent075c487001afe2b0038f4e2971479adb54ab4e53 (diff)
Re-think disk full handling
Instead of trying to inform the sysadmin (which we did not yet try to do in any meaningful way), inform all connected clients (even those editing other documents). We use 'error: cmd=internal kind=diskfull' as the message to the clients. The loleaflet code needs to be updated to handle that carefully by displaying a very prominent message that tells the user that all bets are off. Also add a unit test for the functionality. Document the new protocol details. The code for this alert functionalty became a bit less elegant than I like because of the way we include Util.cpp in the unit test 'test' program. Still need to add code to check for disk full in more places, not just when saving a cached tile or font. Probably we should even actually check for disk space on the file system(s) we use getting alarmingly low, not just check for file writing operations that fail. Later.
Diffstat (limited to 'loolwsd/LOKitClient.cpp')
-rw-r--r--loolwsd/LOKitClient.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/loolwsd/LOKitClient.cpp b/loolwsd/LOKitClient.cpp
index b882b7968..06d0a3333 100644
--- a/loolwsd/LOKitClient.cpp
+++ b/loolwsd/LOKitClient.cpp
@@ -206,6 +206,17 @@ protected:
}
};
+namespace Util
+{
+
+void alertAllUsers(const std::string& cmd, const std::string& kind)
+{
+ std::cout << "error: cmd=" << cmd << " kind=" << kind << std::endl;
+ (void) kind;
+}
+
+}
+
POCO_APP_MAIN(LOKitClient)
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */