chiark / gitweb /
Stub + document shutdown command
authorRichard Kettlewell <rjk@greenend.org.uk>
Sat, 5 Jun 2010 13:43:23 +0000 (14:43 +0100)
committerRichard Kettlewell <rjk@terraraq.org.uk>
Sat, 6 Aug 2011 17:19:07 +0000 (18:19 +0100)
doc/disorder_protocol.5.in
lib/client-stubs.c
lib/client-stubs.h
lib/client.c
scripts/protocol

index f3cb61528ee399b7e6f33bf42292cf585d72299e..0f8f909c94b02bf04c454e92bec3a3977109048e 100644 (file)
@@ -437,6 +437,10 @@ Requires the \fBprefs\fR right.
 Set a global preference.
 Requires the \fBglobal prefs\fR right.
 .TP
+.B shutdown
+Requests server shutdown.
+Requires the \fBadmin\fR right.
+.TP
 .B stats
 Send server statistics in plain text in a response body.
 .TP
index 427805f1c3a8969b5d898fcb189d4f7b7974101e..de9e6cc05d50a45d48bd560864a4bc7955702d60 100644 (file)
@@ -210,6 +210,10 @@ int disorder_set_global(disorder_client *c, const char *pref, const char *value)
   return disorder_simple(c, 0, "set-global", pref, value, (char *)0);
 }
 
+int disorder_shutdown(disorder_client *c) {
+  return disorder_simple(c, 0, "shutdown", (char *)0);
+}
+
 int disorder_stats(disorder_client *c, char ***statsp, int *nstatsp) {
   return disorder_simple_list(c, statsp, nstatsp, "stats", (char *)0);
 }
index d487772682f7c134d3b1292af7a9be6cb30236b8..81822136720ce74483848fe8e79c79985a8449f8 100644 (file)
@@ -427,6 +427,14 @@ int disorder_set(disorder_client *c, const char *track, const char *pref, const
  */
 int disorder_set_global(disorder_client *c, const char *pref, const char *value);
 
+/** @brief Request server shutdown
+ *
+ * Requires the 'admin' right.
+ *
+ * @return 0 on success, non-0 on error
+ */
+int disorder_shutdown(disorder_client *c);
+
 /** @brief Get server statistics
  *
  * The details of what the server reports are not really defined.  The returned strings are intended to be printed out one to a line..
index cb6511494fbbfcbbccdf9825dee05fb991160b04..33f1d353e0b5c1e9379fd074517e114978d9dc92 100644 (file)
@@ -544,14 +544,6 @@ int disorder_move(disorder_client *c, const char *track, int delta) {
   return disorder_simple(c, 0, "move", track, d, (char *)0);
 }
 
-/** @brief Shut down the server
- * @param c Client
- * @return 0 on success, non-0 on error
- */
-int disorder_shutdown(disorder_client *c) {
-  return disorder_simple(c, 0, "shutdown", (char *)0);
-}
-
 static void client_error(const char *msg,
                         void attribute((unused)) *u) {
   disorder_error(0, "error parsing reply: %s", msg);
index 979a56ae6d74df490bef061ca382301c86d92706..ac8c0f75d55e6aae9e662a0bf1d2b4c467799cc5 100755 (executable)
@@ -562,7 +562,10 @@ simple("set-global",
        [["pref", "Preference name"],
        ["value", "New value"]]);
 
-# TODO shutdown (also needs documenting)
+simple("shutdown",
+       "Request server shutdown",
+       "Requires the 'admin' right.",
+       []);
 
 list("stats",
      "Get server statistics",