Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Apr 2011 22:12:00 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r221000 - stable/7/lib/libc/rpc
Message-ID:  <201104242212.p3OMC0AK049165@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sun Apr 24 22:12:00 2011
New Revision: 221000
URL: http://svn.freebsd.org/changeset/base/221000

Log:
  MFC: r220519
  Fix a bug in the userland rpc library, where it would use a
  negative return value from write to update its position in
  a buffer. The patch, courtesy of Andrey Simonenko, also simplifies
  a conditional by removing the "i != cnt" clause, since it is
  always true at this point in the code. The bug caused problems
  for mountd, when it generated a large reply to an exports RPC
  request.

Modified:
  stable/7/lib/libc/rpc/svc_vc.c
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)

Modified: stable/7/lib/libc/rpc/svc_vc.c
==============================================================================
--- stable/7/lib/libc/rpc/svc_vc.c	Sun Apr 24 21:27:29 2011	(r220999)
+++ stable/7/lib/libc/rpc/svc_vc.c	Sun Apr 24 22:12:00 2011	(r221000)
@@ -550,7 +550,7 @@ write_vc(xprtp, buf, len)
 				cd->strm_stat = XPRT_DIED;
 				return (-1);
 			}
-			if (cd->nonblock && i != cnt) {
+			if (cd->nonblock) {
 				/*
 				 * For non-blocking connections, do not
 				 * take more than 2 seconds writing the
@@ -564,6 +564,7 @@ write_vc(xprtp, buf, len)
 					return (-1);
 				}
 			}
+			i = 0;
 		}
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104242212.p3OMC0AK049165>