Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
873d6fa3
Commit
873d6fa3
authored
Jun 14, 2017
by
Ondřej Kuzník
Committed by
Ondřej Kuzník
Nov 17, 2020
Browse files
Handle backend unsolicited response properly
parent
9d3b998a
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/lloadd/upstream.c
View file @
873d6fa3
...
...
@@ -271,25 +271,13 @@ done:
static
int
handle_unsolicited
(
Connection
*
c
,
BerElement
*
ber
)
{
TAvlnode
*
root
;
long
freed
,
executing
;
c
->
c_state
=
SLAP_C_CLOSING
;
Debug
(
LDAP_DEBUG_CONNS
,
"handle_unsolicited: "
"teardown for upstream connection %lu
\n
"
,
c
->
c_connid
);
root
=
c
->
c_ops
;
c
->
c_ops
=
NULL
;
executing
=
c
->
c_n_ops_executing
;
CONNECTION_UNLOCK_INCREF
(
c
);
freed
=
tavl_free
(
root
,
(
AVL_FREE
)
operation_lost_upstream
);
assert
(
freed
==
executing
);
Debug
(
LDAP_DEBUG_TRACE
,
"handle_unsolicited: "
"dropped %ld operations
\n
"
,
freed
);
UPSTREAM_LOCK_DESTROY
(
c
);
UPSTREAM_DESTROY
(
c
);
ber_free
(
ber
,
1
);
return
-
1
;
...
...
@@ -902,7 +890,7 @@ upstream_destroy( Connection *c )
Backend
*
b
=
c
->
c_private
;
struct
event
*
read_event
,
*
write_event
;
TAvlnode
*
root
;
long
freed
;
long
freed
,
executing
;
Debug
(
LDAP_DEBUG_CONNS
,
"upstream_destroy: "
"freeing connection %lu
\n
"
,
...
...
@@ -912,12 +900,14 @@ upstream_destroy( Connection *c )
root
=
c
->
c_ops
;
c
->
c_ops
=
NULL
;
executing
=
c
->
c_n_ops_executing
;
read_event
=
c
->
c_read_event
;
write_event
=
c
->
c_write_event
;
CONNECTION_UNLOCK_INCREF
(
c
);
freed
=
tavl_free
(
root
,
(
AVL_FREE
)
operation_lost_upstream
);
assert
(
freed
==
executing
);
/*
* Avoid a deadlock:
...
...
@@ -940,7 +930,7 @@ upstream_destroy( Connection *c )
LDAP_CIRCLEQ_REMOVE
(
&
b
->
b_conns
,
c
,
c_next
);
b
->
b_active
--
;
}
b
->
b_n_ops_executing
-=
c
->
c_n_ops_
executing
;
b
->
b_n_ops_executing
-=
executing
;
ldap_pvt_thread_mutex_unlock
(
&
b
->
b_mutex
);
backend_retry
(
b
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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