s3:smbd: Add functions calc_max_read_pdu()/calc_read_size() to work out the length...
commitfd88520497b4043e9d81656f7cb56a7b25245c2a
authorJeremy Allison <jra@samba.org>
Fri, 15 Mar 2013 18:57:48 +0000 (15 11:57 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 20 Mar 2013 16:32:26 +0000 (20 09:32 -0700)
treefab3fa19a01e59b91936839eb52e752a81a30d81
parent21707defe06e1db18a6645b0b56db4178e3df5f6
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