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

fix(p2p): issue #5523 #5529

Merged
merged 2 commits into from
Oct 18, 2018
Merged

fix(p2p): issue #5523 #5529

merged 2 commits into from
Oct 18, 2018

Conversation

overbool
Copy link
Contributor

Fixes: #5523

License: MIT
Signed-off-by: Overbool overbool.xu@gmail.com

@overbool
Copy link
Contributor Author

@Stebalien @Kubuxu Could u help me review it?

func checkPort(target ma.Multiaddr) error {
addr := target.String()
var sport string
if strings.Contains(addr, "tcp") {
Copy link
Member

@Kubuxu Kubuxu Sep 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing this I would use ValueForProtocol from Multiaddr
https://github.com/multiformats/go-multiaddr/blob/master/interface.go#L44
directly.

It will return ErrProtocolNotFound if there is no such protocol in multiaddr.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kubuxu I had modified it , could you help me review it again?

Copy link
Member

@magik6k magik6k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you try adding a sharenss case for this - https://github.com/ipfs/go-ipfs/blob/master/test/sharness/t0180-p2p.sh#L60-L80 + ipfs p2p ls?

core/commands/p2p.go Show resolved Hide resolved
if sport != "" {
return sport, nil
}
return "", fmt.Errorf("address does not contain tcp or udp protocol")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll want to support unix sockets in the future, but until that happens this can probably stay here

core/commands/p2p.go Show resolved Hide resolved
@overbool overbool force-pushed the fix/issue-#5523 branch 2 times, most recently from 9278867 to 1518873 Compare September 29, 2018 09:18
@overbool
Copy link
Contributor Author

@magik6k I had added test, could u help me review it?

License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
;wq
Signed-off-by: Overbool <overbool.xu@gmail.com>

License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
@overbool
Copy link
Contributor Author

overbool commented Oct 5, 2018

@magik6k @Stebalien I had resolved the conflict, could u help me review it?

@Kubuxu Kubuxu requested review from magik6k and Kubuxu October 5, 2018 06:51
@Stebalien Stebalien merged commit dd4d8bb into ipfs:master Oct 18, 2018
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.

4 participants