summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/config.h2
-rw-r--r--include/server.h11
2 files changed, 11 insertions, 2 deletions
diff --git a/include/config.h b/include/config.h
index dec0e15..9455c2b 100644
--- a/include/config.h
+++ b/include/config.h
@@ -31,6 +31,6 @@ int load_config(struct gmnisrv_config *conf, const char *path);
void config_finish(struct gmnisrv_config *conf);
struct gmnisrv_host *gmnisrv_config_get_host(
- struct gmnisrv_config *conf, const char *hostname);
+ struct gmnisrv_config *conf, const char *hostname);
#endif
diff --git a/include/server.h b/include/server.h
index 8547799..ac3bcac 100644
--- a/include/server.h
+++ b/include/server.h
@@ -1,14 +1,18 @@
#ifndef GMNISRV_SERVER
#define GMNISRV_SERVER
#include <poll.h>
+#include <stdbool.h>
#define GEMINI_MAX_URL 1024
struct gmnisrv_client {
+ struct sockaddr addr;
+ socklen_t addrlen;
+
char buf[GEMINI_MAX_URL + 2];
size_t bufln;
+
int sockfd;
- int respfd;
};
struct gmisrv_config;
@@ -18,10 +22,15 @@ struct gmnisrv_server {
struct pollfd *fds;
nfds_t nfds, fdsz;
+ // nlisten is initialized once and does not change. The fds list starts
+ // with this many listening sockets, then has sockets for each active
+ // client, up to nfds.
size_t nlisten;
struct gmnisrv_client *clients;
size_t nclients, clientsz;
+
+ bool run;
};
int server_init(struct gmnisrv_server *server, struct gmnisrv_config *conf);