summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorJohn H Terpstra <jht@samba.org>2009-07-23 09:33:06 -0500
committerJohn H Terpstra <jht@samba.org>2009-07-23 09:33:06 -0500
commit94717ae8e5dfe2ccdb7f3557d5490708b00ae471 (patch)
treea39f669faf23ad05497963cf5ccf611467d0145b /source4/libcli
parent14952c72a29ec92badb1bcf16d2a15fe100f060d (diff)
parent7bad4b48c82fed4263c2bfe97a4d00b47913604a (diff)
downloadsamba-94717ae8e5dfe2ccdb7f3557d5490708b00ae471.tar.gz
samba-94717ae8e5dfe2ccdb7f3557d5490708b00ae471.tar.bz2
samba-94717ae8e5dfe2ccdb7f3557d5490708b00ae471.zip
Merge branch 'master' of ssh://jht@git.samba.org/data/git/samba
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/security/security_token.c2
-rw-r--r--source4/libcli/smb2/request.c10
-rw-r--r--source4/libcli/smb2/smb2.h1
-rw-r--r--source4/libcli/smb2/transport.c7
4 files changed, 15 insertions, 5 deletions
diff --git a/source4/libcli/security/security_token.c b/source4/libcli/security/security_token.c
index e1349e06f8..0764dfeb8f 100644
--- a/source4/libcli/security/security_token.c
+++ b/source4/libcli/security/security_token.c
@@ -1,7 +1,7 @@
/*
Unix SMB/CIFS implementation.
- security descriptror utility functions
+ security descriptor utility functions
Copyright (C) Andrew Tridgell 2004
Copyright (C) Stefan Metzmacher 2005
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c
index f3684ed280..5d09a5083a 100644
--- a/source4/libcli/smb2/request.c
+++ b/source4/libcli/smb2/request.c
@@ -78,9 +78,11 @@ struct smb2_request *smb2_request_init(struct smb2_transport *transport, uint16_
req = talloc(transport, struct smb2_request);
if (req == NULL) return NULL;
- seqnum = transport->seqnum++;
- if (seqnum == UINT64_MAX) {
- seqnum = transport->seqnum++;
+ seqnum = transport->seqnum;
+ if (transport->credits.charge > 0) {
+ transport->seqnum += transport->credits.charge;
+ } else {
+ transport->seqnum += 1;
}
req->state = SMB2_REQUEST_INIT;
@@ -131,7 +133,7 @@ struct smb2_request *smb2_request_init(struct smb2_transport *transport, uint16_
SIVAL(req->out.hdr, 0, SMB2_MAGIC);
SSVAL(req->out.hdr, SMB2_HDR_LENGTH, SMB2_HDR_BODY);
- SSVAL(req->out.hdr, SMB2_HDR_EPOCH, 0);
+ SSVAL(req->out.hdr, SMB2_HDR_EPOCH, transport->credits.charge);
SIVAL(req->out.hdr, SMB2_HDR_STATUS, 0);
SSVAL(req->out.hdr, SMB2_HDR_OPCODE, opcode);
SSVAL(req->out.hdr, SMB2_HDR_CREDIT, transport->credits.ask_num);
diff --git a/source4/libcli/smb2/smb2.h b/source4/libcli/smb2/smb2.h
index eb231984df..6372cd805b 100644
--- a/source4/libcli/smb2/smb2.h
+++ b/source4/libcli/smb2/smb2.h
@@ -87,6 +87,7 @@ struct smb2_transport {
} compound;
struct {
+ uint16_t charge;
uint16_t ask_num;
} credits;
diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c
index 60522370b7..dffd1acd2b 100644
--- a/source4/libcli/smb2/transport.c
+++ b/source4/libcli/smb2/transport.c
@@ -84,6 +84,7 @@ struct smb2_transport *smb2_transport_init(struct smbcli_socket *sock,
transport->socket = talloc_steal(transport, sock);
transport->options = *options;
+ transport->credits.charge = 0;
transport->credits.ask_num = 1;
/* setup the stream -> packet parser */
@@ -552,6 +553,12 @@ void smb2_transport_credits_ask_num(struct smb2_transport *transport,
transport->credits.ask_num = ask_num;
}
+void smb2_transport_credits_set_charge(struct smb2_transport *transport,
+ uint16_t charge)
+{
+ transport->credits.charge = charge;
+}
+
static void idle_handler(struct tevent_context *ev,
struct tevent_timer *te, struct timeval t, void *private_data)
{