summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nginx/src/core/ngx_connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/nginx/src/core/ngx_connection.c')
-rw-r--r--usr.sbin/nginx/src/core/ngx_connection.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/usr.sbin/nginx/src/core/ngx_connection.c b/usr.sbin/nginx/src/core/ngx_connection.c
index 8fae8c122ce..7ed781e0add 100644
--- a/usr.sbin/nginx/src/core/ngx_connection.c
+++ b/usr.sbin/nginx/src/core/ngx_connection.c
@@ -336,10 +336,10 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
- if (ls[i].sockaddr->sa_family == AF_INET6 && ls[i].ipv6only) {
+ if (ls[i].sockaddr->sa_family == AF_INET6) {
int ipv6only;
- ipv6only = (ls[i].ipv6only == 1);
+ ipv6only = ls[i].ipv6only;
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
(const void *) &ipv6only, sizeof(int))
@@ -900,11 +900,9 @@ ngx_close_connection(ngx_connection_t *c)
c->read->closed = 1;
c->write->closed = 1;
- if (c->single_connection) {
- ngx_unlock(&c->lock);
- c->read->locked = 0;
- c->write->locked = 0;
- }
+ ngx_unlock(&c->lock);
+ c->read->locked = 0;
+ c->write->locked = 0;
ngx_mutex_unlock(ngx_posted_events_mutex);
@@ -972,6 +970,10 @@ ngx_reusable_connection(ngx_connection_t *c, ngx_uint_t reusable)
if (c->reusable) {
ngx_queue_remove(&c->queue);
+
+#if (NGX_STAT_STUB)
+ (void) ngx_atomic_fetch_add(ngx_stat_waiting, -1);
+#endif
}
c->reusable = reusable;
@@ -981,6 +983,10 @@ ngx_reusable_connection(ngx_connection_t *c, ngx_uint_t reusable)
ngx_queue_insert_head(
(ngx_queue_t *) &ngx_cycle->reusable_connections_queue, &c->queue);
+
+#if (NGX_STAT_STUB)
+ (void) ngx_atomic_fetch_add(ngx_stat_waiting, 1);
+#endif
}
}