diff --git a/Makefile b/Makefile index 00fad82..a27e95b 100644 --- a/Makefile +++ b/Makefile @@ -65,15 +65,15 @@ bin/async.o: src/async.h src/logger.h bin/workers.o: src/workers.h src/lib/mpmc.h src/worker/*.h -bin/worker/request_handler.o: src/worker/request_handler.h +bin/worker/request_handler.o: src/worker/func.h -bin/worker/tcp_acceptor.o: src/worker/tcp_acceptor.h +bin/worker/tcp_acceptor.o: src/worker/func.h -bin/worker/tcp_closer.o: src/worker/tcp_closer.h +bin/worker/tcp_closer.o: src/worker/func.h -bin/worker/fastcgi_handler.o: src/worker/fastcgi_handler.h +bin/worker/fastcgi_handler.o: src/worker/func.h -bin/worker/responder.o: src/worker/responder.h +bin/worker/responder.o: src/worker/func.h bin/lib/compress.o: src/lib/compress.h diff --git a/src/worker/fastcgi_handler.c b/src/worker/fastcgi_handler.c index 4138d9a..5918ce3 100644 --- a/src/worker/fastcgi_handler.c +++ b/src/worker/fastcgi_handler.c @@ -6,7 +6,7 @@ * @date 2022-12-28 */ -#include "fastcgi_handler.h" +#include "func.h" #include "../logger.h" #include "../lib/utils.h" diff --git a/src/worker/fastcgi_handler.h b/src/worker/fastcgi_handler.h deleted file mode 100644 index d8c9791..0000000 --- a/src/worker/fastcgi_handler.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * sesimos - secure, simple, modern web server - * @brief TCP closer (header file) - * @file src/worker/fastcgi_handler.h - * @author Lorenz Stechauner - * @date 2022-12-29 - */ - -#ifndef SESIMOS_FASTCGI_HANDLER_H -#define SESIMOS_FASTCGI_HANDLER_H - -#include "../server.h" - -void fastcgi_handler_func(client_ctx_t *ctx); - -#endif //SESIMOS_FASTCGI_HANDLER_H diff --git a/src/worker/func.h b/src/worker/func.h new file mode 100644 index 0000000..b1e2729 --- /dev/null +++ b/src/worker/func.h @@ -0,0 +1,24 @@ +/** + * sesimos - secure, simple, modern web server + * @brief Worker function header file + * @file src/worker/func.h + * @author Lorenz Stechauner + * @date 2022-12-29 + */ + +#ifndef SESIMOS_FUNC_H +#define SESIMOS_FUNC_H + +#include "../server.h" + +void tcp_acceptor_func(client_ctx_t *ctx); + +void tcp_closer_func(client_ctx_t *ctx); + +void request_handler_func(client_ctx_t *ctx); + +void responder_func(client_ctx_t *ctx); + +void fastcgi_handler_func(client_ctx_t *ctx); + +#endif //SESIMOS_FUNC_H diff --git a/src/worker/request_handler.c b/src/worker/request_handler.c index 7d7373e..5926561 100644 --- a/src/worker/request_handler.c +++ b/src/worker/request_handler.c @@ -7,7 +7,7 @@ */ #include "../defs.h" -#include "request_handler.h" +#include "func.h" #include "../workers.h" #include "../lib/mpmc.h" #include "../logger.h" diff --git a/src/worker/request_handler.h b/src/worker/request_handler.h deleted file mode 100644 index 9c552a8..0000000 --- a/src/worker/request_handler.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * sesimos - secure, simple, modern web server - * @brief Client request handler (header file) - * @file src/worker/request_handler.h - * @author Lorenz Stechauner - * @date 2022-12-28 - */ - -#ifndef SESIMOS_REQUEST_HANDLER_H -#define SESIMOS_REQUEST_HANDLER_H - -#include "../server.h" - -void request_handler_func(client_ctx_t *ctx); - -#endif //SESIMOS_REQUEST_HANDLER_H diff --git a/src/worker/responder.c b/src/worker/responder.c index 8694d9e..694eea1 100644 --- a/src/worker/responder.c +++ b/src/worker/responder.c @@ -7,7 +7,7 @@ */ #include "../defs.h" -#include "responder.h" +#include "func.h" #include "../async.h" #include "../logger.h" diff --git a/src/worker/responder.h b/src/worker/responder.h deleted file mode 100644 index 9216f3c..0000000 --- a/src/worker/responder.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * sesimos - secure, simple, modern web server - * @brief HTTP responder (header file) - * @file src/worker/responderr.h - * @author Lorenz Stechauner - * @date 2022-12-29 - */ - -#ifndef SESIMOS_RESPONDER_H -#define SESIMOS_RESPONDER_H - -#include "../server.h" - -void responder_func(client_ctx_t *ctx); - -#endif //SESIMOS_RESPONDER_H diff --git a/src/worker/tcp_acceptor.c b/src/worker/tcp_acceptor.c index 33e5355..4561cf7 100644 --- a/src/worker/tcp_acceptor.c +++ b/src/worker/tcp_acceptor.c @@ -6,7 +6,7 @@ * @date 2022-12-28 */ -#include "tcp_acceptor.h" +#include "func.h" #include "../async.h" #include "../logger.h" #include "../lib/mpmc.h" diff --git a/src/worker/tcp_acceptor.h b/src/worker/tcp_acceptor.h deleted file mode 100644 index 52e8d1e..0000000 --- a/src/worker/tcp_acceptor.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * sesimos - secure, simple, modern web server - * @brief TCP acceptor (header file) - * @file src/worker/tcp_acceptor.h - * @author Lorenz Stechauner - * @date 2022-12-28 - */ - -#ifndef SESIMOS_TCP_ACCEPTOR_H -#define SESIMOS_TCP_ACCEPTOR_H - -#include "../server.h" - -void tcp_acceptor_func(client_ctx_t *ctx); - -#endif //SESIMOS_TCP_ACCEPTOR_H diff --git a/src/worker/tcp_closer.c b/src/worker/tcp_closer.c index 69dbf32..361620e 100644 --- a/src/worker/tcp_closer.c +++ b/src/worker/tcp_closer.c @@ -6,7 +6,7 @@ * @date 2022-12-28 */ -#include "tcp_closer.h" +#include "func.h" #include "../logger.h" #include "../lib/utils.h" diff --git a/src/worker/tcp_closer.h b/src/worker/tcp_closer.h deleted file mode 100644 index 318a351..0000000 --- a/src/worker/tcp_closer.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * sesimos - secure, simple, modern web server - * @brief TCP closer (header file) - * @file src/worker/tcp_closer.h - * @author Lorenz Stechauner - * @date 2022-12-28 - */ - -#ifndef SESIMOS_TCP_CLOSER_H -#define SESIMOS_TCP_CLOSER_H - -#include "../server.h" - -void tcp_closer_func(client_ctx_t *ctx); - -#endif //SESIMOS_TCP_CLOSER_H diff --git a/src/workers.c b/src/workers.c index 3e0048a..8a9b4ea 100644 --- a/src/workers.c +++ b/src/workers.c @@ -9,11 +9,7 @@ #include "workers.h" #include "lib/mpmc.h" -#include "worker/tcp_acceptor.h" -#include "worker/tcp_closer.h" -#include "worker/responder.h" -#include "worker/request_handler.h" -#include "worker/fastcgi_handler.h" +#include "worker/func.h" static mpmc_t tcp_acceptor_ctx, tcp_closer_ctx, request_handler_ctx, responder_ctx, fastcgi_handler_cxt;