Skip to content

Commit 9e51dbf

Browse files
rojercesantabot
authored andcommitted
Add ability to enumerate endpoints
PUBLISHED_FROM=6400ff847b01c2622b2be478dcca13dfb5061bb7
1 parent bc084da commit 9e51dbf

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

include/mongoose.h

+21
Original file line numberDiff line numberDiff line change
@@ -5184,6 +5184,27 @@ void mg_register_http_endpoint_opt(struct mg_connection *nc,
51845184
mg_event_handler_t handler,
51855185
struct mg_http_endpoint_opts opts);
51865186

5187+
/*
5188+
* HTTP endpoint descriptor.
5189+
*/
5190+
struct mg_http_endpoint {
5191+
struct mg_http_endpoint *next;
5192+
struct mg_str uri_pattern; /* owned */
5193+
char *auth_domain; /* owned */
5194+
char *auth_file; /* owned */
5195+
enum mg_auth_algo auth_algo;
5196+
5197+
mg_event_handler_t handler;
5198+
#if MG_ENABLE_CALLBACK_USERDATA
5199+
void *user_data;
5200+
#endif
5201+
};
5202+
5203+
/*
5204+
* Returns first registered endpoint.
5205+
*/
5206+
struct mg_http_endpoint *mg_get_http_endpoints(struct mg_connection *nc);
5207+
51875208
/*
51885209
* Sends 401 Unauthorized response.
51895210
*/

0 commit comments

Comments
 (0)