diff options
author | Jeremy Allison <jra@samba.org> | 2020-03-12 10:03:27 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2020-04-07 08:12:35 +0000 |
commit | 999a14c5cb75006fee4ccd162b073347ad8456fd (patch) | |
tree | 98410489b8776b378c455ea3b8032b045f8edaa3 /source3/smbd | |
parent | c613e113dbe176e1bfc1e358cc7ba1e5d23af135 (diff) | |
download | samba-999a14c5cb75006fee4ccd162b073347ad8456fd.tar.gz |
s3: smbd: Remove old synchronous SMB1 reply_tdis().
SMB1 tree disconnect is now fully async.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 7613998e10c5f13c896667257fdef33824a45d2a)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/reply.c | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 43e20031fc8..34dd942c0da 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -6033,49 +6033,43 @@ void reply_unlock(struct smb_request *req) conn POINTER CAN BE NULL HERE ! ****************************************************************************/ +static struct tevent_req *reply_tdis_send(struct smb_request *smb1req); +static void reply_tdis_done(struct tevent_req *req); + void reply_tdis(struct smb_request *smb1req) { - NTSTATUS status; connection_struct *conn = smb1req->conn; - struct smbXsrv_tcon *tcon; + struct tevent_req *req; - START_PROFILE(SMBtdis); + /* + * Don't setup the profile charge here, take + * it in reply_tdis_done(). Not strictly correct + * but better than the other SMB1 async + * code that double-charges at the moment. + */ if (conn == NULL) { + /* Not going async, profile here. */ + START_PROFILE(SMBtdis); DBG_INFO("Invalid connection in tdis\n"); reply_force_doserror(smb1req, ERRSRV, ERRinvnid); END_PROFILE(SMBtdis); return; } - tcon = conn->tcon; - smb1req->conn = NULL; - - /* - * TODO: cancel all outstanding requests on the tcon - */ - status = smbXsrv_tcon_disconnect(tcon, smb1req->vuid); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0, ("reply_tdis: " - "smbXsrv_tcon_disconnect() failed: %s\n", - nt_errstr(status))); - /* - * If we hit this case, there is something completely - * wrong, so we better disconnect the transport connection. - */ + req = reply_tdis_send(smb1req); + if (req == NULL) { + /* Not going async, profile here. */ + START_PROFILE(SMBtdis); + reply_force_doserror(smb1req, ERRDOS, ERRnomem); END_PROFILE(SMBtdis); - exit_server(__location__ ": smbXsrv_tcon_disconnect failed"); return; } - - TALLOC_FREE(tcon); - - reply_outbuf(smb1req, 0, 0); - END_PROFILE(SMBtdis); + /* We're async. This will complete later. */ + tevent_req_set_callback(req, reply_tdis_done, smb1req); return; } -#if 0 struct reply_tdis_state { struct tevent_queue *wait_queue; }; @@ -6245,7 +6239,6 @@ static void reply_tdis_done(struct tevent_req *req) smb_request_done(smb1req); END_PROFILE(SMBtdis); } -#endif /**************************************************************************** Reply to a echo. |