forked from mirrors/treebird
Restructure mastodont load
FossilOrigin-Name: 8b211677cc57f44ca6491e7ff3cc9a5f387cdb0a6d2dcf8867d5c45c248d31df
This commit is contained in:
parent
db0914a348
commit
dd723758c4
1 changed files with 10 additions and 7 deletions
17
src/main.c
17
src/main.c
|
@ -46,10 +46,6 @@ int main(void)
|
|||
// API
|
||||
while (FCGI_Accept() >= 0)
|
||||
{
|
||||
mastodont_t api;
|
||||
api.url = config_instance_url;
|
||||
mastodont_init(&api, MSTDNT_FLAG_NO_URI_SANITIZE | config_library_flags);
|
||||
|
||||
struct session ssn = {
|
||||
.config = {
|
||||
.changed = 0,
|
||||
|
@ -58,15 +54,22 @@ int main(void)
|
|||
.jsactions = 0,
|
||||
.jsreply = 0,
|
||||
.jslive = 0
|
||||
}
|
||||
},
|
||||
.cookies = { 0 },
|
||||
.post = { 0 },
|
||||
.query = { 0 }
|
||||
};
|
||||
|
||||
|
||||
// Load cookies
|
||||
char* cookies_str = read_cookies_env(&(ssn.cookies));
|
||||
api.token = ssn.cookies.access_token; // Load token now
|
||||
char* post_str = read_post_data(&(ssn.post));
|
||||
char* get_str = read_query_data(&(ssn.query));
|
||||
|
||||
mastodont_t api;
|
||||
api.url = config_instance_url;
|
||||
mastodont_init(&api, MSTDNT_FLAG_NO_URI_SANITIZE | config_library_flags);
|
||||
api.token = ssn.cookies.access_token; // Load token now
|
||||
|
||||
/*******************
|
||||
* Path handling *
|
||||
******************/
|
||||
|
|
Loading…
Reference in a new issue