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

go client bug: There are no all transport protocols in the process space #80

Open
lnykww opened this issue Mar 7, 2019 · 4 comments
Open

Comments

@lnykww
Copy link
Contributor

lnykww commented Mar 7, 2019

For example with CIRCUIT transport , the convertStreamInfo return error("no protocol with code 290"). Now I fix it by import circuit packge in client process sapce.
how about if daemon process return the string of addr and protocol to client?

@lnykww
Copy link
Contributor Author

lnykww commented Mar 9, 2019

ping @vyzo

@vyzo
Copy link
Collaborator

vyzo commented Mar 10, 2019

@bigs maintains the client.

@bigs
Copy link
Contributor

bigs commented Mar 10, 2019

hmm can you give me steps to reproduce this or propose a patch? definitely down to fix this, just not fully sure i understand

@lnykww
Copy link
Contributor Author

lnykww commented Mar 11, 2019

The protocol needs to be added to the multiaddr's protocol list by calling AddProtocol. for the circuit protocol, it was added during the init phase:

 var Protocol = ma.Protocol{
     Code:  P_CIRCUIT,
     Size:  0,
     Name:  "p2p-circuit",
     VCode: ma.CodeToVarint(P_CIRCUIT),
 }
func init() {
     ma.AddProtocol(Protocol)
 }

But in go client, there is no need to import the circuit package, so the circuit protocol would not to be added to the protocol list.

so when client call convertStreamInfo to parse multiaddr, there was no circuit protocol in the list:

func convertStreamInfo(info *pb.StreamInfo) (*StreamInfo, error) {
      ...
     addr, err := ma.NewMultiaddrBytes(info.Addr)
     ...
 }

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

No branches or pull requests

3 participants