1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-17 08:01:36 +00:00

net/anet: Upgrade version 0.3.3 => 0.3.4

The TCP_NODELAY was incorporated upstream (different implementation)
and socket shutdown is now supported as well.
This commit is contained in:
John Marino 2016-10-10 15:58:40 +00:00
parent bb91d541e6
commit 37dd64c7bb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=423670
3 changed files with 5 additions and 65 deletions

View File

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= anet
PORTVERSION= 0.3.3
PORTREVISION= 1
PORTVERSION= 0.3.4
CATEGORIES= net
MASTER_SITES= http://www.codelabs.ch/download/
DISTNAME= libanet-${PORTVERSION}
@ -21,7 +20,7 @@ MAKE_ARGS+= NUM_CPUS=${MAKE_JOBS_NUMBER} \
OS=bsd
OPTIONS_DEFINE= TEST DOCS
TEST_DESC= Run unit test suite before installation
TEST_DESC= Run unit test suite before installation
TEST_ALL_TARGET= tests
TEST_BUILD_DEPENDS= ${LOCALBASE}/lib/gnat/ahven.gpr:devel/ahven
DOCS_USES= gmake

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1467439601
SHA256 (libanet-0.3.3.tar.bz2) = 8ef101d47f549232b0276687235ac7767a2b50b6bde5f48ca21c20007e8ad20b
SIZE (libanet-0.3.3.tar.bz2) = 50553
TIMESTAMP = 1476093104
SHA256 (libanet-0.3.4.tar.bz2) = 7462a5530fe0b8ff9dbf20a2f0a2dd0bf55e7f0c322bc10f9f0327f971706e07
SIZE (libanet-0.3.4.tar.bz2) = 50996

View File

@ -1,59 +0,0 @@
--- 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;