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: c4c2f90c5b ("Python: ASGI server introduced.")
Closes: <https://github.com/nginx/unit/issues/895>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
This commit is contained in:
committed by
Andrew Clayton
parent
93ed66958e
commit
b84f6ecad4
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user