Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
James Lowden
OpenLDAP
Commits
03fd98cb
Commit
03fd98cb
authored
Aug 10, 2020
by
Ondřej Kuzník
Committed by
Quanah Gibson-Mount
May 10, 2021
Browse files
ITS#8747 Keep an explicit backend pointer
parent
c88a448c
Changes
6
Hide whitespace changes
Inline
Side-by-side
servers/lloadd/bind.c
View file @
03fd98cb
...
...
@@ -390,7 +390,7 @@ request_bind( LloadConnection *client, LloadOperation *op )
if
(
ber
==
NULL
&&
(
ber
=
ber_alloc
())
==
NULL
)
{
checked_unlock
(
&
upstream
->
c_io_mutex
);
if
(
!
pin
)
{
LloadBackend
*
b
=
upstream
->
c_
private
;
LloadBackend
*
b
=
upstream
->
c_
backend
;
upstream
->
c_n_ops_executing
--
;
CONNECTION_UNLOCK
(
upstream
);
...
...
@@ -440,7 +440,7 @@ request_bind( LloadConnection *client, LloadOperation *op )
/* Was it unlinked in the meantime? No need to send a response since the
* client is dead */
if
(
!
IS_ALIVE
(
op
,
o_refcnt
)
)
{
LloadBackend
*
b
=
upstream
->
c_
private
;
LloadBackend
*
b
=
upstream
->
c_
backend
;
upstream
->
c_n_ops_executing
--
;
checked_unlock
(
&
upstream
->
c_io_mutex
);
...
...
@@ -786,7 +786,7 @@ handle_whoami_response(
LloadBackend
*
b
;
CONNECTION_LOCK
(
upstream
);
b
=
(
LloadBackend
*
)
upstream
->
c_
private
;
b
=
upstream
->
c_
backend
;
Debug
(
LDAP_DEBUG_ANY
,
"handle_whoami_response: "
"Who Am I? extended operation not supported on backend %s, "
"proxyauthz with clients that do SASL binds will not work "
...
...
@@ -883,7 +883,7 @@ handle_vc_bind_response(
LloadBackend
*
b
;
CONNECTION_LOCK
(
upstream
);
b
=
(
LloadBackend
*
)
upstream
->
c_
private
;
b
=
upstream
->
c_
backend
;
Debug
(
LDAP_DEBUG_ANY
,
"handle_vc_bind_response: "
"VC extended operation not supported on backend %s
\n
"
,
b
->
b_uri
.
bv_val
);
...
...
servers/lloadd/client.c
View file @
03fd98cb
...
...
@@ -111,7 +111,7 @@ request_process( LloadConnection *client, LloadOperation *op )
/* Was it unlinked in the meantime? No need to send a response since the
* client is dead */
if
(
!
IS_ALIVE
(
op
,
o_refcnt
)
)
{
LloadBackend
*
b
=
upstream
->
c_
private
;
LloadBackend
*
b
=
upstream
->
c_
backend
;
upstream
->
c_n_ops_executing
--
;
checked_unlock
(
&
upstream
->
c_io_mutex
);
...
...
@@ -132,7 +132,7 @@ request_process( LloadConnection *client, LloadOperation *op )
output
=
upstream
->
c_pendingber
;
if
(
output
==
NULL
&&
(
output
=
ber_alloc
())
==
NULL
)
{
LloadBackend
*
b
=
upstream
->
c_
private
;
LloadBackend
*
b
=
upstream
->
c_
backend
;
upstream
->
c_n_ops_executing
--
;
CONNECTION_UNLOCK
(
upstream
);
...
...
servers/lloadd/daemon.c
View file @
03fd98cb
...
...
@@ -1403,7 +1403,7 @@ backend_conn_cb( ldap_pvt_thread_start_t *start, void *startarg, void *arg )
LloadConnection
*
c
=
startarg
;
LloadBackend
*
b
=
arg
;
if
(
b
==
NULL
||
c
->
c_
private
==
b
)
{
if
(
b
==
NULL
||
c
->
c_
backend
==
b
)
{
CONNECTION_LOCK_DESTROY
(
c
);
return
1
;
}
...
...
servers/lloadd/lload.h
View file @
03fd98cb
...
...
@@ -402,6 +402,8 @@ struct LloadConnection {
long
c_n_ops_completed
;
/* num of ops completed */
lload_counters_t
c_counters
;
/* per connection operation counters */
LloadBackend
*
c_backend
;
/*
* Protected by the CIRCLEQ mutex:
* - Client: clients_mutex
...
...
servers/lloadd/operation.c
View file @
03fd98cb
...
...
@@ -328,7 +328,7 @@ operation_unlink_upstream( LloadOperation *op, LloadConnection *upstream )
}
}
operation_update_conn_counters
(
op
,
upstream
);
b
=
(
LloadBackend
*
)
upstream
->
c_
private
;
b
=
upstream
->
c_
backend
;
}
if
(
upstream
->
c_state
==
LLOAD_C_CLOSING
&&
!
upstream
->
c_ops
)
{
CONNECTION_DESTROY
(
upstream
);
...
...
@@ -520,7 +520,7 @@ connection_timeout( LloadConnection *upstream, void *arg )
{
LloadOperation
*
op
;
TAvlnode
*
ops
=
NULL
,
*
node
,
*
next
;
LloadBackend
*
b
=
upstream
->
c_
private
;
LloadBackend
*
b
=
upstream
->
c_
backend
;
time_t
threshold
=
*
(
time_t
*
)
arg
;
int
rc
,
nops
=
0
;
...
...
servers/lloadd/upstream.c
View file @
03fd98cb
...
...
@@ -273,7 +273,7 @@ fail:
static
int
sasl_bind_step
(
LloadConnection
*
c
,
BerValue
*
scred
,
BerValue
*
ccred
)
{
LloadBackend
*
b
=
c
->
c_
private
;
LloadBackend
*
b
=
c
->
c_
backend
;
sasl_conn_t
*
ctx
=
c
->
c_sasl_authctx
;
sasl_interact_t
*
prompts
=
NULL
;
unsigned
credlen
;
...
...
@@ -405,7 +405,7 @@ int
upstream_bind_cb
(
LloadConnection
*
c
)
{
BerElement
*
ber
=
c
->
c_currentber
;
LloadBackend
*
b
=
c
->
c_
private
;
LloadBackend
*
b
=
c
->
c_
backend
;
BerValue
matcheddn
,
message
;
ber_tag_t
tag
;
ber_int_t
msgid
,
result
;
...
...
@@ -611,7 +611,7 @@ fail:
static
int
upstream_finish
(
LloadConnection
*
c
)
{
LloadBackend
*
b
=
c
->
c_
private
;
LloadBackend
*
b
=
c
->
c_
backend
;
int
is_bindconn
=
0
;
assert_locked
(
&
b
->
b_mutex
);
...
...
@@ -706,7 +706,7 @@ upstream_tls_handshake_cb( evutil_socket_t s, short what, void *arg )
c
->
c_connid
);
goto
fail
;
}
b
=
c
->
c_
private
;
b
=
c
->
c_
backend
;
rc
=
ldap_pvt_tls_connect
(
lload_tls_backend_ld
,
c
->
c_sb
,
b
->
b_host
);
if
(
rc
<
0
)
{
...
...
@@ -815,7 +815,7 @@ upstream_starttls( LloadConnection *c )
}
if
(
result
!=
LDAP_SUCCESS
)
{
LloadBackend
*
b
=
c
->
c_
private
;
LloadBackend
*
b
=
c
->
c_
backend
;
int
rc
;
Debug
(
LDAP_DEBUG_STATS
,
"upstream_starttls: "
...
...
@@ -896,7 +896,7 @@ upstream_init( ber_socket_t s, LloadBackend *b )
}
CONNECTION_LOCK
(
c
);
c
->
c_
private
=
b
;
c
->
c_
backend
=
b
;
#ifdef HAVE_TLS
c
->
c_is_tls
=
b
->
b_tls
;
#endif
...
...
@@ -993,7 +993,7 @@ fail:
static
void
upstream_unlink
(
LloadConnection
*
c
)
{
LloadBackend
*
b
=
c
->
c_
private
;
LloadBackend
*
b
=
c
->
c_
backend
;
struct
event
*
read_event
,
*
write_event
;
TAvlnode
*
root
;
long
freed
,
executing
;
...
...
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