refactor: worker struct and remove pipe

This commit is contained in:
2025-10-17 21:18:13 +02:00
parent 81bdd2acda
commit 01d29ff9f3
14 changed files with 139 additions and 93 deletions

View File

@@ -1,25 +0,0 @@
#ifndef CWS_CONFIG_H
#define CWS_CONFIG_H
#include <stdbool.h>
typedef struct cws_vhost {
char *domain;
char *root;
bool ssl;
char *cert;
char *key;
} cws_vhost_s;
typedef struct cws_config {
char *hostname;
char *port;
cws_vhost_s *virtual_hosts;
unsigned virtual_hosts_count;
} cws_config_s;
cws_config_s *cws_config_init(void);
void cws_config_free(cws_config_s *config);
#endif

View File

@@ -1,6 +1,8 @@
#ifndef CWS_COLORS_H
#define CWS_COLORS_H
#include <stdio.h>
/* ANSI color escape sequences */
#define RED "\033[31m"
#define GREEN "\033[32m"
@@ -31,4 +33,4 @@
#define CWS_LOG_WARNING(msg, ...) fprintf(stdout, _WARNING " " msg "\n", ##__VA_ARGS__)
#define CWS_LOG_INFO(msg, ...) fprintf(stdout, _INFO " " msg "\n", ##__VA_ARGS__)
#endif
#endif

View File

@@ -1,8 +1,8 @@
#ifndef CWS_UTILS_H
#define CWS_UTILS_H
#include <myclib/mysocket.h>
#include <stdbool.h>
#include <sys/socket.h>
typedef enum cws_server_ret {
CWS_SERVER_OK,