diff options
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clifile.c | 42 | ||||
-rw-r--r-- | source3/libsmb/proto.h | 2 |
2 files changed, 22 insertions, 22 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index e942b27e175..2e3c2426030 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -2770,22 +2770,22 @@ NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, Close a file. ****************************************************************************/ -struct cli_close_state { +struct cli_smb1_close_state { uint16_t vwv[3]; }; -static void cli_close_done(struct tevent_req *subreq); +static void cli_smb1_close_done(struct tevent_req *subreq); -struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx, +struct tevent_req *cli_smb1_close_create(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli, uint16_t fnum, struct tevent_req **psubreq) { struct tevent_req *req, *subreq; - struct cli_close_state *state; + struct cli_smb1_close_state *state; - req = tevent_req_create(mem_ctx, &state, struct cli_close_state); + req = tevent_req_create(mem_ctx, &state, struct cli_smb1_close_state); if (req == NULL) { return NULL; } @@ -2799,11 +2799,25 @@ struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx, TALLOC_FREE(req); return NULL; } - tevent_req_set_callback(subreq, cli_close_done, req); + tevent_req_set_callback(subreq, cli_smb1_close_done, req); *psubreq = subreq; return req; } +static void cli_smb1_close_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + NTSTATUS status; + + status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL); + TALLOC_FREE(subreq); + if (tevent_req_nterror(req, status)) { + return; + } + tevent_req_done(req); +} + struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli, @@ -2812,7 +2826,7 @@ struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx, struct tevent_req *req, *subreq; NTSTATUS status; - req = cli_close_create(mem_ctx, ev, cli, fnum, &subreq); + req = cli_smb1_close_create(mem_ctx, ev, cli, fnum, &subreq); if (req == NULL) { return NULL; } @@ -2824,20 +2838,6 @@ struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx, return req; } -static void cli_close_done(struct tevent_req *subreq) -{ - struct tevent_req *req = tevent_req_callback_data( - subreq, struct tevent_req); - NTSTATUS status; - - status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL); - TALLOC_FREE(subreq); - if (tevent_req_nterror(req, status)) { - return; - } - tevent_req_done(req); -} - NTSTATUS cli_close_recv(struct tevent_req *req) { return tevent_req_simple_recv_ntstatus(req); diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index 4ae566cca1c..d82de56a238 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -423,7 +423,7 @@ struct tevent_req *cli_openx_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev NTSTATUS cli_openx_recv(struct tevent_req *req, uint16_t *fnum); NTSTATUS cli_openx(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum); NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum); -struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx, +struct tevent_req *cli_smb1_close_create(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli, uint16_t fnum, struct tevent_req **psubreq); |