s3:smbd: Add functions calc_max_read_pdu()/calc_read_size() to work out the length...
authorJeremy Allison <jra@samba.org>
Fri, 15 Mar 2013 18:57:48 +0000 (11:57 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 21 Mar 2013 08:30:20 +0000 (09:30 +0100)
commit3344ca5744039aad0857925650dbd20f6a447763
tree0e957c207deba1f4c9523a81ee0fa08be651be6b
parent675795fbcc259509e81c77d35f5a908a97f155d8
s3:smbd: Add functions calc_max_read_pdu()/calc_read_size() to work out the length we should return.

LARGE_READX test shows it's always safe to return a short read.
Windows does so. Do the calculations to return what will fit
in a read depending on what the client negotiated.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/reply.c