summaryrefslogtreecommitdiff
path: root/standalone/android/haskell-patches/network-conduit_0.6.2.2_0001-NoDelay-does-not-work-on-Android.patch
blob: 35bafa774f616593d5e47cb40b132ba6e5a21976 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 3e05f3a3bf886c302fb6d6caa7ee92cf9736b6ad Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Thu, 28 Feb 2013 23:33:45 -0400
Subject: [PATCH] NoDelay does not work on Android

(I think the other change is no-op)
---
 Data/Conduit/Network/Utils.hs |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Data/Conduit/Network/Utils.hs b/Data/Conduit/Network/Utils.hs
index 32a7286..01ff84e 100644
--- a/Data/Conduit/Network/Utils.hs
+++ b/Data/Conduit/Network/Utils.hs
@@ -6,14 +6,14 @@ module Data.Conduit.Network.Utils
     , getSocket
     ) where
 
-import Network.Socket (AddrInfo, Socket, SocketType)
+import Network.Socket (Socket, SocketType)
 import qualified Network.Socket as NS
 import Data.String (IsString (fromString))
 import Control.Exception (bracketOnError, IOException)
 import qualified Control.Exception as E
 
 -- | Attempt to connect to the given host/port using given @SocketType@.
-getSocket :: String -> Int -> SocketType -> IO (Socket, AddrInfo)
+getSocket :: String -> Int -> SocketType -> IO (Socket, NS.AddrInfo)
 getSocket host' port' sockettype = do
     let hints = NS.defaultHints {
                           NS.addrFlags = [NS.AI_ADDRCONFIG]
@@ -93,7 +93,7 @@ bindPort p s sockettype = do
         sockOpts =
             case sockettype of
                 NS.Datagram -> [(NS.ReuseAddr,1)]
-                _           -> [(NS.NoDelay,1), (NS.ReuseAddr,1)]
+                _           -> [(NS.ReuseAddr,1)] -- Android seems to not have NoDelay
 
         theBody addr =
           bracketOnError
-- 
1.7.10.4