summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorMartin Blapp <mbr@FreeBSD.org>2003-01-27 22:19:32 +0000
committerMartin Blapp <mbr@FreeBSD.org>2003-01-27 22:19:32 +0000
commit40525d3debff0cc5e5d3175efd1492d5ef3efaa1 (patch)
tree9624285bb009929a6271ad372a293b5d18f3836a /lib/libc
parent091e0b14d54a9ef361c13a6b3743c220eab12927 (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/xdr/xdr_rec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/libc/xdr/xdr_rec.c b/lib/libc/xdr/xdr_rec.c
index a09c496a97dc..e899ebb57c40 100644
--- a/lib/libc/xdr/xdr_rec.c
+++ b/lib/libc/xdr/xdr_rec.c
@@ -609,6 +609,7 @@ __xdrrec_getrec(xdrs, statp, expectdata)
rstrm->fbtbc = rstrm->in_reclen;
rstrm->in_boundry = rstrm->in_base + rstrm->in_reclen;
rstrm->in_finger = rstrm->in_base;
+ rstrm->in_reclen = rstrm->in_received = 0;
*statp = XPRT_MOREREQS;
return TRUE;
}
@@ -686,6 +687,14 @@ get_input_bytes(rstrm, addr, len)
{
size_t current;
+ if (rstrm->nonblock) {
+ if (len > (int)(rstrm->in_boundry - rstrm->in_finger))
+ return FALSE;
+ memcpy(addr, rstrm->in_finger, (size_t)len);
+ rstrm->in_finger += len;
+ return TRUE;
+ }
+
while (len > 0) {
current = (size_t)((long)rstrm->in_boundry -
(long)rstrm->in_finger);