-
Notifications
You must be signed in to change notification settings - Fork 87
Specify /unix. Add /unix-abstract. Add /stream, /seqpacket, /dgram #179
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
base: master
Are you sure you want to change the base?
Changes from all commits
b690498
ecea346
66e6ffb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| # `unix` | ||||||
|
|
||||||
| This protocol encodes a Unix domain socket path to a resource. In the string | ||||||
| This protocol encodes a Unix-domain socket path to a resource. In the string | ||||||
| representation, the path is encoded in a way consistent with a single URI Path | ||||||
| segment per [RFC 3986 Section 3.3](https://datatracker.ietf.org/doc/html/rfc3986#autoid-23). | ||||||
|
|
||||||
|
|
@@ -10,6 +10,9 @@ representation, no encoding is needed as the value is length prefixed. | |||||
| When comparing multiaddrs, implementations should compare their binary | ||||||
| representation to avoid ambiguities over which characters were escaped. | ||||||
|
|
||||||
| The absence of a `/` character at the start of the decoded address indicates a | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| relative path, otherwise the path is absolute. | ||||||
|
|
||||||
| ## Examples | ||||||
|
|
||||||
| The following is a table of examples converting some common Unix paths to their | ||||||
|
|
@@ -33,5 +36,29 @@ Multiaddr string form. | |||||
| appear anywhere, for example in the case where we route through some sort of | ||||||
| proxy server or SSH tunnel. | ||||||
|
|
||||||
| The absence of a `/` character at the start of the decoded address indicates a | ||||||
| relative path, otherwise the path is absolute. | ||||||
|
Comment on lines
-36
to
-37
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These lines may have been removed by accident? They should probably remain in.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. applied |
||||||
| # `unix-abstract` | ||||||
|
|
||||||
| This protocol encodes a Linux Unix-domain abstract socket address, | ||||||
| which are distinguished by their first byte being 0. | ||||||
| It is encoded the same way as `unix`; | ||||||
| the marker byte is not part of the path. | ||||||
|
Comment on lines
+39
to
+44
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The spec should have clear rationale why separate namespace is used instead of putting That being said, @nabijaczleweli @achingbrain apologies if this was discussed elsewhere, but why are we adding second namespace and not encode the first byte explicitly? for example, instead
could we just prefix
Any downside to doing this and removing |
||||||
|
|
||||||
| ## Examples | ||||||
|
|
||||||
| In the following table, the address column follows the userspace convention | ||||||
| of 0 bytes in the address being rendered as an `@` for abstract addresses | ||||||
| for display only. | ||||||
|
|
||||||
| | Rendered Address | multiaddr string form | | ||||||
| | -------------------------------------------- | ------------------------------------------------------------------ | | ||||||
| | @f87a1c847a4ecaf3/bus/systemd/bus-api-system | `/unix-abstract/f87a1c847a4ecaf3%2Fbus%2Fsystemd%2Fbus-api-system` | | ||||||
| | @/run/fsid.sock@@@@@@@@@@@@@@@@@@@@@@@@@@... | `/unix-abstract/%2Frun%2Ffsid.sock%00%00%00%00%00%00%00%00%00...` | | ||||||
|
|
||||||
| # `stream`, `seqpacket`, `dgram` | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: these are generic terms exist outside of unix sockets (streams are very generic, datagrams also), would it be better to keep prefix |
||||||
|
|
||||||
| These correspond to the *type* of Unix-domain socket: | ||||||
| `SOCK_STREAM`, `SOCK_SEQPACKET`, `SOCK_DGRAM`. | ||||||
|
Comment on lines
+57
to
+60
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Usage position unclear: Where do these appear in a multiaddr? After |
||||||
|
|
||||||
| Previous versions of this specification did not contain these types; | ||||||
| for compatibility, their absence should not indicate an error, | ||||||
| if a default makes sense when decoding. | ||||||
|
Comment on lines
+62
to
+64
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Default behavior underspecified: The doc says "their absence should not indicate an error, if a default makes sense when decoding" but doesn't specify what the default should be. Document that SOCK_STREAM should be assumed when no type is present? This brings the other gap, use case not documented: Why would someone need to specify socket type at the multiaddr level? Most Unix socket usage is SOCK_STREAM. What's the practical scenario requiring SOCK_SEQPACKET or SOCK_DGRAM in a multiaddr? |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nabijaczleweli these seem to be one-off.
multiformats/multicodec#382 uses 402-404, this uses 403-405, need to be unified and i assume we dont want a gap so this PR should be
?