]> git.sur5r.net Git - openldap/blobdiff - servers/ldapd/result.c
Round 2 of connection management changes.
[openldap] / servers / ldapd / result.c
index beaef17cd4e9c5685af93f33d64e6e3c9e89aadf..777aec2e68a6da5459f40fb949c957e6dcc324ca 100644 (file)
 #include "ldap.h"
 #include "common.h"
 
-extern int     dosyslog;
-#ifdef LDAP_COMPAT
-extern int     ldap_compat;
-#endif
-
 /*
  * dsa_response - called by do_queries() when there is activity on one of
  * the DSA associations.  It is passed the association descriptor on which
@@ -285,12 +280,12 @@ send_ldap_msgresult(
 {
 #ifdef LDAP_CONNECTIONLESS
        if ( m->m_cldap ) {
-               SAFEMEMCPY( (char *)sb->sb_useaddr, &m->m_clientaddr,
-                   sizeof( struct sockaddr ));
+               lber_pvt_sb_udp_set_dst( &sb, &m->m_clientaddr );
+
                Debug( LDAP_DEBUG_TRACE, "UDP response to %s port %d\n", 
                    inet_ntoa(((struct sockaddr_in *)
-                   sb->sb_useaddr)->sin_addr ),
-                   ((struct sockaddr_in *)sb->sb_useaddr)->sin_port, 0 );
+                   &m->m_clientaddr)->sin_addr ),
+                   ((struct sockaddr_in *)&m->m_clientaddr)->sin_port, 0 );
        }
 #endif
        return( send_ldap_result( sb, tag, m->m_msgid, err, matched, text ) );
@@ -310,11 +305,7 @@ send_ldap_result(
        int             rc;
 #ifdef LDAP_CONNECTIONLESS
        int             cldap;
-#endif
-       extern int      version;
-
-#ifdef LDAP_CONNECTIONLESS
-       cldap = ( sb->sb_naddr > 0 );
+       cldap = ( sb->sb_io == &lber_pvt_sb_io_udp );
 #endif
 
        Debug( LDAP_DEBUG_TRACE, "send_ldap_result\n", 0, 0, 0 );