mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
s4:ldap_server: make sure we only have one tstream_read_pdu_blob_send() on a connection
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Garming Sam
parent
d104d6e04f
commit
29e3fc1cff
@ -65,6 +65,7 @@ static void ldapsrv_terminate_connection(struct ldapsrv_connection *conn,
|
||||
conn->limits.endtime = timeval_current_ofs(0, 500);
|
||||
|
||||
tevent_queue_stop(conn->sockets.send_queue);
|
||||
TALLOC_FREE(conn->sockets.read_req);
|
||||
if (conn->active_call) {
|
||||
tevent_req_cancel(conn->active_call);
|
||||
conn->active_call = NULL;
|
||||
@ -412,6 +413,10 @@ static bool ldapsrv_call_read_next(struct ldapsrv_connection *conn)
|
||||
timeval_current_ofs(conn->limits.conn_idle_time, 0);
|
||||
}
|
||||
|
||||
if (conn->sockets.read_req != NULL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* The minimun size of a LDAP pdu is 7 bytes
|
||||
*
|
||||
@ -455,6 +460,7 @@ static bool ldapsrv_call_read_next(struct ldapsrv_connection *conn)
|
||||
conn->connection->event.ctx,
|
||||
conn->limits.endtime);
|
||||
tevent_req_set_callback(subreq, ldapsrv_call_read_done, conn);
|
||||
conn->sockets.read_req = subreq;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -470,6 +476,8 @@ static void ldapsrv_call_read_done(struct tevent_req *subreq)
|
||||
struct asn1_data *asn1;
|
||||
DATA_BLOB blob;
|
||||
|
||||
conn->sockets.read_req = NULL;
|
||||
|
||||
call = talloc_zero(conn, struct ldapsrv_call);
|
||||
if (!call) {
|
||||
ldapsrv_terminate_connection(conn, "no memory");
|
||||
|
Reference in New Issue
Block a user