diff options
author | synodriver <diguohuangjiajinweijun@gmail.com> | 2023-05-27 23:18:41 +0800 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2023-06-01 00:25:40 +0100 |
commit | b84f6ecad42f4217b6eafb0ceb1e66a75b34e948 (patch) | |
tree | 54d8b76979f0298fd52a130b689feb23ca34bdcf /src/python/nxt_python_asgi.c | |
parent | 93ed66958e11b40cc06dcb32fc8e623967af6347 (diff) | |
download | unit-b84f6ecad42f4217b6eafb0ceb1e66a75b34e948.tar.gz unit-b84f6ecad42f4217b6eafb0ceb1e66a75b34e948.tar.bz2 |
Python: Fix error checks in nxt_py_asgi_request_handler().
Signed-off-by: synodriver <diguohuangjiajinweijun@gmail.com>
Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
[ Re-word commit subject - Andrew ]
Fixes: c4c2f90c5b53 ("Python: ASGI server introduced.")
Closes: <https://github.com/nginx/unit/issues/895>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src/python/nxt_python_asgi.c')
-rw-r--r-- | src/python/nxt_python_asgi.c | 4 |
1 files 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); |