feat: add long & custom redirect urls
This commit is contained in:
parent
f07042e798
commit
58e2d8a02e
6 changed files with 76 additions and 24 deletions
|
|
@ -9,6 +9,8 @@
|
|||
#include "http/types.h"
|
||||
#include "trie.h"
|
||||
|
||||
#define HTTP_LOOP_MAX_STEPS 17
|
||||
|
||||
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
|
||||
|
||||
|
|
@ -22,7 +24,7 @@ typedef struct http_route {
|
|||
http_method method;
|
||||
char *path;
|
||||
regex_t *regex;
|
||||
bool (*steps[5])(event_loop_conn *);
|
||||
bool (*steps[HTTP_LOOP_MAX_STEPS])(event_loop_conn *);
|
||||
} http_route;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -88,6 +88,9 @@ TrieExitCode trie_search_len(Trie *trie, Entry **entry_ptr, const char *key,
|
|||
*/
|
||||
TrieExitCode trie_add(Trie *trie, const char *key, Entry *entry);
|
||||
|
||||
TrieExitCode trie_add_len(Trie *trie, const char *key, size_t key_len,
|
||||
Entry *entry);
|
||||
|
||||
/**
|
||||
* Add an entry by generating a random string as the key.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue