Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

weave connect for a known peer should act immediately #1714

Closed
bboreham opened this issue Nov 24, 2015 · 6 comments
Closed

weave connect for a known peer should act immediately #1714

bboreham opened this issue Nov 24, 2015 · 6 comments
Assignees
Milestone

Comments

@bboreham
Copy link
Contributor

Although #499 was closed, my recent observations say it isn't working now.

@bboreham
Copy link
Contributor Author

The reason it isn't working, in my case, is that cm.targets has an entry 192.168.48.11:6783 but the code is looking for 192.168.48.11:0

@rade
Copy link
Member

rade commented Nov 24, 2015

Ah, I was wondering whether that is the problem. There's code in checkStateAndAttemptConnections that constructs a completeAddr that we should probably (re)use here.

@bboreham bboreham self-assigned this Nov 24, 2015
@bboreham
Copy link
Contributor Author

The code in checkStateAndAttemptConnections is using a cached copy of ourInboundIPs; are you saying InitiateConnection should re-compute the connections?

I could argue that check is inappropriate if the user has told us to connect to that address.

@rade
Copy link
Member

rade commented Nov 24, 2015

that part of the is irrelevant to the completeAddr computation.

@bboreham
Copy link
Contributor Author

Well, yes, but the code gets about twice as big if you have to repeat the if-statement. It isn't a great example of code re-use.

@rade
Copy link
Member

rade commented Nov 24, 2015

to be precise, I think this is the code you want:

        completeAddr := *addr
        if completeAddr.Port == 0 {
            completeAddr.Port = cm.port
        }
        address := completeAddr.String()

@rade rade added this to the 1.3.2 milestone Nov 24, 2015
awh added a commit that referenced this issue Nov 30, 2015
Ensure `weave connect` attempts connection immediately
@awh awh modified the milestones: 1.3.2, 1.4.0 Dec 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants