r7801: the ldap server needs this logic too
authorAndrew Tridgell <tridge@samba.org>
Tue, 21 Jun 2005 06:08:40 +0000 (06:08 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:18:37 +0000 (13:18 -0500)
(This used to be commit 1dbb5bf2c1c6e11b3467b6eb1a2206c6299bc25b)

source4/ldap_server/ldap_server.c
source4/ldap_server/ldap_server.h

index c006a9e4dac5bc7ed79a7082ed5fd5429f553015..8d2a404ec471c38bdcad308649c8f0750c17eaef 100644 (file)
@@ -245,6 +245,11 @@ static void ldapsrv_recv(struct stream_connection *c, uint16_t flags)
        NTSTATUS status;
        size_t npending, nread;
 
+       if (conn->processing) {
+               EVENT_FD_NOT_READABLE(c->event.fde);
+               return;
+       }
+
        /* work out how much data is pending */
        status = tls_socket_pending(conn->tls, &npending);
        if (!NT_STATUS_IS_OK(status)) {
@@ -279,12 +284,16 @@ static void ldapsrv_recv(struct stream_connection *c, uint16_t flags)
        }
        conn->partial.length += nread;
 
+       conn->processing = True;
        /* see if we can decode what we have */
        if (conn->enable_wrap) {
                ldapsrv_try_decode_wrapped(conn);
        } else {
                ldapsrv_try_decode_plain(conn);
        }
+       conn->processing = False;
+
+       EVENT_FD_READABLE(c->event.fde);
 }
        
 /*
@@ -338,6 +347,7 @@ static void ldapsrv_accept(struct stream_connection *c)
        conn->send_queue  = NULL;
        conn->connection  = c;
        conn->service     = talloc_get_type(c->private, struct ldapsrv_service);
+       conn->processing  = False;
        c->private        = conn;
 
        port = socket_get_my_port(c->socket);
index 32b2cffe9993b2be2a361522b1ebdc754741c709..e3031d01770613b8588c90515df0f30df3e5e2d5 100644 (file)
@@ -39,6 +39,8 @@ struct ldapsrv_connection {
                struct ldapsrv_send *next, *prev;
                DATA_BLOB data;
        } *send_queue;
+
+       BOOL processing;
 };
 
 struct ldapsrv_call {