Commit ef5a0755 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

On FreeBSD at least "localhost" resolves to two address, one IPv4

and one IPv6, resort to "127.0.0.1"



git-svn-id: http://www.varnish-cache.org/svn/trunk@2780 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 529cd40a
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
test "basic default HTTP transactions" test "basic default HTTP transactions"
server s1 -listen localhost:9080 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
txresp txresp
} }
server s1 -start server s1 -start
client c1 -connect localhost:9080 { client c1 -connect 127.0.0.1:9080 {
txreq txreq
rxresp rxresp
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "basic default HTTP transactions with expect" test "basic default HTTP transactions with expect"
server s1 -listen localhost:9080 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
expect req.request == GET expect req.request == GET
expect req.proto == HTTP/1.1 expect req.proto == HTTP/1.1
...@@ -12,7 +12,7 @@ server s1 -listen localhost:9080 { ...@@ -12,7 +12,7 @@ server s1 -listen localhost:9080 {
server s1 -start server s1 -start
client c1 -connect localhost:9080 { client c1 -connect 127.0.0.1:9080 {
txreq txreq
rxresp rxresp
expect resp.proto == HTTP/1.1 expect resp.proto == HTTP/1.1
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "basic default HTTP transactions with expect and options" test "basic default HTTP transactions with expect and options"
server s1 -listen localhost:9080 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
expect req.request == PUT expect req.request == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
...@@ -12,7 +12,7 @@ server s1 -listen localhost:9080 { ...@@ -12,7 +12,7 @@ server s1 -listen localhost:9080 {
server s1 -start 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 txreq -req PUT -proto HTTP/1.0 -url /foo
rxresp rxresp
expect resp.proto == HTTP/1.2 expect resp.proto == HTTP/1.2
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "dual independent HTTP transactions" test "dual independent HTTP transactions"
server s1 -listen localhost:9080 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
expect req.request == PUT expect req.request == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
...@@ -10,7 +10,7 @@ server s1 -listen localhost:9080 { ...@@ -10,7 +10,7 @@ server s1 -listen localhost:9080 {
txresp -proto HTTP/1.2 -status 201 -msg Foo txresp -proto HTTP/1.2 -status 201 -msg Foo
} }
server s2 -listen localhost:9081 { server s2 -listen 127.0.0.1:9081 {
rxreq rxreq
expect req.request == GET expect req.request == GET
expect req.proto == HTTP/1.1 expect req.proto == HTTP/1.1
...@@ -21,7 +21,7 @@ server s2 -listen localhost:9081 { ...@@ -21,7 +21,7 @@ server s2 -listen localhost:9081 {
server s1 -start server s1 -start
server s2 -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 txreq -req PUT -proto HTTP/1.0 -url /foo
rxresp rxresp
expect resp.proto == HTTP/1.2 expect resp.proto == HTTP/1.2
...@@ -29,7 +29,7 @@ client c1 -connect localhost:9080 { ...@@ -29,7 +29,7 @@ client c1 -connect localhost:9080 {
expect resp.msg == Foo expect resp.msg == Foo
} }
client c2 -connect localhost:9081 { client c2 -connect 127.0.0.1:9081 {
txreq txreq
rxresp rxresp
expect resp.proto == HTTP/1.1 expect resp.proto == HTTP/1.1
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "dual shared server HTTP transactions" test "dual shared server HTTP transactions"
server s1 -listen localhost:9080 -repeat 2 { server s1 -listen 127.0.0.1:9080 -repeat 2 {
rxreq rxreq
expect req.request == PUT expect req.request == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
...@@ -12,7 +12,7 @@ server s1 -listen localhost:9080 -repeat 2 { ...@@ -12,7 +12,7 @@ server s1 -listen localhost:9080 -repeat 2 {
server s1 -start 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 txreq -req PUT -proto HTTP/1.0 -url /foo
rxresp rxresp
expect resp.proto == HTTP/1.2 expect resp.proto == HTTP/1.2
...@@ -20,7 +20,7 @@ client c1 -connect localhost:9080 { ...@@ -20,7 +20,7 @@ client c1 -connect localhost:9080 {
expect resp.msg == Foo 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 txreq -req PUT -proto HTTP/1.0 -url /foo
rxresp rxresp
expect resp.proto == HTTP/1.2 expect resp.proto == HTTP/1.2
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "dual shared client HTTP transactions" test "dual shared client HTTP transactions"
server s1 -listen localhost:9080 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
expect req.request == PUT expect req.request == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
...@@ -10,7 +10,7 @@ server s1 -listen localhost:9080 { ...@@ -10,7 +10,7 @@ server s1 -listen localhost:9080 {
txresp -proto HTTP/1.2 -status 201 -msg Foo txresp -proto HTTP/1.2 -status 201 -msg Foo
} }
server s2 -listen localhost:9081 { server s2 -listen 127.0.0.1:9081 {
rxreq rxreq
expect req.request == GET expect req.request == GET
expect req.proto == HTTP/1.1 expect req.proto == HTTP/1.1
...@@ -21,7 +21,7 @@ server s2 -listen localhost:9081 { ...@@ -21,7 +21,7 @@ server s2 -listen localhost:9081 {
server s1 -start server s1 -start
server s2 -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 txreq -req PUT -proto HTTP/1.0 -url /foo
rxresp rxresp
expect resp.proto == HTTP/1.2 expect resp.proto == HTTP/1.2
...@@ -31,7 +31,7 @@ client c1 -connect localhost:9080 { ...@@ -31,7 +31,7 @@ client c1 -connect localhost:9080 {
client c1 -run client c1 -run
client c1 -connect localhost:9081 { client c1 -connect 127.0.0.1:9081 {
txreq txreq
rxresp rxresp
expect resp.proto == HTTP/1.1 expect resp.proto == HTTP/1.1
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "bidirectional message bodies" test "bidirectional message bodies"
server s1 -listen localhost:9080 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
expect req.request == PUT expect req.request == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
...@@ -14,7 +14,7 @@ server s1 -listen localhost:9080 { ...@@ -14,7 +14,7 @@ server s1 -listen localhost:9080 {
server s1 -start 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 \ txreq -req PUT -proto HTTP/1.0 -url /foo \
-hdr "Content-Length: 10" \ -hdr "Content-Length: 10" \
-body "123456789\n" -body "123456789\n"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "TCP reuse" test "TCP reuse"
server s1 -listen localhost:9080 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
expect req.url == "/1" expect req.url == "/1"
txresp -hdr "Content-Length: 10" -body "123456789\n" txresp -hdr "Content-Length: 10" -body "123456789\n"
...@@ -13,7 +13,7 @@ server s1 -listen localhost:9080 { ...@@ -13,7 +13,7 @@ server s1 -listen localhost:9080 {
server s1 -start server s1 -start
client c1 -connect localhost:9080 { client c1 -connect 127.0.0.1:9080 {
txreq -url "/1" -req "POST" \ txreq -url "/1" -req "POST" \
-hdr "Content-Length: 10" -body "abcdefghi\n" -hdr "Content-Length: 10" -body "abcdefghi\n"
rxresp rxresp
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# $Id$ # $Id$
varnish v1 -arg "-b localhost:9080" -start varnish v1 -arg "-b 127.0.0.1:9080" -start
server s1 { server s1 {
rxreq rxreq
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
test "Check that multiple thread pools all get started" 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 { server s1 {
rxreq rxreq
......
...@@ -120,7 +120,7 @@ server_new(char *name) ...@@ -120,7 +120,7 @@ server_new(char *name)
vtc_log(s->vl, 0, "Server name must start with 's'"); vtc_log(s->vl, 0, "Server name must start with 's'");
exit (1); exit (1);
} }
s->listen = "localhost:9080"; s->listen = "127.0.0.1:9080";
AZ(VSS_parse(s->listen, &s->addr, &s->port)); AZ(VSS_parse(s->listen, &s->addr, &s->port));
s->repeat = 1; s->repeat = 1;
s->depth = 1; s->depth = 1;
...@@ -192,7 +192,7 @@ cmd_server_genvcl(struct vsb *vsb) ...@@ -192,7 +192,7 @@ cmd_server_genvcl(struct vsb *vsb)
vsb_printf(vsb, vsb_printf(vsb,
"backend %s { .host = \"%s\"; .port = \"%s\"; }\n", "backend %s { .host = \"%s\"; .port = \"%s\"; }\n",
s->name, s->name,
s->addr == NULL ? "localhost" : s->addr, s->addr == NULL ? "127.0.0.1" : s->addr,
s->port); s->port);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment