From b84f6ecad42f4217b6eafb0ceb1e66a75b34e948 Mon Sep 17 00:00:00 2001 From: synodriver Date: Sat, 27 May 2023 23:18:41 +0800 Subject: Python: Fix error checks in nxt_py_asgi_request_handler(). Signed-off-by: synodriver Reviewed-by: Andrew Clayton [ Re-word commit subject - Andrew ] Fixes: c4c2f90c5b53 ("Python: ASGI server introduced.") Closes: Signed-off-by: Andrew Clayton --- src/python/nxt_python_asgi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python/nxt_python_asgi.c b/src/python/nxt_python_asgi.c index 5882491b..8f300b53 100644 --- a/src/python/nxt_python_asgi.c +++ b/src/python/nxt_python_asgi.c @@ -478,7 +478,7 @@ nxt_py_asgi_request_handler(nxt_unit_request_info_t *req) } send = PyObject_GetAttrString(asgi, "send"); - if (nxt_slow_path(receive == NULL)) { + if (nxt_slow_path(send == NULL)) { nxt_unit_req_alert(req, "Python failed to get 'send' method"); nxt_unit_request_done(req, NXT_UNIT_ERROR); @@ -486,7 +486,7 @@ nxt_py_asgi_request_handler(nxt_unit_request_info_t *req) } done = PyObject_GetAttrString(asgi, "_done"); - if (nxt_slow_path(receive == NULL)) { + if (nxt_slow_path(done == NULL)) { nxt_unit_req_alert(req, "Python failed to get '_done' method"); nxt_unit_request_done(req, NXT_UNIT_ERROR); -- cgit