Skip to content

Commit ab64c9a

Browse files
committed
stage-16-code-format-changes
1 parent 8ffefa5 commit ab64c9a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/roadmap/phase-2/stage-16.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3141,7 +3141,7 @@ xps_config.c
31413141

31423142
The functions implemented are briefly explained below(do all the error checks for NULL as and when required) :
31433143

3144-
- xps_config_create : Creates and initializes a configuration structure (`xps_config_t`) by parsing a JSON file at the specified `config_path`.
3144+
- `xps_config_create` : Creates and initializes a configuration structure (`xps_config_t`) by parsing a JSON file at the specified `config_path`.
31453145

31463146
```c
31473147
xps_config_t *xps_config_create(const char *config_path) {
@@ -3164,8 +3164,8 @@ xps_config_t *xps_config_create(const char *config_path) {
31643164
}
31653165
```
31663166
3167-
- xps_config_destroy : Cleans up and frees the memory allocated for the configuration object. Implement it by deallocating the servers and the corresponding listeners and routes. Also de-initialize the vectors.
3168-
- xps_config_lookup : Performs a lookup to find the correct configuration based on an HTTP request (xps_http_req_t) and client details (xps_connection_t).
3167+
- `xps_config_destroy` : Cleans up and frees the memory allocated for the configuration object. Implement it by deallocating the servers and the corresponding listeners and routes. Also de-initialize the vectors.
3168+
- `xps_config_lookup` : Performs a lookup to find the correct configuration based on an HTTP request (`xps_http_req_t`) and client details (`xps_connection_t`).
31693169
31703170
```c
31713171
xps_config_lookup_t *xps_config_lookup(xps_config_t *config, xps_http_req_t *http_req,
@@ -3214,11 +3214,11 @@ xps_config_lookup_t *xps_config_lookup(xps_config_t *config, xps_http_req_t *htt
32143214
}
32153215
```
32163216

3217-
- xps_config_lookup_destroy : Implement yourself
3218-
- parse_server : Parses the server_object from the JSON configuration and populates the xps_config_server_t structure. Extracts and initializes server listeners, hostnames, and routes. For each listener, it calls parse_listener, and for each route, it calls parse_route. It then stores the parsed information into the server structure. Implement it.
3219-
- parse_route : Parses the route configuration from the route_object in the JSON and fills the xps_config_route_t structure. Extracts the req_path and type of the route (the route type could be file_serve, reverse_proxy, or redirect). Based on the route type, it extracts additional information such as dir_path (for file serving), upstreams (for reverse proxy), and redirect_url (for redirects). It also manages the index files for file serving routes. Implement it.
3220-
- parse_listener : Purpose: Parses listener configuration from the listener_object in the JSON and populates the xps_config_listener_t structure. Extracts the host and port values for the listener and validates them. Populates the listener structure with this data. Implement it.
3221-
- parse_all_listener : The function iterates through all the servers and their listeners in the configuration. It checks whether each listener (identified by its host and port) already exists in the _all_listeners array. If the listener doesn't exist, it adds it to the _all_listeners array. This ensures that all listeners are collected in _all_listeners, but duplicates (based on the same host and port) are avoided. Implement it.
3217+
- `xps_config_lookup_destroy` : Implement yourself
3218+
- `parse_server` : Parses the server_object from the JSON configuration and populates the `xps_config_server_t` structure. Extracts and initializes server listeners, hostnames, and routes. For each listener, it calls `parse_listener`, and for each route, it calls `parse_route`. It then stores the parsed information into the server structure. Implement it.
3219+
- `parse_route` : Parses the route configuration from the route_object in the JSON and fills the `xps_config_route_t` structure. Extracts the `req_path` and type of the route (the route type could be file_serve, reverse_proxy, or redirect). Based on the route type, it extracts additional information such as `dir_path` (for file serving), upstreams (for reverse proxy), and `redirect_url` (for redirects). It also manages the index files for file serving routes. Implement it.
3220+
- `parse_listener` : Purpose: Parses listener configuration from the listener_object in the JSON and populates the `xps_config_listener_t` structure. Extracts the host and port values for the listener and validates them. Populates the listener structure with this data. Implement it.
3221+
- `parse_all_listener` : The function iterates through all the servers and their listeners in the configuration. It checks whether each listener (identified by its host and port) already exists in the `_all_listeners` array. If the listener doesn't exist, it adds it to the _all_listeners array. This ensures that all listeners are collected in `_all_listeners`, but duplicates (based on the same host and port) are avoided. Implement it.
32223222

32233223
### Core Module - Modifications
32243224

0 commit comments

Comments
 (0)