Fixes nc on macOS not closing socket when the stdin sends EOF

Uses `-d` option that is supported both by BSD and GNU nc.

License: MIT
Signed-off-by: default avatarJakub Sztandera <kubuxu@protonmail.ch>
parent 9e8d108a
...@@ -11,7 +11,9 @@ test_description="test http requests made by cli" ...@@ -11,7 +11,9 @@ test_description="test http requests made by cli"
test_init_ipfs test_init_ipfs
test_expect_success "can make http request against nc server" ' test_expect_success "can make http request against nc server" '
go-sleep 0.5s | nc -l 5005 > nc_out & nc -ld 5005 > nc_out &
NCPID=$!
go-sleep 0.5s && kill "$NCPID" &
ipfs cat /ipfs/Qmabcdef --api /ip4/127.0.0.1/tcp/5005 || true ipfs cat /ipfs/Qmabcdef --api /ip4/127.0.0.1/tcp/5005 || true
' '
......
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