From 6bc9c4deb90e8daa228d792b23a3e61b7bebdb78 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 26 Sep 2020 15:51:28 -0400 Subject: Implement autoindex option --- include/config.h | 5 +++++ include/server.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/config.h b/include/config.h index 83253f7..1a0b17c 100644 --- a/include/config.h +++ b/include/config.h @@ -2,6 +2,7 @@ #define GMNISRV_CONFIG #include #include +#include struct gmnisrv_tls { char *store; @@ -13,8 +14,12 @@ struct gmnisrv_tls { struct gmnisrv_host { char *hostname; char *root; + char *index; + bool autoindex; + X509 *x509; EVP_PKEY *pkey; + struct gmnisrv_host *next; }; diff --git a/include/server.h b/include/server.h index 884f210..c6f4a38 100644 --- a/include/server.h +++ b/include/server.h @@ -33,7 +33,7 @@ struct gmnisrv_client { enum response_state state; enum gemini_status status; char *meta; - int bodyfd; + FILE *body; size_t bbytes; struct gmnisrv_host *host; @@ -70,7 +70,7 @@ void disconnect_client(struct gmnisrv_server *server, void serve_request(struct gmnisrv_client *client); bool request_validate(struct gmnisrv_client *client, char **path); void client_submit_response(struct gmnisrv_client *client, - enum gemini_status status, const char *meta, int bodyfd); + enum gemini_status status, const char *meta, FILE *body); void client_oom(struct gmnisrv_client *client); #endif -- cgit v1.2.3