diff options
author | Volker Lendecke <vl@samba.org> | 2008-08-28 15:44:14 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-08-28 18:22:49 +0200 |
commit | f294f51bf0d136208fee1be343684ea890a499d0 (patch) | |
tree | 2bb9001616d90f178f260ade4f3cdb1405181408 /source3/libsmb/async_smb.c | |
parent | 228a12681bc7e6eb5bddb75b3b97a74c5eef1c3a (diff) | |
download | samba-f294f51bf0d136208fee1be343684ea890a499d0.tar.gz samba-f294f51bf0d136208fee1be343684ea890a499d0.tar.xz samba-f294f51bf0d136208fee1be343684ea890a499d0.zip |
Remove cli_request_get()
req->private_data==NULL at this point is definitely a bug.
(This used to be commit ce3dc9f616cafc1289a94ac7cae0beca967d836e)
Diffstat (limited to 'source3/libsmb/async_smb.c')
-rw-r--r-- | source3/libsmb/async_smb.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index b5fa9c44b1..79a924b9db 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -107,7 +107,8 @@ static uint16_t cli_new_mid(struct cli_state *cli) static char *cli_request_print(TALLOC_CTX *mem_ctx, struct async_req *req) { char *result = async_req_print(mem_ctx, req); - struct cli_request *cli_req = cli_request_get(req); + struct cli_request *cli_req = talloc_get_type_abort( + req->private_data, struct cli_request); if (result == NULL) { return NULL; @@ -216,7 +217,8 @@ static bool find_andx_cmd_ofs(char *buf, size_t *pofs) static int cli_async_req_destructor(struct async_req *req) { - struct cli_request *cli_req = cli_request_get(req); + struct cli_request *cli_req = talloc_get_type_abort( + req->private_data, struct cli_request); int i, pending; bool found = false; @@ -560,7 +562,8 @@ NTSTATUS cli_pull_reply(struct async_req *req, uint8_t *pwct, uint16_t **pvwv, uint16_t *pnum_bytes, uint8_t **pbytes) { - struct cli_request *cli_req = cli_request_get(req); + struct cli_request *cli_req = talloc_get_type_abort( + req->private_data, struct cli_request); uint8_t wct, cmd; uint16_t num_bytes; size_t wct_ofs, bytes_offset; @@ -667,20 +670,6 @@ NTSTATUS cli_pull_reply(struct async_req *req, } /** - * Convenience function to get the SMB part out of an async_req - * @param[in] req The request to look at - * @retval The private_data as struct cli_request - */ - -struct cli_request *cli_request_get(struct async_req *req) -{ - if (req == NULL) { - return NULL; - } - return talloc_get_type_abort(req->private_data, struct cli_request); -} - -/** * A PDU has arrived on cli->evt_inbuf * @param[in] cli The cli_state that received something */ |