diff options
Diffstat (limited to 'source4/smb_server/smb_server.c')
-rw-r--r-- | source4/smb_server/smb_server.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index 3b4d06f3b2..7e0aa2c0cb 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -665,7 +665,18 @@ static void smbsrv_recv(struct stream_connection *conn, uint16_t flags) DEBUG(10,("smbsrv_recv\n")); + /* our backends are designed to process one request at a time, + unless they deliberately mark the request as async and + process it later on a timer or other event. This enforces + that ordering. */ + if (smb_conn->processing) { + EVENT_FD_NOT_READABLE(conn->event.fde); + return; + } + + smb_conn->processing = True; status = receive_smb_request(smb_conn); + smb_conn->processing = False; if (NT_STATUS_IS_ERR(status)) { talloc_free(conn->event.fde); conn->event.fde = NULL; @@ -673,6 +684,8 @@ static void smbsrv_recv(struct stream_connection *conn, uint16_t flags) return; } + EVENT_FD_READABLE(conn->event.fde); + /* free up temporary memory */ lp_talloc_free(); } @@ -749,6 +762,7 @@ static void smbsrv_accept(struct stream_connection *conn) smbsrv_tcon_init(smb_conn); smb_conn->connection = conn; + smb_conn->processing = False; conn->private = smb_conn; } |