diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-12-16 12:29:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:07:27 -0500 |
commit | 7bb5587097d7af1c42dab683c68afa06b35b7872 (patch) | |
tree | 8520aa003c799378732c0da9c3923d16e134deda /source4/libcli/raw/rawrequest.c | |
parent | 62d803c4901fcd8c4724aae0356e87ee9443e208 (diff) | |
download | samba-7bb5587097d7af1c42dab683c68afa06b35b7872.tar.gz samba-7bb5587097d7af1c42dab683c68afa06b35b7872.tar.bz2 samba-7bb5587097d7af1c42dab683c68afa06b35b7872.zip |
r4229: - added support for multi-part SMBtrans and SMBtrans2 requests in the
client code. This was essential to test the multi-part server code
(which I will commit soon)
- when the request state is an error, ensure that req->status is not NT_STATUS_OK
(This used to be commit ef502c403044b68ccdff15b1a94d447d0f53473d)
Diffstat (limited to 'source4/libcli/raw/rawrequest.c')
-rw-r--r-- | source4/libcli/raw/rawrequest.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c index 7aa07bef41..5c35618e00 100644 --- a/source4/libcli/raw/rawrequest.c +++ b/source4/libcli/raw/rawrequest.c @@ -48,8 +48,11 @@ NTSTATUS smbcli_request_destroy(struct smbcli_request *req) DLIST_REMOVE(req->transport->pending_recv, req); } - /* ahh, its so nice to destroy a complex structure in such a - simple way! */ + if (req->state == SMBCLI_REQUEST_ERROR && + NT_STATUS_IS_OK(req->status)) { + req->status = NT_STATUS_INTERNAL_ERROR; + } + status = req->status; talloc_free(req); return status; @@ -95,7 +98,7 @@ struct smbcli_request *smbcli_request_setup_nonsmb(struct smbcli_transport *tran setup a SMB packet at transport level */ struct smbcli_request *smbcli_request_setup_transport(struct smbcli_transport *transport, - uint8_t command, uint_t wct, uint_t buflen) + uint8_t command, uint_t wct, uint_t buflen) { struct smbcli_request *req; @@ -119,8 +122,10 @@ struct smbcli_request *smbcli_request_setup_transport(struct smbcli_transport *t SCVAL(req->out.hdr,HDR_FLG, FLAG_CASELESS_PATHNAMES); SSVAL(req->out.hdr,HDR_FLG2, 0); - /* assign a mid */ - req->mid = smbcli_transport_next_mid(transport); + if (command != SMBtranss && command != SMBtranss2) { + /* assign a mid */ + req->mid = smbcli_transport_next_mid(transport); + } /* copy the pid, uid and mid to the request */ SSVAL(req->out.hdr, HDR_PID, 0); |