summaryrefslogtreecommitdiff
path: root/www/http_load/patches/patch-ab
blob: 2749d7af0d595d4800f10acad5636ba3fe1c5176 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$NetBSD: patch-ab,v 1.1 2004/08/04 12:21:02 cube Exp $

--- http_load.c.orig	2002-01-04 22:20:46.000000000 +0100
+++ http_load.c
@@ -655,11 +655,11 @@ lookup_address( int url_num )
     (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 );
 	}
@@ -689,7 +689,7 @@ lookup_address( int url_num )
 	    {
 	    (void) fprintf(
 		stderr, "%s - sockaddr too small (%lu < %lu)\n",
-		urls[url_num].hostname,
+		hostname,
 		(unsigned long) sizeof(urls[url_num].sa),
 		(unsigned long) aiv4->ai_addrlen );
 	    exit( 1 );
@@ -708,7 +708,7 @@ lookup_address( int url_num )
 	    {
 	    (void) fprintf(
 		stderr, "%s - sockaddr too small (%lu < %lu)\n",
-		urls[url_num].hostname,
+		hostname,
 		(unsigned long) sizeof(urls[url_num].sa),
 		(unsigned long) aiv6->ai_addrlen );
 	    exit( 1 );
@@ -724,15 +724,15 @@ lookup_address( int url_num )
 
     (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;