Commit Diff


commit - 112802ea3116b6e11a70d6060e6e238495498bbc
commit + 92da82858b6b8fe44f34e582967767d7f4d32f4d
blob - e2a5e5e6d5cb982b5f412f0713f562c86f0e8387
blob + 4cf6266ffe374eb56bd65c42e3af47a237b0fe5d
--- gmid.h
+++ gmid.h
@@ -128,6 +128,23 @@ struct client;
 
 typedef void (*statefn)(struct pollfd*, struct client*);
 
+/*
+ * DFA: handle_handshake is the initial state, close_conn the final.
+ *
+ * handle_handshake -> handle_open_conn
+ * handle_handshake -> close_conn		// on err
+ *
+ * handle_open_conn -> handle_cgi		// via open_file/dir/...
+ * handle_open_conn -> send_directory_listing	// ...same
+ * handle_open_conn -> send_file		// ...same
+ * handle_open_conn -> close_conn		// on error
+ *
+ * handle_cgi -> close_conn
+ *
+ * send_directory_listing -> close_conn
+ *
+ * send_file -> close_conn
+ */
 struct client {
 	struct tls	*ctx;
 	char		 req[GEMINI_URL_LEN];