From mm@mail2.vx.sk  Fri Apr 23 09:25:14 2010
Return-Path: <mm@mail2.vx.sk>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1C5C0106564A;
	Fri, 23 Apr 2010 09:25:14 +0000 (UTC)
	(envelope-from mm@mail2.vx.sk)
Received: from mail2.vx.sk (neo.vx.sk [188.40.111.84])
	by mx1.freebsd.org (Postfix) with ESMTP id D3CE38FC14;
	Fri, 23 Apr 2010 09:25:13 +0000 (UTC)
Received: from neo.vx.sk (localhost [127.0.0.1])
	by mail2.vx.sk (Postfix) with ESMTP id 8954436E59;
	Fri, 23 Apr 2010 11:25:12 +0200 (CEST)
Received: from mail2.vx.sk ([127.0.0.1])
	by neo.vx.sk (neo.vx.sk [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id B5mKssKzXKCa; Fri, 23 Apr 2010 11:25:07 +0200 (CEST)
Received: by mail2.vx.sk (Postfix, from userid 1001)
	id 4505536E4C; Fri, 23 Apr 2010 11:25:07 +0200 (CEST)
Message-Id: <20100423092507.4505536E4C@mail2.vx.sk>
Date: Fri, 23 Apr 2010 11:25:07 +0200 (CEST)
From: Martin Matuska <mm@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: mnag@FreeBSD.org
Subject: [PATCH] www/lighttpd: add optional extra-patch for TCP_NODELAY
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         145985
>Category:       ports
>Synopsis:       [PATCH] www/lighttpd: add optional extra-patch for TCP_NODELAY
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mnag
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 23 17:15:36 UTC 2010
>Closed-Date:    Sun May 30 07:37:14 UTC 2010
>Last-Modified:  Sun May 30 07:37:14 UTC 2010
>Originator:     Martin Matuska
>Release:        FreeBSD 8.0-STABLE amd64
>Organization:
>Environment:
System: FreeBSD neo.vx.sk 8.0-STABLE FreeBSD 8.0-STABLE #1 r206844M: Mon Apr 19 18:29:50 CEST
>Description:
- Add an optional extra-patch for TCP_NODELAY

This assumes for lighttpd: net.inet.tcp.delayed_ack=0
and gives a speed boost for serving many small files.
Several other operating systems (e.g. OpenSolaris) always apply this patch.

Added file(s):
- files/extra-patch-nodelay

Port maintainer (mnag@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- lighttpd-1.4.26_1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/www/lighttpd/Makefile,v
retrieving revision 1.77
diff -u -r1.77 Makefile
--- Makefile	16 Feb 2010 21:22:00 -0000	1.77
+++ Makefile	23 Apr 2010 09:22:10 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	lighttpd
 PORTVERSION=	1.4.26
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	http://download.lighttpd.net/lighttpd/releases-1.4.x/
 
@@ -35,6 +36,7 @@
 		MAGNET		"Enable magnet support" off \
 		MEMCACHE	"Enable memory caching support" off \
 		MYSQL		"Enable MYSQL support" off \
+		NODELAY		"Optimize speed with TCP_NODELAY" off \
 		OPENLDAP	"Enable LDAP support" off \
 		OPENSSL		"Enable SSL support" on \
 		SPAWNFCGI	"Enable spawn-fcgi utility" on \
@@ -95,6 +97,10 @@
 _REQUIRE+=		mysql
 .endif
 
+.if defined(WITH_NODELAY)
+EXTRA_PATCHES+=		${FILESDIR}/extra-patch-nodelay
+.endif
+
 .if defined(WITH_OPENLDAP)
 USE_OPENLDAP=		yes
 CONFIGURE_ARGS+=	--with-ldap
Index: files/extra-patch-nodelay
===================================================================
RCS file: files/extra-patch-nodelay
diff -N files/extra-patch-nodelay
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/extra-patch-nodelay	23 Apr 2010 09:22:10 -0000
@@ -0,0 +1,15 @@
+--- src/network.c.orig	Tue Jan 26 14:33:01 2010
++++ src/network.c	Tue Jan 26 14:37:39 2010
+@@ -226,6 +226,12 @@
+ 		log_error_write(srv, __FILE__, __LINE__, "ss", "socketsockopt failed:", strerror(errno));
+ 		goto error_free_socket;
+ 	}
++	if(srv_socket->addr.plain.sa_family == AF_INET || srv_socket->addr.plain.sa_family == AF_INET6 ) {
++		if (setsockopt(srv_socket->fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val)) < 0) {
++			log_error_write(srv, __FILE__, __LINE__, "ss", "socketsockopt failed:", strerror(errno));
++			goto error_free_socket;
++		}
++	}
+ 
+ 	switch(srv_socket->addr.plain.sa_family) {
+ #ifdef HAVE_IPV6
--- lighttpd-1.4.26_1.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->mnag 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat May 1 18:35:49 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145985 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/145985: commit references a PR
Date: Fri, 21 May 2010 07:49:45 +0000 (UTC)

 mm          2010-05-21 07:49:36 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/lighttpd         Makefile 
   Added files:
     www/lighttpd/files   extra-patch-nodelay 
   Log:
   - Add optional TCP_NODELAY patch
   
   PR:             ports/145985
   Approved by:    maintainer (timeout)
   
   Revision  Changes    Path
   1.78      +6 -0      ports/www/lighttpd/Makefile
   1.1       +15 -0     ports/www/lighttpd/files/extra-patch-nodelay (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: mm 
State-Changed-When: Sun May 30 07:37:12 UTC 2010 
State-Changed-Why:  
Committed on maintainer timeout. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145985 
>Unformatted:
