diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-05-16 15:03:58 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-05-16 15:03:58 +1000 |
commit | c7d7577fb978dfa822b4aab238440816188099c6 (patch) | |
tree | 7259e48bb31e0cbc79500dcdb04f75a74c11fc81 /source4/libcli/smb2/request.c | |
parent | 9bfafcfc213477a4f117ab07ce8f37bc18e74293 (diff) | |
download | samba-c7d7577fb978dfa822b4aab238440816188099c6.tar.gz samba-c7d7577fb978dfa822b4aab238440816188099c6.tar.bz2 samba-c7d7577fb978dfa822b4aab238440816188099c6.zip |
private -> private_data for struct smb2_request
(This used to be commit 67290e0ad69df2f2fe651249c6550b8e32dd641b)
Diffstat (limited to 'source4/libcli/smb2/request.c')
-rw-r--r-- | source4/libcli/smb2/request.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c index f52b0ceef2..64d427f889 100644 --- a/source4/libcli/smb2/request.c +++ b/source4/libcli/smb2/request.c @@ -43,6 +43,18 @@ void smb2_setup_bufinfo(struct smb2_request *req) } } + +/* destroy a request structure */ +static int smb2_request_destructor(struct smb2_request *req) +{ + if (req->transport) { + /* remove it from the list of pending requests (a null op if + its not in the list) */ + DLIST_REMOVE(req->transport->pending_recv, req); + } + return 0; +} + /* initialise a smb2 request */ @@ -122,6 +134,8 @@ struct smb2_request *smb2_request_init(struct smb2_transport *transport, uint16_ SCVAL(req->out.dynamic, 0, 0); } + talloc_set_destructor(req, smb2_request_destructor); + return req; } @@ -154,18 +168,13 @@ NTSTATUS smb2_request_destroy(struct smb2_request *req) _send() call fails completely */ if (!req) return NT_STATUS_UNSUCCESSFUL; - if (req->transport) { - /* remove it from the list of pending requests (a null op if - its not in the list) */ - DLIST_REMOVE(req->transport->pending_recv, req); - } - if (req->state == SMB2_REQUEST_ERROR && NT_STATUS_IS_OK(req->status)) { - req->status = NT_STATUS_INTERNAL_ERROR; + status = NT_STATUS_INTERNAL_ERROR; + } else { + status = req->status; } - status = req->status; talloc_free(req); return status; } |