From f60389a782470e31dc555ab864784b536f2544ca Mon Sep 17 00:00:00 2001 From: Oisin Canty Date: Thu, 20 May 2021 13:02:45 +0000 Subject: Python: support for multiple targets. --- src/python/nxt_python_wsgi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/python/nxt_python_wsgi.c') diff --git a/src/python/nxt_python_wsgi.c b/src/python/nxt_python_wsgi.c index 77c45af5..b80d10fa 100644 --- a/src/python/nxt_python_wsgi.c +++ b/src/python/nxt_python_wsgi.c @@ -302,7 +302,7 @@ nxt_python_request_handler(nxt_unit_request_info_t *req) { int rc; PyObject *environ, *args, *response, *iterator, *item; - PyObject *close, *result; + PyObject *close, *result, *application; nxt_bool_t prepare_environ; nxt_python_ctx_t *pctx; @@ -348,7 +348,8 @@ nxt_python_request_handler(nxt_unit_request_info_t *req) Py_INCREF(pctx->start_resp); PyTuple_SET_ITEM(args, 1, pctx->start_resp); - response = PyObject_CallObject(nxt_py_application, args); + application = nxt_py_targets->target[req->request->app_target].application; + response = PyObject_CallObject(application, args); Py_DECREF(args); -- cgit