summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_conn.h
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2022-09-13 13:17:16 +0400
committerKonstantin Pavlov <thresh@nginx.com>2022-09-13 13:17:16 +0400
commitce964aa30b163e2b3263c5af57c1a6dae7d0cebb (patch)
tree26bf70c1a5991f6471fc4caed8628e068fdc0b7b /src/nxt_conn.h
parenteba4c3c98fa1bf275d94df8c727f70692ae7eae1 (diff)
parent38bd7e76a134084ab95a4ee3125af1ccd7b35864 (diff)
downloadunit-ce964aa30b163e2b3263c5af57c1a6dae7d0cebb.tar.gz
unit-ce964aa30b163e2b3263c5af57c1a6dae7d0cebb.tar.bz2
Merged with the default branch.1.28.0-1
Diffstat (limited to 'src/nxt_conn.h')
-rw-r--r--src/nxt_conn.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nxt_conn.h b/src/nxt_conn.h
index a443601f..8a703e9a 100644
--- a/src/nxt_conn.h
+++ b/src/nxt_conn.h
@@ -160,6 +160,7 @@ struct nxt_conn_s {
uint8_t block_read; /* 1 bit */
uint8_t block_write; /* 1 bit */
uint8_t delayed; /* 1 bit */
+ uint8_t idle; /* 1 bit */
#define NXT_CONN_SENDFILE_OFF 0
#define NXT_CONN_SENDFILE_ON 1
@@ -294,6 +295,28 @@ NXT_EXPORT void nxt_event_conn_job_sendfile(nxt_task_t *task,
} while (0)
+#define nxt_conn_idle(engine, c) \
+ do { \
+ nxt_event_engine_t *e = engine; \
+ \
+ nxt_queue_insert_head(&e->idle_connections, &c->link); \
+ \
+ c->idle = 1; \
+ e->idle_conns_cnt++; \
+ } while (0)
+
+
+#define nxt_conn_active(engine, c) \
+ do { \
+ nxt_event_engine_t *e = engine; \
+ \
+ nxt_queue_remove(&c->link); \
+ \
+ c->idle = 0; \
+ e->idle_conns_cnt--; \
+ } while (0)
+
+
extern nxt_conn_io_t nxt_unix_conn_io;