summaryrefslogtreecommitdiffhomepage
path: root/src/python/nxt_python_asgi_http.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2021-10-28 17:46:54 +0300
committerMax Romanov <max.romanov@nginx.com>2021-10-28 17:46:54 +0300
commitbba97134e983541e94cf73e93900729e3a3e61fc (patch)
treece0322c432f1d08cd302209f1403fab112788b2c /src/python/nxt_python_asgi_http.c
parent803e0373029a80994a85781d0b73b6cfa95bcf5a (diff)
downloadunit-bba97134e983541e94cf73e93900729e3a3e61fc.tar.gz
unit-bba97134e983541e94cf73e93900729e3a3e61fc.tar.bz2
Moving request limit control to libunit.
Introducting application graceful stop. For now only used when application process reach request limit value. This closes #585 issue on GitHub.
Diffstat (limited to 'src/python/nxt_python_asgi_http.c')
-rw-r--r--src/python/nxt_python_asgi_http.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/python/nxt_python_asgi_http.c b/src/python/nxt_python_asgi_http.c
index c4a77d53..05c0da4f 100644
--- a/src/python/nxt_python_asgi_http.c
+++ b/src/python/nxt_python_asgi_http.c
@@ -636,9 +636,11 @@ nxt_py_asgi_http_close_handler(nxt_unit_request_info_t *req)
nxt_unit_req_debug(req, "asgi_http_close_handler");
- http->closed = 1;
+ if (nxt_fast_path(http != NULL)) {
+ http->closed = 1;
- nxt_py_asgi_http_emit_disconnect(http);
+ nxt_py_asgi_http_emit_disconnect(http);
+ }
}