summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-08-12 17:40:04 +0200
committerStefan Metzmacher <metze@samba.org>2011-08-12 18:06:28 +0200
commitb41d44eda3ae7d72b3ddcfbd749b19f900bcd958 (patch)
tree5f68e1c7438197b34d230204f8a21120f7d0d6ad /source3/libsmb
parentc485df9530fda65fb1a2142f53c60638d2ca1923 (diff)
downloadsamba-b41d44eda3ae7d72b3ddcfbd749b19f900bcd958.tar.gz
samba-b41d44eda3ae7d72b3ddcfbd749b19f900bcd958.tar.bz2
samba-b41d44eda3ae7d72b3ddcfbd749b19f900bcd958.zip
s3:libsmb: keep a cli_smb_state->one_way
This moves the SMB1 specific stuff to cli_smb_req_create(), instead of having it in the core dispatching code. metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/async_smb.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index b07eee9e10..5f2a6441e3 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -89,6 +89,8 @@ struct cli_smb_state {
int chain_num;
int chain_length;
struct tevent_req **chained_requests;
+
+ bool one_way;
};
static uint16_t cli_alloc_mid(struct cli_state *cli)
@@ -411,6 +413,22 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx,
tevent_req_oom(result);
}
}
+
+ switch (smb_command) {
+ case SMBtranss:
+ case SMBtranss2:
+ case SMBnttranss:
+ case SMBntcancel:
+ state->one_way = true;
+ break;
+ case SMBlockingX:
+ if ((wct == 8) &&
+ (CVAL(vwv+3, 0) == LOCKING_ANDX_OPLOCK_RELEASE)) {
+ state->one_way = true;
+ }
+ break;
+ }
+
return result;
}
@@ -561,21 +579,10 @@ static void cli_smb_sent(struct tevent_req *subreq)
return;
}
- switch (CVAL(state->header, smb_com)) {
- case SMBtranss:
- case SMBtranss2:
- case SMBnttranss:
- case SMBntcancel:
+ if (state->one_way) {
state->inbuf = NULL;
tevent_req_done(req);
return;
- case SMBlockingX:
- if ((CVAL(state->header, smb_wct) == 8) &&
- (CVAL(state->vwv+3, 0) == LOCKING_ANDX_OPLOCK_RELEASE)) {
- state->inbuf = NULL;
- tevent_req_done(req);
- return;
- }
}
if (!cli_smb_req_set_pending(req)) {