diff options
| author | amelia squires <[email protected]> | 2025-09-27 04:13:18 -0500 |
|---|---|---|
| committer | amelia squires <[email protected]> | 2025-09-27 04:13:18 -0500 |
| commit | 2b921048ce40058e30ae69027dccb76a95b47dbe (patch) | |
| tree | 31a3a1d2077ca52f598d9bb557ae555e607899b2 /src/net | |
| parent | e3a798740c2d64d0ac0dd4a08ebfec9d5a1c3cf8 (diff) | |
memory leaks, poll usage and server:close
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/common.h | 14 |
1 files changed, 13 insertions, 1 deletions
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 |
