1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

r20077: support large readx replies, as done by samba3 (and the snia spec),

but not done by windows servers
This commit is contained in:
Andrew Tridgell 2006-12-08 03:47:02 +00:00 committed by Gerald (Jerry) Carter
parent 3f1e88759c
commit e5dbbe177c

View File

@ -161,6 +161,20 @@ NTSTATUS smb_raw_read_recv(struct smbcli_request *req, union smb_read *parms)
parms->readx.out.remaining = SVAL(req->in.vwv, VWV(2));
parms->readx.out.compaction_mode = SVAL(req->in.vwv, VWV(3));
parms->readx.out.nread = SVAL(req->in.vwv, VWV(5));
/* handle oversize replies for non-chained readx replies with
CAP_LARGE_READX. The snia spec has must to answer for. */
if ((req->tree->session->transport->negotiate.capabilities & CAP_LARGE_READX)
&& CVAL(req->in.vwv, VWV(0)) == SMB_CHAIN_NONE &&
req->in.size >= 0x10000) {
parms->readx.out.nread += (SVAL(req->in.vwv, VWV(7)) << 16);
if (req->in.hdr + SVAL(req->in.vwv, VWV(6)) +
parms->readx.out.nread <=
req->in.buffer + req->in.size) {
req->in.data_size += (SVAL(req->in.vwv, VWV(7)) << 16);
}
}
if (parms->readx.out.nread > MAX(parms->readx.in.mincnt, parms->readx.in.maxcnt) ||
!smbcli_raw_pull_data(req, req->in.hdr + SVAL(req->in.vwv, VWV(6)),
parms->readx.out.nread,