summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_python_wsgi.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-06-25 16:51:47 +0300
committerValentin Bartenev <vbart@nginx.com>2018-06-25 16:51:47 +0300
commit1a52d876f7e10d07f58deee6faeaf70a11a6110f (patch)
treef69ba903180b3deac3bba2ee7acda9d34f18d73c /src/nxt_python_wsgi.c
parentaf31012815e20f0c92ed6ea803638a16ba47b0c2 (diff)
downloadunit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.gz
unit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.bz2
Introduced nxt_length() macro.
Diffstat (limited to '')
-rw-r--r--src/nxt_python_wsgi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nxt_python_wsgi.c b/src/nxt_python_wsgi.c
index 49063ae9..4b90483e 100644
--- a/src/nxt_python_wsgi.c
+++ b/src/nxt_python_wsgi.c
@@ -870,7 +870,7 @@ nxt_py_start_resp(PyObject *self, PyObject *args)
string = PyTuple_GET_ITEM(args, 0);
- nxt_python_write(ctx, status, sizeof(status) - 1, 0, 0);
+ nxt_python_write(ctx, status, nxt_length(status), 0, 0);
rc = nxt_python_write_py_str(ctx, string, 0, 0);
if (nxt_slow_path(rc != NXT_OK)) {
@@ -878,7 +878,7 @@ nxt_py_start_resp(PyObject *self, PyObject *args)
"failed to write first argument (not a string?)");
}
- nxt_python_write(ctx, cr_lf, sizeof(cr_lf) - 1, 0, 0);
+ nxt_python_write(ctx, cr_lf, nxt_length(cr_lf), 0, 0);
headers = PyTuple_GET_ITEM(args, 1);
@@ -909,7 +909,7 @@ nxt_py_start_resp(PyObject *self, PyObject *args)
" (not a string?)");
}
- nxt_python_write(ctx, sc_sp, sizeof(sc_sp) - 1, 0, 0);
+ nxt_python_write(ctx, sc_sp, nxt_length(sc_sp), 0, 0);
string = PyTuple_GET_ITEM(tuple, 1);
@@ -920,11 +920,11 @@ nxt_py_start_resp(PyObject *self, PyObject *args)
" (not a string?)");
}
- nxt_python_write(ctx, cr_lf, sizeof(cr_lf) - 1, 0, 0);
+ nxt_python_write(ctx, cr_lf, nxt_length(cr_lf), 0, 0);
}
/* flush headers */
- nxt_python_write(ctx, cr_lf, sizeof(cr_lf) - 1, 1, 0);
+ nxt_python_write(ctx, cr_lf, nxt_length(cr_lf), 1, 0);
Py_INCREF(nxt_py_write_obj);
return nxt_py_write_obj;