diff options
Diffstat (limited to 'include/server.h')
| -rw-r--r-- | include/server.h | 11 |
1 files changed, 10 insertions, 1 deletions
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); |
