diff options
author | mbr <mbr@FreeBSD.org> | 2003-05-28 09:13:09 +0000 |
---|---|---|
committer | mbr <mbr@FreeBSD.org> | 2003-05-28 09:13:09 +0000 |
commit | e1224fa532b4b0230b27667004bd04b652bdaa1f (patch) | |
tree | 8a3afd1f30eaa0557eec40df42ac067fb2ecf3dc /lib/libc/xdr | |
parent | 31071c76d075fbf1bace9dcd55b26d610a7aa234 (diff) | |
download | FreeBSD-src-e1224fa532b4b0230b27667004bd04b652bdaa1f.zip FreeBSD-src-e1224fa532b4b0230b27667004bd04b652bdaa1f.tar.gz |
Fix amd(8) clients, if a FreeBSD mountd(8) server is used.
Remove the special treatment of non-blocking mode in
the "look ahead function" xdrrec_eof(). It currently
assumes that the last read() in a row of several reads
does not have zero lenght. If this is the case, svc_vc_stat()
does return XPRT_MOREREQS, and the RPC-request aborts because
there is no data to read anymore.
To fix this, go back to the original version of the code
for non-blocking mode until NetBSD comes up with another
possible fix like this one in xdrrec_eof()
if (rstrm->last_frag && rstrm->in_finger == rstrm->in_boundry) {
return TRUE;
}
Return always FALSE in set_input_fragment() for non-blocking
mode. Since this was not used in FreeBSD, I omitted it at the
first time. Now we use this function and we should always
return FALSE for it.
Reviewed by: rwatson
Approved by: re
Diffstat (limited to 'lib/libc/xdr')
-rw-r--r-- | lib/libc/xdr/xdr_rec.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/libc/xdr/xdr_rec.c b/lib/libc/xdr/xdr_rec.c index 340febd..cb5a302 100644 --- a/lib/libc/xdr/xdr_rec.c +++ b/lib/libc/xdr/xdr_rec.c @@ -489,15 +489,6 @@ xdrrec_eof(xdrs) XDR *xdrs; { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - enum xprt_stat xstat; - - if (rstrm->nonblock) { - if (__xdrrec_getrec(xdrs, &xstat, FALSE)) - return FALSE; - if (!rstrm->in_haveheader && xstat == XPRT_IDLE) - return TRUE; - return FALSE; - } while (rstrm->fbtbc > 0 || (! rstrm->last_frag)) { if (! skip_input_bytes(rstrm, rstrm->fbtbc)) @@ -719,6 +710,8 @@ set_input_fragment(rstrm) { u_int32_t header; + if (rstrm->nonblock) + return FALSE; if (! get_input_bytes(rstrm, (char *)(void *)&header, sizeof(header))) return (FALSE); header = ntohl(header); |