kore

a fork of the worlds most advanced web framework
Log | Files | Refs | README | LICENSE

commit d4f4e007e01fead4244723bd67d2c0ad6d96a409
parent 6ed3ac4658ff38f93d2431f7e366de72139dc389
Author: Joris Vink <joris@coders.se>
Date:   Fri,  7 Jun 2019 21:33:00 +0200

make sure prereqs are in order

Diffstat:
Msrc/python.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/python.c b/src/python.c @@ -42,10 +42,10 @@ struct reqcall { PyObject *f; - LIST_ENTRY(reqcall) list; + TAILQ_ENTRY(reqcall) list; }; -LIST_HEAD(reqcall_list, reqcall); +TAILQ_HEAD(reqcall_list, reqcall); static PyMODINIT_FUNC python_module_init(void); static PyObject *python_import(const char *); @@ -213,7 +213,7 @@ kore_python_init(void) coro_id = 0; coro_count = 0; - LIST_INIT(&prereq); + TAILQ_INIT(&prereq); TAILQ_INIT(&procs); TAILQ_INIT(&coro_runnable); @@ -662,7 +662,7 @@ python_runtime_http_request(void *addr, struct http_request *req) switch (req->fsm_state) { case PYHTTP_STATE_INIT: - req->py_rqnext = LIST_FIRST(&prereq); + req->py_rqnext = TAILQ_FIRST(&prereq); req->fsm_state = PYHTTP_STATE_PREPROCESS; if (req->py_req == NULL) { if ((req->py_req = pyhttp_request_alloc(req)) == NULL) @@ -1157,7 +1157,7 @@ python_kore_prerequest(PyObject *self, PyObject *args) rq->f = f; Py_INCREF(f); - LIST_INSERT_HEAD(&prereq, rq, list); + TAILQ_INSERT_TAIL(&prereq, rq, list); return (f); } @@ -3197,7 +3197,7 @@ pyhttp_preprocess(struct http_request *req) rq = req->py_rqnext; while (rq) { - req->py_rqnext = LIST_NEXT(rq, list); + req->py_rqnext = TAILQ_NEXT(rq, list); PyErr_Clear(); ret = PyObject_CallFunctionObjArgs(rq->f, req->py_req, NULL);