From owner-svn-ports-head@freebsd.org Sat Sep 24 16:43:45 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BBE6BE8304; Sat, 24 Sep 2016 16:43:45 +0000 (UTC) (envelope-from marino@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E2309D0; Sat, 24 Sep 2016 16:43:45 +0000 (UTC) (envelope-from marino@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8OGhiwW069218; Sat, 24 Sep 2016 16:43:44 GMT (envelope-from marino@FreeBSD.org) Received: (from marino@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8OGhiLS069216; Sat, 24 Sep 2016 16:43:44 GMT (envelope-from marino@FreeBSD.org) Message-Id: <201609241643.u8OGhiLS069216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marino set sender to marino@FreeBSD.org using -f From: John Marino Date: Sat, 24 Sep 2016 16:43:44 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r422731 - in head/net/anet: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Sep 2016 16:43:45 -0000 Author: marino Date: Sat Sep 24 16:43:44 2016 New Revision: 422731 URL: https://svnweb.freebsd.org/changeset/ports/422731 Log: net/anet: Implement TCP_NODELAY socket option Added: head/net/anet/files/patch-add-TCP_NODELAY (contents, props changed) Modified: head/net/anet/Makefile Modified: head/net/anet/Makefile ============================================================================== --- head/net/anet/Makefile Sat Sep 24 16:10:39 2016 (r422730) +++ head/net/anet/Makefile Sat Sep 24 16:43:44 2016 (r422731) @@ -3,6 +3,7 @@ PORTNAME= anet PORTVERSION= 0.3.3 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= http://www.codelabs.ch/download/ DISTNAME= libanet-${PORTVERSION} Added: head/net/anet/files/patch-add-TCP_NODELAY ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/anet/files/patch-add-TCP_NODELAY Sat Sep 24 16:43:44 2016 (r422731) @@ -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;