#ifdef LDAP_CONNECTIONLESS
c->c_is_udp = 0;
- if (tls_udp_option == 2)
- {
+ if( tls_udp_option == 2 ) {
c->c_is_udp = 1;
#ifdef LDAP_DEBUG
- ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_debug,
- LBER_SBIOD_LEVEL_PROVIDER, (void*)"udp_" );
+ ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_debug,
+ LBER_SBIOD_LEVEL_PROVIDER, (void*)"udp_" );
#endif
- ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_udp,
- LBER_SBIOD_LEVEL_PROVIDER, (void *)&s );
- ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_readahead,
- LBER_SBIOD_LEVEL_PROVIDER, NULL );
+ ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_udp,
+ LBER_SBIOD_LEVEL_PROVIDER, (void *)&s );
+ ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_readahead,
+ LBER_SBIOD_LEVEL_PROVIDER, NULL );
} else
#endif
{
#ifdef LDAP_DEBUG
- ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_debug,
- LBER_SBIOD_LEVEL_PROVIDER, (void*)"tcp_" );
+ ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_debug,
+ LBER_SBIOD_LEVEL_PROVIDER, (void*)"tcp_" );
#endif
- ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_tcp,
- LBER_SBIOD_LEVEL_PROVIDER, (void *)&s );
+ ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_tcp,
+ LBER_SBIOD_LEVEL_PROVIDER, (void *)&s );
}
#ifdef LDAP_DEBUG
char *cdn = NULL;
#endif
- if ( conn->c_currentber == NULL && (conn->c_currentber = ber_alloc())
- == NULL ) {
+ if ( conn->c_currentber == NULL &&
+ ( conn->c_currentber = ber_alloc()) == NULL )
+ {
#ifdef NEW_LOGGING
LDAP_LOG( CONNECTION, ERR,
"connection_input: conn %lu ber_alloc failed.\n",
errno = 0;
#ifdef LDAP_CONNECTIONLESS
- if (conn->c_is_udp)
- {
+ if ( conn->c_is_udp ) {
char peername[sizeof("IP=255.255.255.255:65336")];
len = ber_int_sb_read(conn->c_sb, &peeraddr,
sizeof(struct sockaddr));
}
#ifdef LDAP_CONNECTIONLESS
- if (conn->c_is_udp) {
- if (tag == LBER_OCTETSTRING) {
+ if( conn->c_is_udp ) {
+ if( tag == LBER_OCTETSTRING ) {
ber_get_stringa( ber, &cdn );
tag = ber_peek_tag(ber, &len);
}
- if (tag != LDAP_REQ_ABANDON && tag != LDAP_REQ_SEARCH) {
+ if( tag != LDAP_REQ_ABANDON && tag != LDAP_REQ_SEARCH ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONNECTION, ERR,
"connection_input: conn %lu invalid req for UDP 0x%lx.\n",
op->o_pagedresults_state = conn->c_pagedresults_state;
#ifdef LDAP_CONNECTIONLESS
op->o_peeraddr = peeraddr;
- if (cdn) {
+ if (cdn ) {
ber_str2bv( cdn, 0, 1, &op->o_dn );
op->o_protocol = LDAP_VERSION2;
}
continue;
}
#ifdef LDAP_CONNECTIONLESS
- if (l.sl_is_udp)
- socktype = SOCK_DGRAM;
+ if( l.sl_is_udp ) socktype = SOCK_DGRAM;
#endif
l.sl_sd = socket( (*sal)->sa_family, socktype, 0);
if ( l.sl_sd == AC_SOCKET_INVALID ) {
* listening port. The listen() and accept() calls
* are unnecessary.
*/
- if ( slap_listeners[l]->sl_is_udp )
- {
+ if ( slap_listeners[l]->sl_is_udp ) {
slapd_add( slap_listeners[l]->sl_sd );
continue;
}
continue;
#ifdef LDAP_CONNECTIONLESS
- if ( slap_listeners[l]->sl_is_udp )
- {
- /* The first time we receive a query, we set this
- * up as a "connection". It remains open for the life
- * of the slapd.
- */
- if ( slap_listeners[l]->sl_is_udp < 2 )
- {
+ if ( slap_listeners[l]->sl_is_udp ) {
+ /* The first time we receive a query, we set this
+ * up as a "connection". It remains open for the life
+ * of the slapd.
+ */
+ if ( slap_listeners[l]->sl_is_udp < 2 ) {
id = connection_init(
slap_listeners[l]->sl_sd,
slap_listeners[l]->sl_url, "", "",
/* The listener is the data port. Don't
* skip it.
*/
- if (slap_listeners[l]->sl_is_udp)
- continue;
+ if (slap_listeners[l]->sl_is_udp) continue;
#endif
is_listener = 1;
break;
for ( l = 0; slap_listeners[l] != NULL; l++ ) {
if ( i == slap_listeners[l]->sl_sd ) {
#ifdef LDAP_CONNECTIONLESS
- if (slap_listeners[l]->sl_is_udp)
- continue;
+ if (slap_listeners[l]->sl_is_udp) continue;
#endif
is_listener = 1;
break;
for ( l = 0; slap_listeners[l] != NULL; l++ ) {
if ( rd == slap_listeners[l]->sl_sd ) {
#ifdef LDAP_CONNECTIONLESS
- if (slap_listeners[l]->sl_is_udp)
- continue;
+ if (slap_listeners[l]->sl_is_udp) continue;
#endif
is_listener = 1;
break;
}
#ifdef LDAP_CONNECTIONLESS
- if (conn->c_is_udp) {
- rc = ber_write(ber, (char *)&op->o_peeraddr, sizeof(struct sockaddr), 0);
+ if( conn->c_is_udp ) {
+ rc = ber_write(ber,
+ (char *)&op->o_peeraddr, sizeof(struct sockaddr), 0);
if (rc != sizeof(struct sockaddr)) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
#ifdef LDAP_CONNECTIONLESS
if (conn->c_is_udp) {
- rc = ber_write(ber, (char *)&op->o_peeraddr, sizeof(struct sockaddr), 0);
+ rc = ber_write(ber,
+ (char *)&op->o_peeraddr, sizeof(struct sockaddr), 0);
if (rc != sizeof(struct sockaddr)) {
#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu ber_printf failed\n",
- conn ? conn->c_connid : 0, 0, 0 );
+ LDAP_LOG( OPERATION, ERR,
+ "send_search_entry: conn %lu ber_printf failed\n",
+ conn ? conn->c_connid : 0, 0, 0 );
#else
- Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
+ Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
#endif
- ber_free_buf( ber );
- return( 1 );
+ ber_free_buf( ber );
+ return( 1 );
}
}
if (conn->c_is_udp && op->o_protocol == LDAP_VERSION2) {
}
#ifdef LDAP_CONNECTIONLESS
- if (conn->c_is_udp && op->o_protocol == LDAP_VERSION2 && rc != -1)
+ if (conn->c_is_udp && op->o_protocol == LDAP_VERSION2 && rc != -1) {
rc = ber_printf( ber, "}" );
+ }
#endif
if ( rc == -1 ) {
#ifdef NEW_LOGGING