-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
3,571 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
/*! | ||
* @file | ||
* @brief Header file for the web server configuration functions and definitions | ||
*/ | ||
#pragma once | ||
|
||
#include <stdbool.h> | ||
#include <stdint.h> | ||
|
||
// configuration for the ctorm web server | ||
/*! | ||
* @brief Web server application configuration | ||
* Type for the web server application configuration, you can initialize a | ||
* new configuration with the default values using @ref ctorm_config_new | ||
*/ | ||
typedef struct { | ||
int max_connections; // max parallel connection count | ||
bool disable_logging; // disables request logging and the banner | ||
bool handle_signal; // disables SIGINT handler (which stops app_run()) | ||
bool server_header; // disable sending the "Server: ctorm" header in the response | ||
bool lock_request; // locks threads until the request handler returns | ||
__time_t tcp_timeout; // sets the TCP socket timeout for sending and receiving | ||
uint64_t pool_size; // app threadpool size | ||
int max_connections; /// max parallel connection count | ||
bool disable_logging; /// disables request logging and the banner | ||
bool handle_signal; /// disables SIGINT handler (which stops app_run()) | ||
bool server_header; /// disable sending the "Server: ctorm" header in the response | ||
bool lock_request; /// locks threads until the request handler returns | ||
__time_t tcp_timeout; /// sets the TCP socket timeout for sending and receiving | ||
uint64_t pool_size; /// app threadpool size | ||
} ctorm_config_t; | ||
|
||
/*! | ||
* Initialize a new web server application configuration with the default values, | ||
* you should define a configuration using @ref ctorm_config_t type first and pass | ||
* it's address to this function | ||
* @param[out] config Pointer of the configuration to initialize | ||
*/ | ||
void ctorm_config_new(ctorm_config_t *config); |
Oops, something went wrong.