--- /dev/null
+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)
#include "submitd.h"
+/*** REQUESTS AND REPLIES ***/
+
static void NONRET
read_error_cb(struct obj_read_state *st UNUSED, byte *msg)
{
bflush(&c->tx_fb);
}
+/*** COMMAND MUX ***/
+
static void
execute_command(struct conn *c)
{
return 1;
}
+/*** INITIAL HANDSHAKE ***/
+
static int
user_exists_p(byte *user)
{