HTTP keep-alive connections support.

This commit is contained in:
Igor Sysoev
2017-12-28 16:01:06 +03:00
parent 497faf1b9a
commit 9a6d3c5775
17 changed files with 2000 additions and 898 deletions

View File

@@ -775,11 +775,7 @@ nxt_py_start_resp(PyObject *self, PyObject *args)
nxt_uint_t i, n;
nxt_python_run_ctx_t *ctx;
static const u_char resp[] = "HTTP/1.1 ";
static const u_char default_headers[]
= "Server: unit/" NXT_VERSION "\r\n"
"Connection: close\r\n";
static const u_char status[] = "Status: ";
static const u_char cr_lf[] = "\r\n";
static const u_char sc_sp[] = ": ";
@@ -794,7 +790,7 @@ nxt_py_start_resp(PyObject *self, PyObject *args)
ctx = nxt_python_run_ctx;
nxt_python_write(ctx, resp, sizeof(resp) - 1, 0, 0);
nxt_python_write(ctx, status, sizeof(status) - 1, 0, 0);
rc = nxt_python_write_py_str(ctx, string, 0, 0);
if (nxt_slow_path(rc != NXT_OK)) {
@@ -804,8 +800,6 @@ nxt_py_start_resp(PyObject *self, PyObject *args)
nxt_python_write(ctx, cr_lf, sizeof(cr_lf) - 1, 0, 0);
nxt_python_write(ctx, default_headers, sizeof(default_headers) - 1, 0, 0);
headers = PyTuple_GET_ITEM(args, 1);
if (!PyList_Check(headers)) {