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

encode unknown protocol addresses as strings #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Gaboose
Copy link

@Gaboose Gaboose commented Feb 5, 2016

I can add new protocols from outside of this library with a line like

ma.AddProtocol(ma.Protocol{42, -1, "dns", ma.CodeToVarint(42)})

But it fails when I call NewMultiaddr("/dns/google.com"), because it doesn't know how to encode "google.com". What if you encode unknown protocol addresses of variable length as bare strings?

This change makes this library work.

@jbenet
Copy link
Member

jbenet commented Sep 16, 2016

we'd have to length prefix them, see how i proposed unix recently

marten-seemann pushed a commit to marten-seemann/go-multiaddr that referenced this pull request Feb 25, 2021
replace gx instructions with note about gomod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants