summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-01-14 23:50:38 +0000
committerJeremy Allison <jra@samba.org>2000-01-14 23:50:38 +0000
commit94bdf0572b44f6751e89d4a6291b65444c6de9ac (patch)
tree3e9c7dc1158a1011bb089952826d5237035977dd
parent86da0e8ac1bc0197235b012ba6c56f29aef5c74e (diff)
downloadsamba-94bdf0572b44f6751e89d4a6291b65444c6de9ac.tar.gz
samba-94bdf0572b44f6751e89d4a6291b65444c6de9ac.tar.bz2
samba-94bdf0572b44f6751e89d4a6291b65444c6de9ac.zip
useable_space does not include the alignment offset calculations.
Bugfix from Marc_Jacobsen@hp.com. Jeremy. (This used to be commit eb06c199163232453e2d9ca50d00765c90f8f3e2)
-rw-r--r--source3/smbd/trans2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 896200059f..4b774a4ed1 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -95,7 +95,14 @@ static int send_trans2_replies(char *outbuf, int bufsize, char *params,
total_sent_thistime = params_to_send + data_to_send +
alignment_offset + data_alignment_offset;
/* We can never send more than useable_space */
- total_sent_thistime = MIN(total_sent_thistime, useable_space);
+ /*
+ * Note that 'useable_space' does not include the alignment offsets,
+ * but we must include the alignment offsets in the calculation of
+ * the length of the data we send over the wire, as the alignment offsets
+ * are sent here. Fix from Marc_Jacobsen@hp.com.
+ */
+ total_sent_thistime = MIN(total_sent_thistime, useable_space +
+ alignment_offset + data_alignment_offset);
set_message(outbuf, 10, total_sent_thistime, True);