From 95bd792860a581faf2d1f32e70726cae8c82d492 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 11 Jun 2014 08:34:05 +0200 Subject: [PATCH] s3:smbd: let construct_reply() also use smb_request_done() This way it matches the code path in construct_reply_chain(). Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke Reviewed-by: Michael Adam --- source3/smbd/process.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/source3/smbd/process.c b/source3/smbd/process.c index c0157332f51..c1685da3f5f 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1644,7 +1644,6 @@ static void construct_reply(struct smbd_server_connection *sconn, struct smb_perfcount_data *deferred_pcd) { struct smbXsrv_connection *xconn = sconn->conn; - connection_struct *conn; struct smb_request *req; if (!(req = talloc(talloc_tos(), struct smb_request))) { @@ -1667,27 +1666,19 @@ static void construct_reply(struct smbd_server_connection *sconn, SMB_PERFCOUNT_SET_MSGLEN_IN(&req->pcd, size); } - conn = switch_message(req->cmd, req); + req->conn = switch_message(req->cmd, req); if (req->outbuf == NULL) { + /* + * Request has suspended itself, will come + * back here. + */ return; } - if (CVAL(req->outbuf,0) == 0) { show_msg((char *)req->outbuf); } - - if (!srv_send_smb(req->sconn, - (char *)req->outbuf, - true, req->seqnum+1, - IS_CONN_ENCRYPTED(conn)||req->encrypted, - &req->pcd)) { - exit_server_cleanly("construct_reply: srv_send_smb failed."); - } - - TALLOC_FREE(req); - - return; + smb_request_done(req); } static void construct_reply_chain(struct smbd_server_connection *sconn,