Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpServer fails to work with Unix sockets #45977

Closed
robert-ancell opened this issue May 10, 2021 · 1 comment
Closed

HttpServer fails to work with Unix sockets #45977

robert-ancell opened this issue May 10, 2021 · 1 comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-_http

Comments

@robert-ancell
Copy link
Contributor

Creating an HttpServer with a Unix socket fails to accept connection, due to attempting to set the TCP_NO_DELAY socket option on the sockets, which is not supported for this socket type.

e.g.

var server = await HttpServer.bind(InternetAddress('/tmp/test-socket', type: InternetAddressType.unix), 0);
server.listen((request) {
  print(request.method);
});

Connecting using an HTTP client...

curl --unix-socket /tmp/test-socket http://localhost/

...causes the server to hit an exception:

Unhandled exception:
OS Error: Operation not supported, errno = 95

Note that this exception only occurs with a fix to Socket.setOption, since it currently hits an assertion with Unix sockets.

robert-ancell added a commit to robert-ancell/dart-sdk that referenced this issue May 10, 2021
This is not supported for this socket type and will generate a "Operation not supported" exception.

Fixes dart-lang#45977
@mit-mit mit-mit added library-_http area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels May 11, 2021
@a-siva
Copy link
Contributor

a-siva commented May 13, 2021

Please see https://dart-review.googlesource.com/c/sdk/+/199640 for a potential fix to the problem along with the test case you mention above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-_http
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants