denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.36k stars 5.36k forks source link

`listener.addr.path` is null when listening on unix abstract address #12306

Open ahabhgk opened 3 years ago

ahabhgk commented 3 years ago
let listener = Deno.listen({ path: "\0aaa", transport: "unix" });
console.log(listener.addr.path) // null

the as_pathname return Some(String) only when address kind is pathname address, otherwise it will return None.

https://github.com/denoland/deno/blob/79ac050d2917ddc1be97e458c8ac7c6a3d728269/extensions/net/ops.rs#L529

bnoordhuis commented 3 years ago

This is unfortunately not so easy to fix because it goes a few levels deep.

I've opened https://github.com/tokio-rs/mio/pull/1518 to get the appropriate API into mio, then tokio is up next.