feat: add long & custom redirect urls

This commit is contained in:
Jef Roosens 2023-05-30 19:36:58 +02:00
parent f07042e798
commit 58e2d8a02e
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
6 changed files with 76 additions and 24 deletions

View file

@ -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;
/*

View file

@ -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.
*