]> git.sur5r.net Git - openldap/commitdiff
Only install readahead layer when connectionless as
authorKurt Zeilenga <kurt@openldap.org>
Fri, 14 Feb 2003 23:32:30 +0000 (23:32 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 14 Feb 2003 23:32:30 +0000 (23:32 +0000)
streams as streams may block.

libraries/libldap/open.c

index 29ee1353495c70c4f27e96ed74841fa62a5da03e..944e1f49700ea1b2dbb0ce5c9d7d7d4bb1676c43 100644 (file)
@@ -286,8 +286,8 @@ ldap_int_open_connection(
                        sasl_host = ldap_host_connected_to( conn->lconn_sb );
 #endif
                        break;
-#ifdef LDAP_CONNECTIONLESS
 
+#ifdef LDAP_CONNECTIONLESS
                case LDAP_PROTO_UDP:
                        port = srv->lud_port;
 
@@ -312,6 +312,10 @@ ldap_int_open_connection(
 #endif
                        ber_sockbuf_add_io( conn->lconn_sb, &ber_sockbuf_io_udp,
                                LBER_SBIOD_LEVEL_PROVIDER, NULL );
+
+                       ber_sockbuf_add_io( conn->lconn_sb, &ber_sockbuf_io_readahead,
+                               LBER_SBIOD_LEVEL_PROVIDER, NULL );
+
                        break;
 #endif
                case LDAP_PROTO_IPC:
@@ -337,9 +341,6 @@ ldap_int_open_connection(
                        break;
        }
 
-       ber_sockbuf_add_io( conn->lconn_sb, &ber_sockbuf_io_readahead,
-               LBER_SBIOD_LEVEL_PROVIDER, NULL );
-
 #ifdef LDAP_DEBUG
        ber_sockbuf_add_io( conn->lconn_sb, &ber_sockbuf_io_debug,
                INT_MAX, (void *)"ldap_" );