diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-06-08 17:59:26 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-06-09 16:49:30 +0200 |
commit | d153430e32ba8651feb9a626613c46a4a60c7bbf (patch) | |
tree | 75bcebef784a9c2049dee2b3cfcfad646b854c0d /source4/libcli/smb2 | |
parent | 5b99fa5c4fb1a21caa6da747f8ee9db737990432 (diff) | |
download | samba-d153430e32ba8651feb9a626613c46a4a60c7bbf.tar.gz samba-d153430e32ba8651feb9a626613c46a4a60c7bbf.tar.bz2 samba-d153430e32ba8651feb9a626613c46a4a60c7bbf.zip |
s4:libcli/smb2: add smb2_transport_credits_ask_num()
metze
Diffstat (limited to 'source4/libcli/smb2')
-rw-r--r-- | source4/libcli/smb2/request.c | 4 | ||||
-rw-r--r-- | source4/libcli/smb2/smb2.h | 4 | ||||
-rw-r--r-- | source4/libcli/smb2/transport.c | 7 |
3 files changed, 13 insertions, 2 deletions
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c index 7482cf1f2c..f3684ed280 100644 --- a/source4/libcli/smb2/request.c +++ b/source4/libcli/smb2/request.c @@ -134,10 +134,10 @@ struct smb2_request *smb2_request_init(struct smb2_transport *transport, uint16_ SSVAL(req->out.hdr, SMB2_HDR_EPOCH, 0); SIVAL(req->out.hdr, SMB2_HDR_STATUS, 0); SSVAL(req->out.hdr, SMB2_HDR_OPCODE, opcode); - SSVAL(req->out.hdr, SMB2_HDR_CREDIT, 0); + SSVAL(req->out.hdr, SMB2_HDR_CREDIT, transport->credits.ask_num); SIVAL(req->out.hdr, SMB2_HDR_FLAGS, flags); SIVAL(req->out.hdr, SMB2_HDR_NEXT_COMMAND, 0); - SBVAL(req->out.hdr, SMB2_HDR_MESSAGE_ID, req->seqnum); + SBVAL(req->out.hdr, SMB2_HDR_MESSAGE_ID, req->seqnum); SIVAL(req->out.hdr, SMB2_HDR_PID, 0); SIVAL(req->out.hdr, SMB2_HDR_TID, 0); SBVAL(req->out.hdr, SMB2_HDR_SESSION_ID, 0); diff --git a/source4/libcli/smb2/smb2.h b/source4/libcli/smb2/smb2.h index 39d6aaacba..eb231984df 100644 --- a/source4/libcli/smb2/smb2.h +++ b/source4/libcli/smb2/smb2.h @@ -86,6 +86,10 @@ struct smb2_transport { struct smb2_request_buffer buffer; } compound; + struct { + uint16_t ask_num; + } credits; + /* a list of requests that are pending for receive on this connection */ struct smb2_request *pending_recv; diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c index 49b72a4545..60522370b7 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.ask_num = 1; /* setup the stream -> packet parser */ transport->packet = packet_init(transport); @@ -545,6 +546,12 @@ void smb2_transport_compound_set_related(struct smb2_transport *transport, transport->compound.related = related; } +void smb2_transport_credits_ask_num(struct smb2_transport *transport, + uint16_t ask_num) +{ + transport->credits.ask_num = ask_num; +} + static void idle_handler(struct tevent_context *ev, struct tevent_timer *te, struct timeval t, void *private_data) { |