summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/dcerpc_server.c1
-rw-r--r--source4/rpc_server/dcerpc_server.h2
-rw-r--r--source4/rpc_server/dcerpc_sock.c9
3 files changed, 12 insertions, 0 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index 700892b49c..f4059e4a46 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -320,6 +320,7 @@ NTSTATUS dcesrv_endpoint_connect(struct dcesrv_context *dce_ctx,
p->auth_state.session_info = NULL;
p->auth_state.session_key = dcesrv_generic_session_key;
p->srv_conn = srv_conn;
+ p->processing = False;
talloc_set_destructor(p, dcesrv_endpoint_destructor);
diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h
index efcb7f9127..96ef418a5b 100644
--- a/source4/rpc_server/dcerpc_server.h
+++ b/source4/rpc_server/dcerpc_server.h
@@ -177,6 +177,8 @@ struct dcesrv_connection {
/* the transport level session key */
DATA_BLOB transport_session_key;
+
+ BOOL processing;
};
diff --git a/source4/rpc_server/dcerpc_sock.c b/source4/rpc_server/dcerpc_sock.c
index db709ac5e9..130f85c0ee 100644
--- a/source4/rpc_server/dcerpc_sock.c
+++ b/source4/rpc_server/dcerpc_sock.c
@@ -87,6 +87,11 @@ static void dcesrv_sock_recv(struct stream_connection *conn, uint16_t flags)
DATA_BLOB tmp_blob;
size_t nread;
+ if (dce_conn->processing) {
+ EVENT_FD_NOT_READABLE(conn->event.fde);
+ return;
+ }
+
tmp_blob = data_blob_talloc(conn->socket, NULL, 0x1000);
if (tmp_blob.data == NULL) {
dcesrv_terminate_connection(dce_conn, "out of memory");
@@ -105,9 +110,13 @@ static void dcesrv_sock_recv(struct stream_connection *conn, uint16_t flags)
tmp_blob.length = nread;
+ dce_conn->processing = True;
status = dcesrv_input(dce_conn, &tmp_blob);
+ dce_conn->processing = False;
talloc_free(tmp_blob.data);
+ EVENT_FD_READABLE(conn->event.fde);
+
if (!NT_STATUS_IS_OK(status)) {
dcesrv_terminate_connection(dce_conn, nt_errstr(status));
return;