diff options
author | Jeremy Allison <jra@samba.org> | 2000-03-28 02:20:57 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-03-28 02:20:57 +0000 |
commit | aaa8aadd35dcdba542bda897bfe6c55c1567714b (patch) | |
tree | 3c938d5d4e8504b186ce876bb0bf670992db19bc /source3/smbd/trans2.c | |
parent | 0583c25087c2e1dcb42e0e7f9f38ffc6f9103b15 (diff) | |
download | samba-aaa8aadd35dcdba542bda897bfe6c55c1567714b.tar.gz samba-aaa8aadd35dcdba542bda897bfe6c55c1567714b.tar.bz2 samba-aaa8aadd35dcdba542bda897bfe6c55c1567714b.zip |
Moved common code to set parameter offset field correctly oout of 'if'
statement into main function code path.
Jeremy.
(This used to be commit f15ca0d9273d718534ba2fdd2ccd14ab90a95c8b)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r-- | source3/smbd/trans2.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 24abf60a79..38f2802df3 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -118,21 +118,19 @@ static int send_trans2_replies(char *outbuf, int bufsize, char *params, data_sent_thistime = MIN(data_sent_thistime,data_to_send); SSVAL(outbuf,smb_prcnt, params_sent_thistime); + + /* smb_proff is the offset from the start of the SMB header to the + parameter bytes, however the first 4 bytes of outbuf are + the Netbios over TCP header. Thus use smb_base() to subtract + them from the calculation */ + + SSVAL(outbuf,smb_proff,((smb_buf(outbuf)+alignment_offset) - smb_base(outbuf))); + if(params_sent_thistime == 0) - { - SSVAL(outbuf,smb_proff,((smb_buf(outbuf)+alignment_offset) - smb_base(outbuf))); SSVAL(outbuf,smb_prdisp,0); - } else - { - /* smb_proff is the offset from the start of the SMB header to the - parameter bytes, however the first 4 bytes of outbuf are - the Netbios over TCP header. Thus use smb_base() to subtract - them from the calculation */ - SSVAL(outbuf,smb_proff,((smb_buf(outbuf)+alignment_offset) - smb_base(outbuf))); /* Absolute displacement of param bytes sent in this packet */ SSVAL(outbuf,smb_prdisp,pp - params); - } SSVAL(outbuf,smb_drcnt, data_sent_thistime); if(data_sent_thistime == 0) |