]> git.sur5r.net Git - openldap/commitdiff
Use data ready loop
authorKurt Zeilenga <kurt@openldap.org>
Thu, 12 Dec 2002 00:08:45 +0000 (00:08 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 12 Dec 2002 00:08:45 +0000 (00:08 +0000)
servers/slapd/connection.c

index aeed4237b8da68fc7fdef23307db4d29c1b00e7c..236fedfa45e835d5513b4afc77532a582a34e017 100644 (file)
@@ -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