summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_socket.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-12-10 19:55:22 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-12-10 19:55:22 +0000
commit0a8edbba80c57948d185c116ba47840130179685 (patch)
tree52264cc94c0fca47c2ba3ead8b289a8727da7c66 /sys/nfs/nfs_socket.c
parent2262ee76cc1cc5ff1756c4ec853ab564c1e427e9 (diff)
In nfs_connect() move the setting of so->so_rcv.sb_timeo out of the
if () else since it is common to both cases and makes the code clearer. OK pedro@
Diffstat (limited to 'sys/nfs/nfs_socket.c')
-rw-r--r--sys/nfs/nfs_socket.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index b5c670c6625..059d82f748e 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.39 2004/07/14 18:32:34 pedro Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.40 2004/12/10 19:55:21 millert Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -238,18 +238,15 @@ nfs_connect(nmp, rep)
}
splx(s);
}
- if (nmp->nm_flag & (NFSMNT_SOFT | NFSMNT_INT)) {
- so->so_rcv.sb_timeo = (5 * hz);
+ /*
+ * Always set receive timeout to detect server crash and reconnect.
+ * Otherwise, we can get stuck in soreceive forever.
+ */
+ so->so_rcv.sb_timeo = (5 * hz);
+ if (nmp->nm_flag & (NFSMNT_SOFT | NFSMNT_INT))
so->so_snd.sb_timeo = (5 * hz);
- } else {
- /*
- * enable receive timeout to detect server crash and
- * reconnect. otherwise, we can be stuck in soreceive
- * forever.
- */
- so->so_rcv.sb_timeo = (5 * hz);
+ else
so->so_snd.sb_timeo = 0;
- }
if (nmp->nm_sotype == SOCK_DGRAM) {
sndreserve = nmp->nm_wsize + NFS_MAXPKTHDR;
rcvreserve = max(nmp->nm_rsize, nmp->nm_readdirsize) +