External cookies

FossilOrigin-Name: 7172dd686cfa12d6d02979a1eaef6fc2818a59d4e9ef9bf9b27427df2396717c
This commit is contained in:
me@ow.nekobit.net 2022-02-20 02:35:31 +00:00
parent c633d81f10
commit 762ad3dc00
2 changed files with 11 additions and 0 deletions

View file

@ -28,6 +28,8 @@ enum cookie_state
STATE_V_START,
};
struct cookie_values cookies = { 0 };
char* parse_cookies(char* begin, struct http_cookie_info* info)
{
int keydone = 0;

View file

@ -20,6 +20,13 @@
#define COOKIE_H
#include <stddef.h>
struct cookie_values
{
char* access_token;
char* logged_in;
char* theme;
};
struct http_cookie_info
{
char* key;
@ -27,6 +34,8 @@ struct http_cookie_info
size_t val_len; // Val may be large, like CSS property
};
extern struct cookie_values cookies;
// Stupidly fast simple cookie parser
char* parse_cookies(char* begin, struct http_cookie_info* info);
int cookie_get_val(char* src, char* key, struct http_cookie_info* info);