summaryrefslogtreecommitdiff
path: root/dht/src/Network/QueryResponse.hs
diff options
context:
space:
mode:
Diffstat (limited to 'dht/src/Network/QueryResponse.hs')
-rw-r--r--dht/src/Network/QueryResponse.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/dht/src/Network/QueryResponse.hs b/dht/src/Network/QueryResponse.hs
index f72763de..27134470 100644
--- a/dht/src/Network/QueryResponse.hs
+++ b/dht/src/Network/QueryResponse.hs
@@ -548,7 +548,9 @@ sockAddrFamily :: SockAddr -> Family
548sockAddrFamily (SockAddrInet _ _ ) = AF_INET 548sockAddrFamily (SockAddrInet _ _ ) = AF_INET
549sockAddrFamily (SockAddrInet6 _ _ _ _) = AF_INET6 549sockAddrFamily (SockAddrInet6 _ _ _ _) = AF_INET6
550sockAddrFamily (SockAddrUnix _ ) = AF_UNIX 550sockAddrFamily (SockAddrUnix _ ) = AF_UNIX
551#if !MIN_VERSION_network(3,0,0)
551sockAddrFamily _ = AF_CAN -- SockAddrCan constructor deprecated 552sockAddrFamily _ = AF_CAN -- SockAddrCan constructor deprecated
553#endif
552 554
553-- | Packets with an empty payload may trigger EOF exception. 555-- | Packets with an empty payload may trigger EOF exception.
554-- 'udpTransport' uses this function to avoid throwing in that 556-- 'udpTransport' uses this function to avoid throwing in that
@@ -619,8 +621,12 @@ udpTransport' bind_address = do
619 -- close sock 621 -- close sock
620 tryTakeMVar isClosed >> putMVar isClosed () 622 tryTakeMVar isClosed >> putMVar isClosed ()
621 -- set O_NONBLOCK using fcntl 623 -- set O_NONBLOCK using fcntl
624 -- NOTE: setNonBlockIfNeeded is a no-op on windows
625#if MIN_VERSION_network (3,1,0)
626 withFdSocket sock $ \fd -> setNonBlockIfNeeded fd
627#else
622 setNonBlockIfNeeded (fdSocket sock) -- setSocketOption sock ??? 0 628 setNonBlockIfNeeded (fdSocket sock) -- setSocketOption sock ??? 0
623 629#endif
624 } 630 }
625 return (tr, sock) 631 return (tr, sock)
626 632