diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-11-28 10:41:25 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-11-29 16:00:08 +0100 |
commit | 51a7201a12856a11695ecb1b769c31fedf984e9c (patch) | |
tree | 99f5ce765b2556a7d1d417fc08efc542daef0161 /libcli | |
parent | 524d06615fd1b28f8cef14f6b7e083c4b24cae13 (diff) | |
download | samba-51a7201a12856a11695ecb1b769c31fedf984e9c.tar.gz samba-51a7201a12856a11695ecb1b769c31fedf984e9c.tar.bz2 samba-51a7201a12856a11695ecb1b769c31fedf984e9c.zip |
smb1cli_trans: add support for tevent_req_cancel()
metze
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/smb/smb1cli_trans.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libcli/smb/smb1cli_trans.c b/libcli/smb/smb1cli_trans.c index c9a758c8e2..fadac8e7b4 100644 --- a/libcli/smb/smb1cli_trans.c +++ b/libcli/smb/smb1cli_trans.c @@ -406,6 +406,7 @@ static void smb1cli_trans_format(struct smb1cli_trans_state *state, *piov_count = iov - state->iov; } +static bool smb1cli_trans_cancel(struct tevent_req *req); static void smb1cli_trans_done(struct tevent_req *subreq); struct tevent_req *smb1cli_trans_send( @@ -536,9 +537,24 @@ struct tevent_req *smb1cli_trans_send( state->primary_subreq = subreq; talloc_set_destructor(state, smb1cli_trans_state_destructor); + tevent_req_set_cancel_fn(req, smb1cli_trans_cancel); + return req; } +static bool smb1cli_trans_cancel(struct tevent_req *req) +{ + struct smb1cli_trans_state *state = + tevent_req_data(req, + struct smb1cli_trans_state); + + if (state->primary_subreq == NULL) { + return false; + } + + return tevent_req_cancel(state->primary_subreq); +} + static void smb1cli_trans_done2(struct tevent_req *subreq); static void smb1cli_trans_done(struct tevent_req *subreq) |