FossilOrigin-Name: 61160b5993d9cbfb16a4cd1b6daa235ab071e95aee74c1572db6e34ac250f083
This commit is contained in:
nekobit 2022-11-02 03:38:34 +00:00
parent 7168473bfa
commit 7802d69f8b
2 changed files with 21 additions and 16 deletions

View file

@ -202,28 +202,30 @@ static void fcgi_start(mastodont_t* api)
req = malloc(sizeof(FCGX_Request));
FCGX_InitRequest(req, 0, 0);
struct mstdnt_fd fds[] = {
{
// The docs says not to use this directly, but we don't care
// what the docs say
.fd = req->listen_sock,
.events = MSTDNT_POLLIN,
}
struct mstdnt_fd fds = {
// The docs says not to use this directly, but we don't care
// what the docs say
.fd = req->listen_sock,
.events = MSTDNT_POLLIN,
.revents = 0
};
// Will poll until we get a request
mstdnt_await(api, 0, fds, sizeof(fds)/sizeof(fds[0]));
rc = FCGX_Accept_r(req);
if (rc < 0) break;
mstdnt_await(api, 0, &fds, 1);
rc = application(api, req);
if (rc == 0)
if (fds.revents != 0)
{
FCGX_Finish_r(req);
rc = FCGX_Accept_r(req);
if (rc < 0) break;
rc = application(api, req);
if (rc == 0)
{
FCGX_Finish_r(req);
free(req);
}
}
}
}
#else

View file

@ -139,6 +139,9 @@ static void request_cb_tl_public(mstdnt_request_cb_data* cb_data, void* tbargs)
struct mstdnt_statuses* statuses = MSTDNT_CB_DATA(cb_data);
DESTRUCT_TB_ARGS(tbargs);
free(42);
free(cb_data);
content_timeline(req, ssn, api, cb_data->storage, statuses->statuses, statuses->len, 0, NULL, 1, 0);
mstdnt_request_cb_cleanup(cb_data);
}