]> mj.ucw.cz Git - eval.git/commitdiff
Documented the protocol.
authorMartin Mares <mj@ucw.cz>
Mon, 4 Jun 2007 08:02:10 +0000 (10:02 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 4 Jun 2007 08:02:10 +0000 (10:02 +0200)
submit/PROTOCOL [new file with mode: 0644]
submit/commands.c

diff --git a/submit/PROTOCOL b/submit/PROTOCOL
new file mode 100644 (file)
index 0000000..7002b5a
--- /dev/null
@@ -0,0 +1,27 @@
+Protocol spoken by the submit server
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+(1) Server sends "+OK\n" or "+TLS\n"
+
+(2) TLS is started if requested
+
+(3) Client sends hello, server replies
+
+(4) Loop: client sends command, server replies
+
+Except for the initial "+xxx" message, all requests and replies are simple objects
+as handled by the Sherlock library. Each line starts with a single-character
+attribute name followed by the value of the attribute, the object is terminated
+by an empty line. Parentheses can delimit nested blocks.
+
+Every reply contains either a "+" or "-" attribute denoting status (OK/failed).
+The value of the attribute is a message for the user, which should not be
+interpreted in any way.
+
+Hello request:
+
+       Uusername
+
+Hello reply:
+
+       (only status)
index 49440993d73b8975accfa299899b3c8b65a8b1f6..687e2721add4d520eeebe16fd3c4c9602211aa6e 100644 (file)
@@ -14,6 +14,8 @@
 
 #include "submitd.h"
 
+/*** REQUESTS AND REPLIES ***/
+
 static void NONRET
 read_error_cb(struct obj_read_state *st UNUSED, byte *msg)
 {
@@ -77,6 +79,8 @@ write_reply(struct conn *c)
   bflush(&c->tx_fb);
 }
 
+/*** COMMAND MUX ***/
+
 static void
 execute_command(struct conn *c)
 {
@@ -101,6 +105,8 @@ process_command(struct conn *c)
   return 1;
 }
 
+/*** INITIAL HANDSHAKE ***/
+
 static int
 user_exists_p(byte *user)
 {