summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-21 06:03:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:37 -0500
commitf0420c029299fd503dd6980484e970a9a141d523 (patch)
treec634698d8d9641a7980596711253f5aed3e942d7
parent5e40d0187b86f758b0fa744365e657ec6ee40ff5 (diff)
downloadsamba-f0420c029299fd503dd6980484e970a9a141d523.tar.gz
samba-f0420c029299fd503dd6980484e970a9a141d523.tar.xz
samba-f0420c029299fd503dd6980484e970a9a141d523.zip
r7800: added the same request serialisation logic to our socket based rpc
servers as I added to the smb server yesterday. This means rpc server code can assume it runs serially unless it explicitly sets the async flag on the request and returns (This used to be commit 8546adb56aa4dda608a176409c243b074aeca77d)
-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 700892b49c6..f4059e4a464 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 efcb7f91272..96ef418a5b5 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 db709ac5e90..130f85c0ee6 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;