1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
From: =?utf-8?q?Witold_Kr=C4=99cicki?= <wpk@isc.org>
Date: Wed, 16 Oct 2019 13:18:48 +0200
Subject: libns: Rename ns_tcpconn refs member to clients
(cherry picked from commit b6d6b50c997b3a00fdde9e0d32c4594ffe94f369)
---
bin/named/client.c | 16 ++++++++--------
bin/named/include/named/client.h | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/bin/named/client.c b/bin/named/client.c
index 30877c5..5dc309a 100644
--- a/bin/named/client.c
+++ b/bin/named/client.c
@@ -345,7 +345,7 @@ tcpconn_init(ns_client_t *client, bool force) {
*/
tconn = isc_mem_allocate(ns_g_mctx, sizeof(*tconn));
- isc_refcount_init(&tconn->refs, 1); /* Current client */
+ isc_refcount_init(&tconn->clients, 1); /* Current client */
tconn->tcpquota = quota;
quota = NULL;
tconn->pipelined = false;
@@ -362,14 +362,14 @@ tcpconn_init(ns_client_t *client, bool force) {
*/
static void
tcpconn_attach(ns_client_t *source, ns_client_t *target) {
- int refs;
+ int old_clients;
REQUIRE(source->tcpconn != NULL);
REQUIRE(target->tcpconn == NULL);
REQUIRE(source->tcpconn->pipelined);
- isc_refcount_increment(&source->tcpconn->refs, &refs);
- INSIST(refs > 1);
+ isc_refcount_increment(&source->tcpconn->clients, &old_clients);
+ INSIST(old_clients > 1);
target->tcpconn = source->tcpconn;
}
@@ -382,15 +382,15 @@ tcpconn_attach(ns_client_t *source, ns_client_t *target) {
static void
tcpconn_detach(ns_client_t *client) {
ns_tcpconn_t *tconn = NULL;
- int refs;
+ int old_clients;
REQUIRE(client->tcpconn != NULL);
tconn = client->tcpconn;
client->tcpconn = NULL;
- isc_refcount_decrement(&tconn->refs, &refs);
- if (refs == 0) {
+ isc_refcount_decrement(&tconn->clients, &old_clients);
+ if (old_clients == 0) {
isc_quota_detach(&tconn->tcpquota);
isc_mem_free(ns_g_mctx, tconn);
}
@@ -2648,7 +2648,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
* Limit the maximum number of simultaenous pipelined
* queries on TCP connection to TCP_CLIENTS_PER_CONN.
*/
- if ((isc_refcount_current(&client->tcpconn->refs)
+ if ((isc_refcount_current(&client->tcpconn->clients)
> TCP_CLIENTS_PER_CONN))
{
client->tcpconn->pipelined = false;
diff --git a/bin/named/include/named/client.h b/bin/named/include/named/client.h
index 5ae10ae..01b6141 100644
--- a/bin/named/include/named/client.h
+++ b/bin/named/include/named/client.h
@@ -80,7 +80,7 @@
/*% reference-counted TCP connection object */
typedef struct ns_tcpconn {
- isc_refcount_t refs; /* Number of clients using
+ isc_refcount_t clients; /* Number of clients using
* this connection. Conn can
* be freed if goes to 0
*/
|