]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/request.c
ITS#5324
[openldap] / libraries / libldap / request.c
index 0131b4ef0d612d999f267812d1e5ec511a7a0fc7..9894301b88dcf52090aa89464db300a2abc41b03 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2007 The OpenLDAP Foundation.
+ * Copyright 1998-2008 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -255,6 +255,19 @@ ldap_send_server_request(
 
        use_connection( ld, lc );
 
+#ifdef LDAP_CONNECTIONLESS
+       if ( LDAP_IS_UDP( ld )) {
+               BerElement tmpber = *ber;
+               ber_rewind( &tmpber );
+               rc = ber_write( &tmpber, ld->ld_options.ldo_peer,
+                       sizeof( struct sockaddr ), 0 );
+               if ( rc == -1 ) {
+                       ld->ld_errno = LDAP_ENCODING_ERROR;
+                       return rc;
+               }
+       }
+#endif
+
        /* If we still have an incomplete write, try to finish it before
         * dealing with the new request. If we don't finish here, return
         * LDAP_BUSY and let the caller retry later. We only allow a single
@@ -512,7 +525,7 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc **srvlist, int use_ldsb,
                                                        "ldap_new_connection %p: "
                                                        "unexpected response %d "
                                                        "from BIND request id=%d\n",
-                                                       ld, ldap_msgtype( res ), msgid );
+                                                       (void *) ld, ldap_msgtype( res ), msgid );
                                                err = -1;
                                                break;
                                        }
@@ -1002,7 +1015,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
                                if ( lp == origreq ) {
                                        lp = lp->lr_child;
                                } else {
-                                       lp = lr->lr_refnext;
+                                       lp = lp->lr_refnext;
                                }
                        }
                        if ( looped ) {