feat: separate lander code into separate module

This commit is contained in:
Jef Roosens 2023-05-29 21:46:05 +02:00
parent 7af4be12ff
commit ff0795bb55
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
11 changed files with 114 additions and 106 deletions

View file

@ -132,7 +132,7 @@ typedef enum http_response_body_type {
} http_response_body_type;
typedef struct http_response {
http_response_type type;
http_response_type status;
const char *head;
size_t head_len;
size_t head_written;

8
include/lander.h Normal file
View file

@ -0,0 +1,8 @@
#ifndef LANDER
#define LANDER
#include "http_loop.h"
extern http_route lander_routes[2];
#endif

View file

@ -19,9 +19,9 @@
#include <stddef.h>
#include <string.h>
const static char charset[] =
static const char charset[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
const static size_t charset_len = sizeof(charset) - 1;
static const size_t charset_len = sizeof(charset) - 1;
// Length of randomly generated keys
#define RANDOM_KEY_LENGTH_SHORT 4