smbd: Fix async large read
authorVolker Lendecke <vl@samba.org>
Thu, 7 Dec 2017 17:12:28 +0000 (18:12 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 12 Dec 2017 19:37:08 +0000 (20:37 +0100)
We also do the 128k reads asynchronously, just not the huge 24MB
ones. smb_setlen does not work well for >64k.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/aio.c

index d3611baae6a2b3724abfc0d5e54b5d5cb9c85341..4fc1132be87e359c6f8fc73ad41959738c6bbe2b 100644 (file)
@@ -305,7 +305,7 @@ static void aio_pread_smb1_done(struct tevent_req *req)
                           (int)aio_ex->nbyte, (int)nread ) );
 
        }
-       smb_setlen(outbuf, outsize - 4);
+       _smb_setlen_large(outbuf, outsize - 4);
        show_msg(outbuf);
        if (!srv_send_smb(aio_ex->smbreq->xconn, outbuf,
                          true, aio_ex->smbreq->seqnum+1,