for UDP sockets, we ONLY wait for pollin events
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 26 Jun 2011 08:26:34 +0000 (18:26 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 26 Jun 2011 08:26:34 +0000 (18:26 +1000)
since upd sockets are always writeable.
they just silently drop packets when congested

lib/socket.c

index 7a291346b7bb4d4f0f39f8cc728899441407c488..2c77ef64c549d3de2f1731a7a691d2a07d74e613 100644 (file)
@@ -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;
        }