Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
63efcd63
Commit
63efcd63
authored
Apr 16, 2019
by
Ondřej Kuzník
Browse files
Reuse connection walking in monitor for upstreams too
parent
3bd2d748
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/lloadd/monitor.c
View file @
63efcd63
...
...
@@ -637,9 +637,11 @@ lload_monitor_up_conn_create(
{
monitor_entry_t
*
mp_parent
;
monitor_subsys_t
*
ms
;
LloadConnection
*
c
;
LloadBackend
*
b
;
struct
lload_monitor_conn_arg
*
arg
;
struct
lload_monitor_conn_arg
arg
=
{
.
op
=
op
,
.
ep
=
ep
,
};
assert
(
e_parent
->
e_private
!=
NULL
);
...
...
@@ -651,23 +653,16 @@ lload_monitor_up_conn_create(
return
-
1
;
}
arg
=
ch_calloc
(
1
,
sizeof
(
struct
lload_monitor_conn_arg
)
);
arg
->
op
=
op
;
arg
->
ep
=
ep
;
arg
->
ms
=
ms
;
arg
.
ms
=
ms
;
/* How to avoid this long lock? */
ldap_pvt_thread_mutex_lock
(
&
b
->
b_mutex
);
LDAP_CIRCLEQ_FOREACH
(
c
,
&
b
->
b_conns
,
c_next
)
{
lload_monitor_up_conn_entry
(
c
,
arg
);
}
connections_walk_last
(
&
b
->
b_mutex
,
&
b
->
b_conns
,
b
->
b_last_conn
,
lload_monitor_up_conn_entry
,
&
arg
);
LDAP_CIRCLEQ_FOREACH
(
c
,
&
b
->
b_bindconns
,
c_next
)
{
lload_monitor_up_conn_entry
(
c
,
arg
);
}
connections_walk_last
(
&
b
->
b_mutex
,
&
b
->
b_bindconns
,
b
->
b_last_bindconn
,
lload_monitor_up_conn_entry
,
&
arg
);
ldap_pvt_thread_mutex_unlock
(
&
b
->
b_mutex
);
ch_free
(
arg
);
return
0
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment