summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2010-09-09 14:25:38 +0200
committerStefan Bühler <stbuehler@web.de>2010-09-09 14:25:38 +0200
commit87bb51239cb3ecd64407c4e06fb14e35da21db8c (patch)
tree05f9f62bc1d273654cc3d6a960f7b5e82cf5984d
parentc39c6ee64bbae9fd81fb4da168dfa7583c1af703 (diff)
downloadlibmanda-87bb51239cb3ecd64407c4e06fb14e35da21db8c.tar.gz
libmanda-87bb51239cb3ecd64407c4e06fb14e35da21db8c.zip
Protocol update
-rw-r--r--libmanda-protocol.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/libmanda-protocol.h b/libmanda-protocol.h
index 0725019..260aa87 100644
--- a/libmanda-protocol.h
+++ b/libmanda-protocol.h
@@ -44,7 +44,7 @@
* Commands:
*
* - 0x0001: Bind a new backend
- * Client -> Server (Request):
+ * Client -> Server (Request): bind_backend
* payload is the "name" string.
*
* request the socket address for a "new" backend; the name can
@@ -52,21 +52,32 @@
* socket address (for example "unix:/var/run/fastcgi_php_www-default.sock")
* or a comma separated list of key=value pairs ("type=php5,user=www-default")
*
- * Server -> Client (Response):
+ * Server -> Client (Response): return_backend
* payload is a 32-bit backend identifier, followed by the socket address (or an error message)
*
* A valid backend identifier mustn't be zero, and a valid backend must have a valid socket address.
* An error is signaled by a zero identifier, the following string contains an optional error message.
*
- * The server may return the same id more than once for the same backend;
- * the client must release each id as often as it got it in a bind request.
+ * The server should not return the same id more than once, not even for the same backend;
+ * but different ids can point to the same backend and address.
+ * (The reason here is that the server needs to sum up the update notifications.)
+ * The backend id should only be unique per connection; you can reuse the ids for a different
+ * connection.
*
* - 0x0002: Release backend
- * Client -> Server (Notification):
+ * Client -> Server (Notification): release_backend
* payload is the 32-bit backend identifier
*
+ * A connection close is an implicit release of all remaining backends.
+ *
+ * Server -> Client (Notification): lost_backend
+ * payload ist the 32-bit backend identifier, followed by a string describing the reason
+ *
+ * I the client didn't already release the backend, it should send a release_backend
+ * notification to release the id.
+ *
* - 0x0003: Update backend
- * Client -> Server (Notification):
+ * Client -> Server (Notification): update_backend
* payload are three unsigned 32-bit integers: backend identifier, "load" and "workers"
* "load" is the number of requests the client would like to process with the backend right now,
* and "workers" is the number of "workers" the client thinks the server should spawn.
@@ -77,6 +88,13 @@
* The "workers" parameter may be useful in cases where you cascade different spawn-managers; the
* main spawn-manager may tell a sub spawn-manager how many children / threads it should use.
*
+ * - 0xffff: Unknown command
+ * Any direction; by default a notification, can be a response.
+ * payload is the 16-bit id of the unknown command.
+ *
+ * If you get such a message, you should check for the id of the command, and close the connection
+ * if the original message wasn't optional.
+ *
*/
#endif