From: Ronnie Sahlberg Date: Sun, 26 Jun 2011 08:26:34 +0000 (+1000) Subject: for UDP sockets, we ONLY wait for pollin events X-Git-Tag: upstream/1.9.6^2~378 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5911f3e8ab7aafe22da1268116c19f4d1658be48;p=deb_libnfs.git for UDP sockets, we ONLY wait for pollin events since upd sockets are always writeable. they just silently drop packets when congested --- diff --git a/lib/socket.c b/lib/socket.c index 7a29134..2c77ef6 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -47,6 +47,11 @@ int rpc_which_events(struct rpc_context *rpc) { int events = rpc->is_connected ? POLLIN : POLLOUT; + if (rpc->is_udp != 0) { + /* for udp sockets we only wait for pollin */ + return POLLIN; + } + if (rpc->outqueue) { events |= POLLOUT; }