summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_python_wsgi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nxt_python_wsgi.c')
-rw-r--r--src/nxt_python_wsgi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nxt_python_wsgi.c b/src/nxt_python_wsgi.c
index d925b33f..3a5f1913 100644
--- a/src/nxt_python_wsgi.c
+++ b/src/nxt_python_wsgi.c
@@ -1136,11 +1136,13 @@ nxt_py_input_read(nxt_py_input_t *self, PyObject *args)
return NULL;
}
- return PyErr_Format(PyExc_ValueError,
- "the read body size cannot be zero or less");
+ if (size != -1) {
+ return PyErr_Format(PyExc_ValueError,
+ "the read body size cannot be zero or less");
+ }
}
- if (size == 0 || size > (Py_ssize_t) ctx->req->content_length) {
+ if (size == -1 || size > (Py_ssize_t) ctx->req->content_length) {
size = ctx->req->content_length;
}
}