just set 127.0.0.1 as localhost's IPv4 address (#258)

Motivation:

Previously we tried to use `host` to determine localhost's IPv4 address.
That didn't work reliably in Docker and sometimes on macOS. Let's just
fix this to 127.0.0.1.

Modifications:

Hardcode localhost's IPv4 address as 127.0.0.1.

Result:

More stable test_16_tcp_client_ip
This commit is contained in:
Johannes Weiß 2018-03-30 17:47:54 +01:00 committed by GitHub
parent fee0b6199e
commit ba470b7888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ function start_server() {
port="0"
tok_type=""
maybe_host="localhost"
maybe_nio_host="$(host -4 -t a "$maybe_host" | tr ' ' '\n' | tail -1)"
maybe_nio_host="127.0.0.1"
fi
mkdir "$tmp/htdocs"