diff options
author | John Marino <marino@FreeBSD.org> | 2016-09-24 16:43:44 +0000 |
---|---|---|
committer | John Marino <marino@FreeBSD.org> | 2016-09-24 16:43:44 +0000 |
commit | ffb03aad02949f64b64e0a3c106d3a7d81c68c22 (patch) | |
tree | 7a5460e13a708c38b13422a19fbc7569535d4def /net | |
parent | df25b1423a1d79480d2772290a2ee219d7dad822 (diff) | |
download | ports-ffb03aad02949f64b64e0a3c106d3a7d81c68c22.tar.gz ports-ffb03aad02949f64b64e0a3c106d3a7d81c68c22.zip |
Notes
Diffstat (limited to 'net')
-rw-r--r-- | net/anet/Makefile | 1 | ||||
-rw-r--r-- | net/anet/files/patch-add-TCP_NODELAY | 59 |
2 files changed, 60 insertions, 0 deletions
diff --git a/net/anet/Makefile b/net/anet/Makefile index a1178e015878..08aa286146a5 100644 --- a/net/anet/Makefile +++ b/net/anet/Makefile @@ -3,6 +3,7 @@ PORTNAME= anet PORTVERSION= 0.3.3 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= http://www.codelabs.ch/download/ DISTNAME= libanet-${PORTVERSION} diff --git a/net/anet/files/patch-add-TCP_NODELAY b/net/anet/files/patch-add-TCP_NODELAY new file mode 100644 index 000000000000..8257ff5dc77a --- /dev/null +++ b/net/anet/files/patch-add-TCP_NODELAY @@ -0,0 +1,59 @@ +--- src/anet-constants.ads.orig 2016-06-29 10:26:01 UTC ++++ src/anet-constants.ads +@@ -45,6 +45,7 @@ package Anet.Constants is + -- Protocol levels -- + --------------------- + ++ IPPROTO_TCP : constant := 6; -- TCP + IPPROTO_IPV6 : constant := 41; -- IPv6 + IPPROTO_ESP : constant := 50; -- ESP + +--- src/bsd/anet-os_constants.ads.orig 2016-06-29 10:26:01 UTC ++++ src/bsd/anet-os_constants.ads +@@ -26,5 +26,6 @@ package Anet.OS_Constants is + IPV6_ADD_MEMBERSHIP : constant := 12; -- Join multicast group (IPv6) + + O_NONBLOCK : constant := 4; -- Non-blocking sockets ++ TCP_NODELAY : constant := 1; -- Don't delay send to coalesce pkts + + end Anet.OS_Constants; +--- src/anet-sockets.ads.orig 2016-06-29 10:26:01 UTC ++++ src/anet-sockets.ads +@@ -119,6 +119,12 @@ package Anet.Sockets is + Value : String); + -- Set socket option of given socket to specified string value. + ++ procedure Set_Socket_Send_Delay ++ (Socket : Socket_Type; ++ Without_Delay : Boolean); ++ -- Set Nagle's Algorithm (socket may delay sending data) ++ -- By default, sockets have the algorithm enabled and can delay sending ++ + private + + use type Interfaces.C.int; +--- src/anet-sockets.adb.orig 2016-06-29 10:26:01 UTC ++++ src/anet-sockets.adb +@@ -279,4 +279,22 @@ package body Anet.Sockets is + Value & "'"); + end Set_Socket_Option; + ++ ------------------------------------------------------------------------- ++ ++ procedure Set_Socket_Send_Delay ++ (Socket : Socket_Type; ++ Without_Delay : Boolean) ++ is ++ Val : C.int := C.int (Boolean'Pos (Without_Delay)); ++ begin ++ Errno.Check_Or_Raise ++ (Result => Thin.C_Setsockopt ++ (S => Socket.Sock_FD, ++ Level => Constants.Sys.IPPROTO_TCP, ++ Optname => OS_Constants.TCP_NODELAY, ++ Optval => Val'Address, ++ Optlen => Val'Size / 8), ++ Message => "Unable to set socket option TCP_NODELAY"); ++ end Set_Socket_Send_Delay; ++ + end Anet.Sockets; |