Commit 23ba0382 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/varnish-cache@2780 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 9a7ed902
......@@ -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
}
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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"
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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);
}
}
......
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