summaryrefslogtreecommitdiffstats
path: root/include/server.h
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2020-10-25 14:50:07 -0400
committerDrew DeVault <sir@cmpwn.com>2020-10-25 14:50:07 -0400
commit1fe107875b05cc07cf62c714c0136026eef7b93a (patch)
tree463fa81cf3f67012ed542331cf072c10c72eaafd /include/server.h
parenta22bec51494a50c044416d469cc33e043480e7fd (diff)
downloadgmnisrv-1fe107875b05cc07cf62c714c0136026eef7b93a.tar.gz
gmnisrv-1fe107875b05cc07cf62c714c0136026eef7b93a.tar.xz
gmnisrv-1fe107875b05cc07cf62c714c0136026eef7b93a.zip
Overhaul network I/O to be async for real
Had to totally cut off OpenSSL from the network fd because obviously OpenSSL is just going to wreck our shit
Diffstat (limited to 'include/server.h')
-rw-r--r--include/server.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/server.h b/include/server.h
index db68e33..5795426 100644
--- a/include/server.h
+++ b/include/server.h
@@ -10,9 +10,11 @@
struct gmnisrv_server;
-enum response_state {
- RESPOND_HEADER,
- RESPOND_BODY,
+enum client_state {
+ CLIENT_STATE_REQUEST,
+ CLIENT_STATE_SSL,
+ CLIENT_STATE_HEADER,
+ CLIENT_STATE_BODY,
};
struct gmnisrv_client {
@@ -24,13 +26,12 @@ struct gmnisrv_client {
struct pollfd *pollfd;
SSL *ssl;
- BIO *bio, *sbio;
+ BIO *rbio, *wbio;
char buf[4096];
- static_assert(GEMINI_MAX_URL + 3 < 4096, "GEMINI_MAX_URL is too high");
size_t bufix, bufln;
- enum response_state state;
+ enum client_state state, next;
enum gemini_status status;
char *meta;
FILE *body;