1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

smbd: Move push_deferred_open_message_smb to smb2_process.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
David Mulder 2022-03-18 14:28:08 -06:00 committed by Jeremy Allison
parent 9e4517468e
commit 5582077b92
3 changed files with 33 additions and 29 deletions

View File

@ -684,10 +684,10 @@ static bool push_queued_message(struct smb_request *req,
messages ready for processing. messages ready for processing.
****************************************************************************/ ****************************************************************************/
static bool push_deferred_open_message_smb1(struct smb_request *req, bool push_deferred_open_message_smb1(struct smb_request *req,
struct timeval timeout, struct timeval timeout,
struct file_id id, struct file_id id,
struct deferred_open_record *open_rec) struct deferred_open_record *open_rec)
{ {
struct timeval_buf tvbuf; struct timeval_buf tvbuf;
struct timeval end_time; struct timeval end_time;
@ -710,27 +710,6 @@ static bool push_deferred_open_message_smb1(struct smb_request *req,
return push_queued_message(req, req->request_time, end_time, open_rec); return push_queued_message(req, req->request_time, end_time, open_rec);
} }
bool push_deferred_open_message_smb(struct smb_request *req,
struct timeval timeout,
struct file_id id,
struct deferred_open_record *open_rec)
{
#if defined(WITH_SMB1SERVER)
if (req->smb2req) {
#endif
return push_deferred_open_message_smb2(req->smb2req,
req->request_time,
timeout,
id,
open_rec);
#if defined(WITH_SMB1SERVER)
} else {
return push_deferred_open_message_smb1(req, timeout,
id, open_rec);
}
#endif
}
static void smbd_sig_term_handler(struct tevent_context *ev, static void smbd_sig_term_handler(struct tevent_context *ev,
struct tevent_signal *se, struct tevent_signal *se,
int signum, int signum,

View File

@ -852,10 +852,6 @@ bool smb1_srv_send(struct smbXsrv_connection *xconn, char *buffer,
bool do_signing, uint32_t seqnum, bool do_signing, uint32_t seqnum,
bool do_encrypt, bool do_encrypt,
struct smb_perfcount_data *pcd); struct smb_perfcount_data *pcd);
bool push_deferred_open_message_smb(struct smb_request *req,
struct timeval timeout,
struct file_id id,
struct deferred_open_record *open_rec);
NTSTATUS allow_new_trans(struct trans_state *list, uint64_t mid); NTSTATUS allow_new_trans(struct trans_state *list, uint64_t mid);
void reply_outbuf(struct smb_request *req, uint8_t num_words, uint32_t num_bytes); void reply_outbuf(struct smb_request *req, uint8_t num_words, uint32_t num_bytes);
void smb_request_done(struct smb_request *req); void smb_request_done(struct smb_request *req);
@ -893,6 +889,10 @@ void process_smb(struct smbXsrv_connection *xconn,
uint8_t *inbuf, size_t nread, size_t unread_bytes, uint8_t *inbuf, size_t nread, size_t unread_bytes,
uint32_t seqnum, bool encrypted, uint32_t seqnum, bool encrypted,
struct smb_perfcount_data *deferred_pcd); struct smb_perfcount_data *deferred_pcd);
bool push_deferred_open_message_smb1(struct smb_request *req,
struct timeval timeout,
struct file_id id,
struct deferred_open_record *open_rec);
/* The following definitions come from smbd/smb2_process.c */ /* The following definitions come from smbd/smb2_process.c */
@ -922,6 +922,10 @@ bool open_was_deferred(struct smbXsrv_connection *xconn, uint64_t mid);
bool get_deferred_open_message_state(struct smb_request *smbreq, bool get_deferred_open_message_state(struct smb_request *smbreq,
struct timeval *p_request_time, struct timeval *p_request_time,
struct deferred_open_record **open_rec); struct deferred_open_record **open_rec);
bool push_deferred_open_message_smb(struct smb_request *req,
struct timeval timeout,
struct file_id id,
struct deferred_open_record *open_rec);
/* The following definitions come from smbd/quotas.c */ /* The following definitions come from smbd/quotas.c */

View File

@ -463,3 +463,24 @@ bool get_deferred_open_message_state(struct smb_request *smbreq,
} }
return true; return true;
} }
bool push_deferred_open_message_smb(struct smb_request *req,
struct timeval timeout,
struct file_id id,
struct deferred_open_record *open_rec)
{
#if defined(WITH_SMB1SERVER)
if (req->smb2req) {
#endif
return push_deferred_open_message_smb2(req->smb2req,
req->request_time,
timeout,
id,
open_rec);
#if defined(WITH_SMB1SERVER)
} else {
return push_deferred_open_message_smb1(req, timeout,
id, open_rec);
}
#endif
}