Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
unix_socket: add support for abstract unix domain socket #1197
In addition to unix domain sockets, Linux also supports an
In order to support it, add new CURLOPT_ABSTRACT_UNIX_SOCKET
On non-supporting platforms, the abstract address will be
Also add new --abstract-unix-socket tool parameter.
Reported-by: Chungtsun Li (typeless)
Can you modify this to use url-escaped paths (and make this encoding requirement very clear in the docs)? That will correctly handle paths containing NUL bytes.
(As for alternatives:
@Lekensteyn that was my initial intention (see comments in #1061), however it got complicated in matter of design, usage and implementation.
In addition to unix domain sockets, Linux also supports an abstract namespace which is independent of the filesystem. In order to support it, add new CURLOPT_ABSTRACT_UNIX_SOCKET option which uses the same storage as CURLOPT_UNIX_SOCKET_PATH internally, along with a flag to specify abstract socket. On non-supporting platforms, the abstract address will be interpreted as an empty string and fail gracefully. Also add new --abstract-unix-socket tool parameter. Signed-off-by: Isaac Boukris <firstname.lastname@example.org> Reported-by: Chungtsun Li (typeless)
Lekensteyn left a comment
LGTM. I'll try to test the new functionality after the weekend and merge then.
(Hey, if you want to get your hands wet, maybe you can create another patch that extends the test suite with support for abstract domain sockets :-))