diff options
| author | iceyrazor <iceyrazor@mailfence.com> | 2026-10-11 00:21:32 -0500 |
|---|---|---|
| committer | iceyrazor <iceyrazor@mailfence.com> | 2026-10-11 00:21:32 -0500 |
| commit | a926ae205ecb42a603e428346cf99dc1e66ed691 (patch) | |
| tree | 9d207cf8f84dc1d9e48b541f0a18309f7f96c442 /Server.c | |
| parent | 3521cc6e1a87f16c8db5c3c5a0c3cf59e1ff04cb (diff) | |
major refactor: Some Thread Safety
- removed web. silly to have that in a socket library
- made shared changing variables atomic
- added mutex locking to some things
- removed requirement for iceys-c-libs (that was a web thing)
- removed launch variable
- check if on_message is actually defined
- init on_message and on_disconnect NULL
Diffstat (limited to 'Server.c')
| -rwxr-xr-x | Server.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -4,7 +4,7 @@ #include <stdlib.h> #include <Server.h> -struct Server server_constructor(int domain, int service, int protocol, ulong interface, int port, int backlog, pthread_t(*launch)(struct Server *server)){ +struct Server server_constructor(int domain, int service, int protocol, ulong interface, int port, int backlog){ struct Server server; server.domain=domain; @@ -37,7 +37,9 @@ struct Server server_constructor(int domain, int service, int protocol, ulong in server.accepted_socket=NULL; - server.launch=launch; + server.on_message=NULL; + server.on_disconnect=NULL; + server.running=true; return server; |
