From: phk Date: Mon, 23 Jun 2008 16:49:48 +0000 (+0000) Subject: On FreeBSD at least "localhost" resolves to two address, one IPv4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb53ef0659e4618ed5b5b3b696004c6830919f1a;p=varnish On FreeBSD at least "localhost" resolves to two address, one IPv4 and one IPv6, resort to "127.0.0.1" git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2780 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishtest/tests/a00000.vtc b/varnish-cache/bin/varnishtest/tests/a00000.vtc index ff7bf054..555e1fde 100644 --- a/varnish-cache/bin/varnishtest/tests/a00000.vtc +++ b/varnish-cache/bin/varnishtest/tests/a00000.vtc @@ -2,14 +2,14 @@ test "basic default HTTP transactions" -server s1 -listen localhost:9080 { +server s1 -listen 127.0.0.1:9080 { rxreq txresp } server s1 -start -client c1 -connect localhost:9080 { +client c1 -connect 127.0.0.1:9080 { txreq rxresp } diff --git a/varnish-cache/bin/varnishtest/tests/a00001.vtc b/varnish-cache/bin/varnishtest/tests/a00001.vtc index 2e90b39c..5a7a5a78 100644 --- a/varnish-cache/bin/varnishtest/tests/a00001.vtc +++ b/varnish-cache/bin/varnishtest/tests/a00001.vtc @@ -2,7 +2,7 @@ test "basic default HTTP transactions with expect" -server s1 -listen localhost:9080 { +server s1 -listen 127.0.0.1:9080 { rxreq expect req.request == GET expect req.proto == HTTP/1.1 @@ -12,7 +12,7 @@ server s1 -listen localhost:9080 { server s1 -start -client c1 -connect localhost:9080 { +client c1 -connect 127.0.0.1:9080 { txreq rxresp expect resp.proto == HTTP/1.1 diff --git a/varnish-cache/bin/varnishtest/tests/a00002.vtc b/varnish-cache/bin/varnishtest/tests/a00002.vtc index 9d9da64c..03397f62 100644 --- a/varnish-cache/bin/varnishtest/tests/a00002.vtc +++ b/varnish-cache/bin/varnishtest/tests/a00002.vtc @@ -2,7 +2,7 @@ test "basic default HTTP transactions with expect and options" -server s1 -listen localhost:9080 { +server s1 -listen 127.0.0.1:9080 { rxreq expect req.request == PUT expect req.proto == HTTP/1.0 @@ -12,7 +12,7 @@ server s1 -listen localhost:9080 { server s1 -start -client c1 -connect localhost:9080 { +client c1 -connect 127.0.0.1:9080 { txreq -req PUT -proto HTTP/1.0 -url /foo rxresp expect resp.proto == HTTP/1.2 diff --git a/varnish-cache/bin/varnishtest/tests/a00003.vtc b/varnish-cache/bin/varnishtest/tests/a00003.vtc index 04f33a1c..9c9e5cf0 100644 --- a/varnish-cache/bin/varnishtest/tests/a00003.vtc +++ b/varnish-cache/bin/varnishtest/tests/a00003.vtc @@ -2,7 +2,7 @@ test "dual independent HTTP transactions" -server s1 -listen localhost:9080 { +server s1 -listen 127.0.0.1:9080 { rxreq expect req.request == PUT expect req.proto == HTTP/1.0 @@ -10,7 +10,7 @@ server s1 -listen localhost:9080 { txresp -proto HTTP/1.2 -status 201 -msg Foo } -server s2 -listen localhost:9081 { +server s2 -listen 127.0.0.1:9081 { rxreq expect req.request == GET expect req.proto == HTTP/1.1 @@ -21,7 +21,7 @@ server s2 -listen localhost:9081 { server s1 -start server s2 -start -client c1 -connect localhost:9080 { +client c1 -connect 127.0.0.1:9080 { txreq -req PUT -proto HTTP/1.0 -url /foo rxresp expect resp.proto == HTTP/1.2 @@ -29,7 +29,7 @@ client c1 -connect localhost:9080 { expect resp.msg == Foo } -client c2 -connect localhost:9081 { +client c2 -connect 127.0.0.1:9081 { txreq rxresp expect resp.proto == HTTP/1.1 diff --git a/varnish-cache/bin/varnishtest/tests/a00004.vtc b/varnish-cache/bin/varnishtest/tests/a00004.vtc index 5f219c4e..1acaac88 100644 --- a/varnish-cache/bin/varnishtest/tests/a00004.vtc +++ b/varnish-cache/bin/varnishtest/tests/a00004.vtc @@ -2,7 +2,7 @@ test "dual shared server HTTP transactions" -server s1 -listen localhost:9080 -repeat 2 { +server s1 -listen 127.0.0.1:9080 -repeat 2 { rxreq expect req.request == PUT expect req.proto == HTTP/1.0 @@ -12,7 +12,7 @@ server s1 -listen localhost:9080 -repeat 2 { server s1 -start -client c1 -connect localhost:9080 { +client c1 -connect 127.0.0.1:9080 { txreq -req PUT -proto HTTP/1.0 -url /foo rxresp expect resp.proto == HTTP/1.2 @@ -20,7 +20,7 @@ client c1 -connect localhost:9080 { expect resp.msg == Foo } -client c2 -connect localhost:9080 { +client c2 -connect 127.0.0.1:9080 { txreq -req PUT -proto HTTP/1.0 -url /foo rxresp expect resp.proto == HTTP/1.2 diff --git a/varnish-cache/bin/varnishtest/tests/a00005.vtc b/varnish-cache/bin/varnishtest/tests/a00005.vtc index a4192a83..4a5a2ce2 100644 --- a/varnish-cache/bin/varnishtest/tests/a00005.vtc +++ b/varnish-cache/bin/varnishtest/tests/a00005.vtc @@ -2,7 +2,7 @@ test "dual shared client HTTP transactions" -server s1 -listen localhost:9080 { +server s1 -listen 127.0.0.1:9080 { rxreq expect req.request == PUT expect req.proto == HTTP/1.0 @@ -10,7 +10,7 @@ server s1 -listen localhost:9080 { txresp -proto HTTP/1.2 -status 201 -msg Foo } -server s2 -listen localhost:9081 { +server s2 -listen 127.0.0.1:9081 { rxreq expect req.request == GET expect req.proto == HTTP/1.1 @@ -21,7 +21,7 @@ server s2 -listen localhost:9081 { server s1 -start server s2 -start -client c1 -connect localhost:9080 { +client c1 -connect 127.0.0.1:9080 { txreq -req PUT -proto HTTP/1.0 -url /foo rxresp expect resp.proto == HTTP/1.2 @@ -31,7 +31,7 @@ client c1 -connect localhost:9080 { client c1 -run -client c1 -connect localhost:9081 { +client c1 -connect 127.0.0.1:9081 { txreq rxresp expect resp.proto == HTTP/1.1 diff --git a/varnish-cache/bin/varnishtest/tests/a00006.vtc b/varnish-cache/bin/varnishtest/tests/a00006.vtc index 94532b25..6af785a4 100644 --- a/varnish-cache/bin/varnishtest/tests/a00006.vtc +++ b/varnish-cache/bin/varnishtest/tests/a00006.vtc @@ -2,7 +2,7 @@ test "bidirectional message bodies" -server s1 -listen localhost:9080 { +server s1 -listen 127.0.0.1:9080 { rxreq expect req.request == PUT expect req.proto == HTTP/1.0 @@ -14,7 +14,7 @@ server s1 -listen localhost:9080 { server s1 -start -client c1 -connect localhost:9080 { +client c1 -connect 127.0.0.1:9080 { txreq -req PUT -proto HTTP/1.0 -url /foo \ -hdr "Content-Length: 10" \ -body "123456789\n" diff --git a/varnish-cache/bin/varnishtest/tests/a00007.vtc b/varnish-cache/bin/varnishtest/tests/a00007.vtc index 629f4811..5040ae98 100644 --- a/varnish-cache/bin/varnishtest/tests/a00007.vtc +++ b/varnish-cache/bin/varnishtest/tests/a00007.vtc @@ -2,7 +2,7 @@ test "TCP reuse" -server s1 -listen localhost:9080 { +server s1 -listen 127.0.0.1:9080 { rxreq expect req.url == "/1" txresp -hdr "Content-Length: 10" -body "123456789\n" @@ -13,7 +13,7 @@ server s1 -listen localhost:9080 { server s1 -start -client c1 -connect localhost:9080 { +client c1 -connect 127.0.0.1:9080 { txreq -url "/1" -req "POST" \ -hdr "Content-Length: 10" -body "abcdefghi\n" rxresp diff --git a/varnish-cache/bin/varnishtest/tests/b00000.vtc b/varnish-cache/bin/varnishtest/tests/b00000.vtc index fcdf1b27..f9f9e679 100644 --- a/varnish-cache/bin/varnishtest/tests/b00000.vtc +++ b/varnish-cache/bin/varnishtest/tests/b00000.vtc @@ -2,7 +2,7 @@ # # $Id$ -varnish v1 -arg "-b localhost:9080" -start +varnish v1 -arg "-b 127.0.0.1:9080" -start server s1 { rxreq diff --git a/varnish-cache/bin/varnishtest/tests/c00002.vtc b/varnish-cache/bin/varnishtest/tests/c00002.vtc index 954b0c1e..ebcc6021 100644 --- a/varnish-cache/bin/varnishtest/tests/c00002.vtc +++ b/varnish-cache/bin/varnishtest/tests/c00002.vtc @@ -4,7 +4,7 @@ test "Check that multiple thread pools all get started" -varnish v1 -arg "-b localhost:9080 -p thread_pools=9" -start +varnish v1 -arg "-b 127.0.0.1:9080 -p thread_pools=9" -start server s1 { rxreq diff --git a/varnish-cache/bin/varnishtest/vtc_server.c b/varnish-cache/bin/varnishtest/vtc_server.c index 2834cbf9..71ed0534 100644 --- a/varnish-cache/bin/varnishtest/vtc_server.c +++ b/varnish-cache/bin/varnishtest/vtc_server.c @@ -120,7 +120,7 @@ server_new(char *name) vtc_log(s->vl, 0, "Server name must start with 's'"); exit (1); } - s->listen = "localhost:9080"; + s->listen = "127.0.0.1:9080"; AZ(VSS_parse(s->listen, &s->addr, &s->port)); s->repeat = 1; s->depth = 1; @@ -192,7 +192,7 @@ cmd_server_genvcl(struct vsb *vsb) vsb_printf(vsb, "backend %s { .host = \"%s\"; .port = \"%s\"; }\n", s->name, - s->addr == NULL ? "localhost" : s->addr, + s->addr == NULL ? "127.0.0.1" : s->addr, s->port); } }