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
37cff373
Commit
37cff373
authored
Jun 23, 2017
by
Ondřej Kuzník
Committed by
Ondřej Kuzník
Nov 17, 2020
Browse files
Manage connection refcnt better
parent
af7ce80c
Changes
3
Hide whitespace changes
Inline
Side-by-side
servers/lloadd/client.c
View file @
37cff373
...
...
@@ -111,7 +111,10 @@ client_read_cb( evutil_socket_t s, short what, void *arg )
"suspended read event on connid=%lu
\n
"
,
c
->
c_connid
);
CONNECTION_UNLOCK
(
c
);
/* We have scheduled a call to handle_requests which takes care of
* handling further requests, just make sure the connection sticks around
* for that */
CONNECTION_UNLOCK_INCREF
(
c
);
return
;
}
...
...
@@ -121,7 +124,7 @@ handle_requests( void *ctx, void *arg )
Connection
*
c
=
arg
;
int
requests_handled
=
0
;
CONNECTION_LOCK
(
c
);
CONNECTION_LOCK
_DECREF
(
c
);
for
(
;
requests_handled
<
slap_conn_max_pdus_per_cycle
;
requests_handled
++
)
{
BerElement
*
ber
;
...
...
servers/lloadd/operation.c
View file @
37cff373
...
...
@@ -237,7 +237,7 @@ operation_destroy_from_client( Operation *op )
ldap_pvt_thread_mutex_unlock
(
&
op
->
o_mutex
);
assert
(
upstream
!=
NULL
);
CONNECTION_UNLOCK
(
upstream
);
UPSTREAM_UNLOCK_OR_DESTROY
(
upstream
);
CONNECTION_LOCK_DECREF
(
client
);
return
;
}
...
...
@@ -381,7 +381,7 @@ operation_destroy_from_upstream( Operation *op )
ldap_pvt_thread_mutex_unlock
(
&
op
->
o_mutex
);
assert
(
client
!=
NULL
);
C
ONNECTION_UNLOCK
(
client
);
C
LIENT_UNLOCK_OR_DESTROY
(
client
);
CONNECTION_LOCK_DECREF
(
upstream
);
return
;
}
...
...
@@ -743,11 +743,13 @@ fail:
if
(
upstream
)
{
ldap_pvt_thread_mutex_unlock
(
&
upstream
->
c_io_mutex
);
CONNECTION_LOCK_DECREF
(
upstream
);
upstream
->
c_n_ops_executing
--
;
UPSTREAM_UNLOCK_OR_DESTROY
(
upstream
);
operation_send_reject
(
op
,
LDAP_OTHER
,
"internal error"
,
0
);
}
CONNECTION_LOCK_DECREF
(
client
);
op
->
o_client_refcnt
--
;
operation_destroy_from_client
(
op
);
return
rc
;
CLIENT_UNLOCK_OR_DESTROY
(
client
);
return
-
1
;
}
servers/lloadd/upstream.c
View file @
37cff373
...
...
@@ -922,9 +922,11 @@ upstream_destroy( Connection *c )
root
=
c
->
c_ops
;
c
->
c_ops
=
NULL
;
executing
=
c
->
c_n_ops_executing
;
c
->
c_n_ops_executing
=
0
;
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
);
...
...
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