Add ability to enumerate endpoints

This commit is contained in:
Deomid "rojer" Ryabkov authored and Deomid Ryabkov committed 2021-06-12 01:56:50 +01:00
1 parent a350208f35
commit e3a140c9a7
4 files changed
+56 -26

No files matched your search

+21
View File
@@ -5184,6 +5184,27 @@ void mg_register_http_endpoint_opt(struct mg_connection *nc,
mg_event_handler_t handler,
struct mg_http_endpoint_opts opts);
/*
* HTTP endpoint descriptor.
*/
struct mg_http_endpoint {
struct mg_http_endpoint *next;
struct mg_str uri_pattern; /* owned */
char *auth_domain; /* owned */
char *auth_file; /* owned */
enum mg_auth_algo auth_algo;
mg_event_handler_t handler;
#if MG_ENABLE_CALLBACK_USERDATA
void *user_data;
#endif
};
/*
* Returns first registered endpoint.
*/
struct mg_http_endpoint *mg_get_http_endpoints(struct mg_connection *nc);
/*
* Sends 401 Unauthorized response.
*/