From 94bdf0572b44f6751e89d4a6291b65444c6de9ac Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 14 Jan 2000 23:50:38 +0000 Subject: useable_space does not include the alignment offset calculations. Bugfix from Marc_Jacobsen@hp.com. Jeremy. (This used to be commit eb06c199163232453e2d9ca50d00765c90f8f3e2) --- source3/smbd/trans2.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); -- cgit