From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Jul 14 01:30:20 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EEC5816A41C for ; Thu, 14 Jul 2005 01:30:19 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7823443D46 for ; Thu, 14 Jul 2005 01:30:19 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j6E1UJeF052565 for ; Thu, 14 Jul 2005 01:30:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j6E1UJab052564; Thu, 14 Jul 2005 01:30:19 GMT (envelope-from gnats) Resent-Date: Thu, 14 Jul 2005 01:30:19 GMT Resent-Message-Id: <200507140130.j6E1UJab052564@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Antony Mawer Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89C8616A41C for ; Thu, 14 Jul 2005 01:20:23 +0000 (GMT) (envelope-from root@c211-30-90-140.belrs3.nsw.optusnet.com.au) Received: from mail21.syd.optusnet.com.au (mail21.syd.optusnet.com.au [211.29.133.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id F13F443D48 for ; Thu, 14 Jul 2005 01:20:22 +0000 (GMT) (envelope-from root@c211-30-90-140.belrs3.nsw.optusnet.com.au) Received: from c211-30-90-140.belrs3.nsw.optusnet.com.au (c211-30-246-162.belrs3.nsw.optusnet.com.au [211.30.246.162]) by mail21.syd.optusnet.com.au (8.12.11/8.12.11) with SMTP id j6E1KKYu032185 for ; Thu, 14 Jul 2005 11:20:21 +1000 Received: (qmail 55551 invoked by uid 0); 14 Jul 2005 01:20:20 -0000 Message-Id: <20050714012020.55550.qmail@c211-30-90-140.belrs3.nsw.optusnet.com.au> Date: 14 Jul 2005 01:20:20 -0000 From: Antony Mawer To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/83427: [patch] www/http_load proxy support does not work X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Antony Mawer List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2005 01:30:20 -0000 >Number: 83427 >Category: ports >Synopsis: [patch] www/http_load proxy support does not work >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jul 14 01:30:18 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Antony Mawer >Release: FreeBSD 4.11-RELEASE-p3 i386 >Organization: GP Technology Solutions >Environment: System: FreeBSD gwsquish.enchanted.net 4.11-RELEASE-p3 FreeBSD 4.11-RELEASE-p3 #4: Mon Apr 18 21:09:02 EST 2005 root@gwsquish.enchanted.net:/usr/obj/usr/src/sys/FREEANT i386 >Description: The -proxy argument to the http_load port does not have any effect. HTTP requests are always made direct to the remote server instead of going via the specified proxy server. The same issue can be found in the NetBSD PR database located here: http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=26541 >How-To-Repeat: Run the http_load command with a proxy: http_load -proxy : -rate 5 -seconds 10 urls.txt Observe that no traffic goes via the proxy server, and instead all requests are made direct to the remote web servers specified in urls.txt >Fix: This patch is essentially identical to the one from NetBSD PR 26541, with a further change that appears to have been missed in that PR. The attached patch fixes the issue and has been tested successfully. After rebuilding with the attached patch, http_load correctly sends traffic via the specified proxy server. --- patch-ab begins here --- --- http_load.c.old Thu Jul 14 11:05:48 2005 +++ http_load.c Thu Jul 14 11:06:41 2005 @@ -655,11 +655,11 @@ (void) memset( &hints, 0, sizeof(hints) ); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - (void) snprintf( portstr, sizeof(portstr), "%d", (int) urls[url_num].port ); - if ( (gaierr = getaddrinfo( urls[url_num].hostname, portstr, &hints, &ai )) != 0 ) + (void) snprintf( portstr, sizeof(portstr), "%d", (int) port ); + if ( (gaierr = getaddrinfo( hostname, portstr, &hints, &ai )) != 0 ) { (void) fprintf( - stderr, "%s: getaddrinfo %s - %s\n", argv0, urls[url_num].hostname, + stderr, "%s: getaddrinfo %s - %s\n", argv0, hostname, gai_strerror( gaierr ) ); exit( 1 ); } @@ -724,15 +724,15 @@ (void) fprintf( stderr, "%s: no valid address found for host %s\n", argv0, - urls[url_num].hostname ); + hostname ); exit( 1 ); #else /* USE_IPV6 */ - he = gethostbyname( urls[url_num].hostname ); + he = gethostbyname( hostname ); if ( he == (struct hostent*) 0 ) { - (void) fprintf( stderr, "%s: unknown host - %s\n", argv0, urls[url_num].hostname ); + (void) fprintf( stderr, "%s: unknown host - %s\n", argv0, hostname ); exit( 1 ); } urls[url_num].sock_family = urls[url_num].sa.sin_family = he->h_addrtype; --- patch-ab ends here --- >Release-Note: >Audit-Trail: >Unformatted: