From 5911f3e8ab7aafe22da1268116c19f4d1658be48 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 26 Jun 2011 18:26:34 +1000 Subject: [PATCH] for UDP sockets, we ONLY wait for pollin events since upd sockets are always writeable. they just silently drop packets when congested --- lib/socket.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.34.1