From 32f9ee7c206138b2f26254d9b4b7b45f4490ef38 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 14 Dec 2004 01:11:22 +0000 Subject: r4190: When changing length calculations, get them right...... Jeremy. (This used to be commit 63cfa904ad186bb9d793584d319bd4a7107cc8b9) --- source3/smbd/reply.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/smbd/reply.c') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 3dae67efef..eead0bc1a1 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2112,6 +2112,7 @@ Returning short read of maximum allowed for compatibility with Windows 2000.\n", int send_file_readX(connection_struct *conn, char *inbuf,char *outbuf,int length, int len_outbuf, files_struct *fsp, SMB_OFF_T startpos, size_t smb_maxcnt) { + int outsize = 0; ssize_t nread = -1; char *data = smb_buf(outbuf); @@ -2197,7 +2198,7 @@ int send_file_readX(connection_struct *conn, char *inbuf,char *outbuf,int length return(UNIXERROR(ERRDOS,ERRnoaccess)); } - set_message(outbuf,12,nread,False); + outsize = set_message(outbuf,12,nread,False); SSVAL(outbuf,smb_vwv2,0xFFFF); /* Remaining - must be -1. */ SSVAL(outbuf,smb_vwv5,nread); SSVAL(outbuf,smb_vwv6,smb_offset(data,outbuf)); @@ -2207,7 +2208,7 @@ int send_file_readX(connection_struct *conn, char *inbuf,char *outbuf,int length DEBUG( 3, ( "send_file_readX fnum=%d max=%d nread=%d\n", fsp->fnum, (int)smb_maxcnt, (int)nread ) ); - return nread; + return outsize; } /**************************************************************************** -- cgit