Author: tridge
Date: 2007-10-18 03:32:07 +0000 (Thu, 18 Oct 2007)
New Revision: 25692

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25692

Log:

fixed another example where the free of fde and the free of the socket
causes the fd to be closed before epoll is told

Modified:
   branches/SAMBA_4_0/source/libcli/ldap/ldap_client.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/ldap/ldap_client.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/ldap/ldap_client.c 2007-10-18 03:14:10 UTC 
(rev 25691)
+++ branches/SAMBA_4_0/source/libcli/ldap/ldap_client.c 2007-10-18 03:32:07 UTC 
(rev 25692)
@@ -366,12 +366,14 @@
        /* setup a handler for events on this socket */
        conn->event.fde = event_add_fd(conn->event.event_ctx, conn->sock, 
                                       socket_get_fd(conn->sock), 
-                                      EVENT_FD_READ, ldap_io_handler, conn);
+                                      EVENT_FD_READ | EVENT_FD_AUTOCLOSE, 
ldap_io_handler, conn);
        if (conn->event.fde == NULL) {
                composite_error(ctx, NT_STATUS_INTERNAL_ERROR);
                return;
        }
 
+       socket_set_flags(conn->sock, SOCKET_FLAG_NOCLOSE);
+
        talloc_steal(conn, conn->sock);
        if (conn->ldaps) {
                struct socket_context *tls_socket = tls_init_client(conn->sock, 
conn->event.fde);

Reply via email to