mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-27 01:59:38 -05:00
Do not read on the last iteration.
When the pdu processing limit is hit, we still attempt to read another PDU. If we succeed, the ber_get_next call in the read callback will abort since a full PDU is already present.
This commit is contained in:
parent
65def94380
commit
7046444327
2 changed files with 12 additions and 4 deletions
|
|
@ -130,8 +130,7 @@ handle_requests( void *ctx, void *arg )
|
|||
int requests_handled = 0;
|
||||
|
||||
CONNECTION_LOCK_DECREF(c);
|
||||
for ( ; requests_handled < slap_conn_max_pdus_per_cycle;
|
||||
requests_handled++ ) {
|
||||
for ( ;; ) {
|
||||
BerElement *ber;
|
||||
ber_tag_t tag;
|
||||
ber_len_t len;
|
||||
|
|
@ -145,6 +144,11 @@ handle_requests( void *ctx, void *arg )
|
|||
}
|
||||
/* Otherwise, handle_one_request leaves the connection locked */
|
||||
|
||||
if ( ++requests_handled >= slap_conn_max_pdus_per_cycle ) {
|
||||
/* Do not read now, re-enable read event instead */
|
||||
break;
|
||||
}
|
||||
|
||||
if ( (ber = ber_alloc()) == NULL ) {
|
||||
Debug( LDAP_DEBUG_ANY, "client_read_cb: "
|
||||
"ber_alloc failed\n" );
|
||||
|
|
|
|||
|
|
@ -465,8 +465,7 @@ handle_responses( void *ctx, void *arg )
|
|||
int responses_handled = 0;
|
||||
|
||||
CONNECTION_LOCK_DECREF(c);
|
||||
for ( ; responses_handled < slap_conn_max_pdus_per_cycle;
|
||||
responses_handled++ ) {
|
||||
for ( ;; ) {
|
||||
BerElement *ber;
|
||||
ber_tag_t tag;
|
||||
ber_len_t len;
|
||||
|
|
@ -480,6 +479,11 @@ handle_responses( void *ctx, void *arg )
|
|||
}
|
||||
/* Otherwise, handle_one_response leaves the connection locked */
|
||||
|
||||
if ( ++responses_handled >= slap_conn_max_pdus_per_cycle ) {
|
||||
/* Do not read now, re-enable read event instead */
|
||||
break;
|
||||
}
|
||||
|
||||
if ( (ber = ber_alloc()) == NULL ) {
|
||||
Debug( LDAP_DEBUG_ANY, "handle_responses: "
|
||||
"ber_alloc failed\n" );
|
||||
|
|
|
|||
Loading…
Reference in a new issue