From b40e40ec3c521518c59dc44d5ed3c255712dd6af Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 11 Dec 2002 18:36:02 +0000 Subject: [PATCH] undef CONNECTION_INPUT_LOOP, use DATA_READY_LOOP. Seems to help prevent hangs in heavy load situations. --- servers/slapd/connection.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 8dbf0e63d7..9a18de7bd1 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -1227,17 +1227,21 @@ int connection_read(ber_socket_t s) } #endif -#define CONNECTION_INPUT_LOOP 1 +/* #define CONNECTION_INPUT_LOOP 1 */ +#define DATA_READY_LOOP 1 -#ifdef DATA_READY_LOOP - while( !rc && ber_sockbuf_ctrl( c->c_sb, LBER_SB_DATA_READY, NULL ) ) -#elif CONNECTION_INPUT_LOOP - while(!rc) -#endif + do { /* How do we do this without getting into a busy loop ? */ rc = connection_input( c ); } +#ifdef DATA_READY_LOOP + while( !rc && ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_DATA_READY, NULL ) ); +#elif CONNECTION_INPUT_LOOP + while(!rc); +#else + while(0); +#endif if( rc < 0 ) { #ifdef NEW_LOGGING -- 2.39.5