Author: rmacklem
Date: Sun Apr 24 21:27:29 2011
New Revision: 220999
URL: http://svn.freebsd.org/changeset/base/220999

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/8/lib/libc/rpc/svc_vc.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/rpc/svc_vc.c
==============================================================================
--- stable/8/lib/libc/rpc/svc_vc.c      Sun Apr 24 19:50:13 2011        
(r220998)
+++ stable/8/lib/libc/rpc/svc_vc.c      Sun Apr 24 21:27:29 2011        
(r220999)
@@ -546,7 +546,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
@@ -560,6 +560,7 @@ write_vc(xprtp, buf, len)
                                        return (-1);
                                }
                        }
+                       i = 0;
                }
        }
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to