Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: Add Django 5.x compatibility #1563

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/python/nxt_python_asgi_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typedef struct {
Py_ssize_t send_body_off;
uint8_t complete;
uint8_t closed;
uint8_t empty_body_received;
uint8_t request_received;
} nxt_py_asgi_http_t;


Expand Down Expand Up @@ -102,7 +102,7 @@ nxt_py_asgi_http_create(nxt_unit_request_info_t *req)
http->send_body_off = 0;
http->complete = 0;
http->closed = 0;
http->empty_body_received = 0;
http->request_received = 0;
}

return (PyObject *) http;
Expand Down Expand Up @@ -177,11 +177,9 @@ nxt_py_asgi_http_read_msg(nxt_py_asgi_http_t *http)
}

if (size == 0) {
if (http->empty_body_received) {
if (http->request_received) {
Py_RETURN_NONE;
}

http->empty_body_received = 1;
}

if (size > 0) {
Expand Down Expand Up @@ -234,6 +232,8 @@ nxt_py_asgi_http_read_msg(nxt_py_asgi_http_t *http)

Py_XDECREF(body);

http->request_received = 1;

return msg;
}

Expand Down
Loading