Refactor server configuration management

- Removed old server configuration files (server.json, server.log, server_config.c, server_config.h).
- Introduced a new configuration file (server.conf) with a more structured format.
- Implemented a configuration parser (config_parser.c) to read and apply settings from server.conf.
- Updated server logic to utilize the new configuration structure.
- Enhanced logging functionality and added rate limiting features.
- Improved error handling and security measures in request processing.
This commit is contained in:
2025-10-02 18:57:05 +00:00
parent a34ae2a43e
commit c9ac352bb4
10 changed files with 192 additions and 141 deletions

22
src/server_config.h Normal file
View File

@@ -0,0 +1,22 @@
#ifndef SERVER_CONFIG_H
#define SERVER_CONFIG_H
#include <stdbool.h>
typedef struct {
int port;
bool use_https;
char log_file[256];
int max_threads;
bool running;
bool automatic_startup;
char server_name[256];
int verbose;
} ServerConfig;
int load_config(const char *filename, ServerConfig *config);
void init_config(ServerConfig *config);
void log_event(const char *message);
#endif