mirror of https://github.com/omar-polo/gmid.git
document the DFA
This commit is contained in:
parent
112802ea31
commit
92da82858b
17
gmid.h
17
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];
|
||||
|
|
Loading…
Reference in New Issue