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:
22
src/server_config.h
Normal file
22
src/server_config.h
Normal 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
|
||||
Reference in New Issue
Block a user