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

smbd: Make setup_poll_open() return bool

This is for callers who don't want to call open_was_deferred()
afterwards

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2019-07-30 14:51:00 +02:00 committed by Jeremy Allison
parent 832b9eb6df
commit 50a3d08673

View File

@ -2508,7 +2508,7 @@ static void poll_open_fn(struct tevent_context *ev,
/** /**
* Reschedule an open for 1 second from now, if not timed out. * Reschedule an open for 1 second from now, if not timed out.
**/ **/
static void setup_poll_open( static bool setup_poll_open(
struct smb_request *req, struct smb_request *req,
struct file_id id, struct file_id id,
struct timeval max_timeout, struct timeval max_timeout,
@ -2520,13 +2520,13 @@ static void setup_poll_open(
/* Maximum wait time. */ /* Maximum wait time. */
if (request_timed_out(req, max_timeout)) { if (request_timed_out(req, max_timeout)) {
return; return false;
} }
open_rec = talloc_zero(NULL, struct deferred_open_record); open_rec = talloc_zero(NULL, struct deferred_open_record);
if (open_rec == NULL) { if (open_rec == NULL) {
DBG_WARNING("talloc failed\n"); DBG_WARNING("talloc failed\n");
return; return false;
} }
open_rec->xconn = req->xconn; open_rec->xconn = req->xconn;
open_rec->mid = req->mid; open_rec->mid = req->mid;
@ -2540,20 +2540,22 @@ static void setup_poll_open(
if (open_rec->te == NULL) { if (open_rec->te == NULL) {
DBG_WARNING("tevent_add_timer failed\n"); DBG_WARNING("tevent_add_timer failed\n");
TALLOC_FREE(open_rec); TALLOC_FREE(open_rec);
return; return false;
} }
ok = push_deferred_open_message_smb(req, max_timeout, id, open_rec); ok = push_deferred_open_message_smb(req, max_timeout, id, open_rec);
if (!ok) { if (!ok) {
DBG_WARNING("push_deferred_open_message_smb failed\n"); DBG_WARNING("push_deferred_open_message_smb failed\n");
TALLOC_FREE(open_rec); TALLOC_FREE(open_rec);
return; return false;
} }
DBG_DEBUG("poll request time [%s] mid [%" PRIu64 "] file_id [%s]\n", DBG_DEBUG("poll request time [%s] mid [%" PRIu64 "] file_id [%s]\n",
timeval_string(talloc_tos(), &req->request_time, false), timeval_string(talloc_tos(), &req->request_time, false),
req->mid, req->mid,
file_id_string_tos(&id)); file_id_string_tos(&id));
return true;
} }
/**************************************************************************** /****************************************************************************