summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/nxt_h1proto.c3
-rw-r--r--src/nxt_http.h6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/nxt_h1proto.c b/src/nxt_h1proto.c
index 4203d62f..12be4172 100644
--- a/src/nxt_h1proto.c
+++ b/src/nxt_h1proto.c
@@ -862,9 +862,8 @@ nxt_h1p_keepalive(nxt_task_t *task, nxt_h1proto_t *h1p, nxt_conn_t *c)
b = h1p->buffers;
- nxt_memzero(&h1p->parser, sizeof(nxt_h1proto_t));
+ nxt_memzero(h1p, offsetof(nxt_h1proto_t, conn));
- h1p->conn = c;
in = c->read;
size = nxt_buf_mem_used_size(&in->mem);
diff --git a/src/nxt_http.h b/src/nxt_http.h
index e857ded4..f3143687 100644
--- a/src/nxt_http.h
+++ b/src/nxt_http.h
@@ -55,8 +55,12 @@ typedef struct {
nxt_http_te_t transfer_encoding:8; /* 2 bits */
nxt_http_request_t *request;
- nxt_conn_t *conn;
nxt_buf_t *buffers;
+ /*
+ * All fields before the conn field will
+ * be zeroed in a keep-alive connection.
+ */
+ nxt_conn_t *conn;
} nxt_h1proto_t;