Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
fix redirection bug in edgec
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehsan N. Moosa committed Sep 7, 2021
1 parent 5f44e01 commit 26675d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions edgec/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ func (ws *Websocket) redirect(x *rony.Redirect) (replicaSet uint64) {
)
}

if len(x.Edges) == 0 {
return
}

for _, n := range x.Edges {
ws.addConn(
n.ServerID, n.ReplicaSet,
Expand All @@ -342,6 +346,8 @@ func (ws *Websocket) redirect(x *rony.Redirect) (replicaSet uint64) {
default:
}

replicaSet = x.Edges[0].ReplicaSet

return
}

Expand Down

0 comments on commit 26675d0

Please sign in to comment.