mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-02-15 01:48:40 +00:00
fix
This commit is contained in:
parent
8f6d9f213e
commit
6824816735
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
namespace Router
|
namespace Router
|
||||||
{
|
{
|
||||||
typedef void (*Fptr)(int, char **);
|
typedef void (*RouterFunc)(int, char **);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Stdlib::HashTable::ht *routes;
|
Stdlib::HashTable::ht *routes;
|
||||||
|
|
@ -41,9 +41,9 @@ namespace Router
|
||||||
Stdlib::HashTable::set_entry(router->routes, route, endpoint);
|
Stdlib::HashTable::set_entry(router->routes, route, endpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
Fptr match_route(Router *router, const char *uri)
|
RouterFunc match_route(Router *router, const char *uri)
|
||||||
{
|
{
|
||||||
Fptr ptr = NULL;
|
RouterFunc ptr = NULL;
|
||||||
Stdlib::HashTable::it itr = Stdlib::HashTable::table_iterator(router->routes);
|
Stdlib::HashTable::it itr = Stdlib::HashTable::table_iterator(router->routes);
|
||||||
|
|
||||||
std::regex regex;
|
std::regex regex;
|
||||||
|
|
@ -54,7 +54,7 @@ namespace Router
|
||||||
|
|
||||||
bool status = std::regex_search(uri, match, regex);
|
bool status = std::regex_search(uri, match, regex);
|
||||||
if (status) {
|
if (status) {
|
||||||
ptr = (Fptr) itr.value;
|
ptr = (RouterFunc) itr.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user