From thomas@laurel.tmseck.homedns.org  Fri Feb 27 07:59:06 2004
Return-Path: <thomas@laurel.tmseck.homedns.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DB47416A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 27 Feb 2004 07:59:06 -0800 (PST)
Received: from smtp2.netcologne.de (smtp2.netcologne.de [194.8.194.218])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9B6A743D1D
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 27 Feb 2004 07:59:06 -0800 (PST)
	(envelope-from thomas@laurel.tmseck.homedns.org)
Received: from laurel.tmseck.homedns.org (xdsl-213-196-216-128.netcologne.de [213.196.216.128])
	by smtp2.netcologne.de (Postfix) with SMTP id 1A4743B56C
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 27 Feb 2004 16:59:05 +0100 (MET)
Received: (qmail 11782 invoked by uid 1001); 27 Feb 2004 15:59:02 -0000
Message-Id: <20040227155902.11781.qmail@laurel.tmseck.homedns.org>
Date: 27 Feb 2004 15:59:02 -0000
From: Thomas-Martin Seck <tmseck@netcologne.de>
Reply-To: Thomas-Martin Seck <tmseck@netcologne.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [Maintainer] www/gatling: fix HTTP pipelining filedescriptor leak
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         63452
>Category:       ports
>Synopsis:       [Maintainer] www/gatling: fix HTTP pipelining filedescriptor leak
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 27 08:00:40 PST 2004
>Closed-Date:    Fri Feb 27 14:47:07 PST 2004
>Last-Modified:  Fri Feb 27 14:47:07 PST 2004
>Originator:     Thomas-Martin Seck
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
private site in Germany
>Environment:
FreeBSD ports repository as of Feb 27, 2004.

	
>Description:
- fix a filedescriptor leak that occured when doing HTTP pipelining
  (obtained from vendor CVS)
- do not set PORTDOCS when NOPORTDOCS is defined
- bump PORTREVISION

Note: This update requires libowfat-0.18 being installed!

Information for committers:
- please commit the update for devel/libowfat to 0.18 beforehand
- 'cvs add' files/patch-gatling.c
	
>How-To-Repeat:
	
>Fix:
Here's the patch:

diff -ruN -x cvs gatling.orig/Makefile gatling/Makefile
--- gatling.orig/Makefile	Mon Feb 23 01:20:38 2004
+++ gatling/Makefile	Fri Feb 27 16:29:38 2004
@@ -7,6 +7,7 @@
 
 PORTNAME=	gatling
 PORTVERSION=	0.4
+PORTREVISION=	1
 CATEGORIES=	www benchmarks
 MASTER_SITES=	http://dl.fefe.de/
 
@@ -23,8 +24,10 @@
 bin=		dl gatling
 examples=	run-gatling
 examplesdir=	${EXAMPLESDIR:S,^${PREFIX}/,,}
+.if !defined(NOPORTDOCS)
 PORTDOCS=	CHANGES README README.ftp README.http README.performance \
 		README.prefetch
+.endif
 
 OPTIONS=	BENCHMARKS "Install system benchmark programs" on
 
diff -ruN -x cvs gatling.orig/files/patch-gatling.c gatling/files/patch-gatling.c
--- gatling.orig/files/patch-gatling.c	Thu Jan  1 01:00:00 1970
+++ gatling/files/patch-gatling.c	Fri Feb 27 16:18:09 2004
@@ -0,0 +1,22 @@
+! Fix a filedescriptor leak. This change requires libowfat-0.18
+! Obtained from gatling cvs
+--- gatling.c.orig	Fri Feb 27 16:09:53 2004
++++ gatling.c	Fri Feb 27 16:13:28 2004
+@@ -876,7 +876,7 @@
+ 	  c+=fmt_str(c,"\r\n\r\n");
+ 	  iob_addbuf_free(&h->iob,h->hdrbuf,c - h->hdrbuf);
+ 	  if (!head)
+-	    iob_addfile(&h->iob,fd,range_first,range_last-range_first);
++	    iob_addfile_close(&h->iob,fd,range_first,range_last-range_first);
+ 	  if (logging) {
+ 	    if (h->hdrbuf[9]=='3') {
+ 	      buffer_puts(buffer_1,head?"HEAD/304 ":"GET/304 ");
+@@ -1034,7 +1034,7 @@
+       range_last=ss.st_size;
+     range_first=h->ftp_rest; h->ftp_rest=0;
+     if (range_first>range_last) range_first=range_last;
+-    iob_addfile(&b->iob,b->filefd,range_first,range_last-range_first);
++    iob_addfile_close(&b->iob,b->filefd,range_first,range_last-range_first);
+     if (logging) {
+       buffer_putulonglong(buffer_1,range_last-range_first);
+       buffer_putspace(buffer_1);

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: krion 
State-Changed-When: Fri Feb 27 14:47:00 PST 2004 
State-Changed-Why:  
Committed, thanks! 

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