TUN-3777: Fix /ready endpoint for classic tunnels

Classic tunnels flow was triggering an event for RegisteringTunnel for
every connection that was about to be established, and then a Connected
event for every connection established.

However, the RegistreringTunnel event had no connection ID, always
causing it to unset/disconnect the 0th connection making the /ready
endpoint report incorrect numbers for classic tunnels.
This commit is contained in:
Nuno Diegues
2021-01-19 12:20:11 +00:00
parent ffac598fab
commit 2d0b86f2e4
5 changed files with 18 additions and 9 deletions

View File

@@ -99,8 +99,8 @@ func trialZoneMsg(url string) []string {
}
}
func (o *Observer) sendRegisteringEvent() {
o.sendEvent(Event{EventType: RegisteringTunnel})
func (o *Observer) sendRegisteringEvent(connIndex uint8) {
o.sendEvent(Event{Index: connIndex, EventType: RegisteringTunnel})
}
func (o *Observer) sendConnectedEvent(connIndex uint8, location string) {