From 1a52d876f7e10d07f58deee6faeaf70a11a6110f Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Mon, 25 Jun 2018 16:51:47 +0300 Subject: Introduced nxt_length() macro. --- src/nxt_python_wsgi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/nxt_python_wsgi.c') 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; -- cgit