From: Kurt Zeilenga Date: Thu, 12 Dec 2002 00:08:45 +0000 (+0000) Subject: Use data ready loop X-Git-Tag: OPENLDAP_REL_ENG_2_1_10~22 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6cf86c59f8fec52fd6389a8d9695c78740e0d235;p=openldap Use data ready loop --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index aeed4237b8..236fedfa45 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -1221,17 +1221,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