You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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`).
- 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.
0 commit comments