From 2b921048ce40058e30ae69027dccb76a95b47dbe Mon Sep 17 00:00:00 2001 From: amelia squires Date: Sat, 27 Sep 2025 04:13:18 -0500 Subject: memory leaks, poll usage and server:close --- src/net/common.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/net') diff --git a/src/net/common.h b/src/net/common.h index dfac2e5..6bb161c 100644 --- a/src/net/common.h +++ b/src/net/common.h @@ -36,7 +36,7 @@ struct file_parse { }; typedef struct { - int fd; + int fd, ser; int port; lua_State* L; struct sockaddr_in cli; @@ -49,6 +49,10 @@ struct lchar { char req[20]; }; +struct net_server_state { + int event_fd; +}; + struct sarray_t { struct lchar** cs; int len; @@ -56,4 +60,12 @@ struct sarray_t { extern map_t* mime_type; +int start_serv(lua_State* L, int port, parray_t* paths, struct net_server_state*); + +enum { + NETEV_NULL = 0, + NETEV_DEFAULT = 1, + NETEV_CLOSE_EVENT = 2, +}; + #endif -- cgit v1.2.3