Cleanup and speedup network convergence along with direct messaging for connect and solicit
This commit is contained in:
@@ -799,7 +799,8 @@ func (r *router) flushRouteEvents(evType EventType) ([]*Event, error) {
|
||||
|
||||
// build a list of events to advertise
|
||||
events := make([]*Event, len(bestRoutes))
|
||||
i := 0
|
||||
var i int
|
||||
|
||||
for _, route := range bestRoutes {
|
||||
event := &Event{
|
||||
Type: evType,
|
||||
@@ -823,9 +824,10 @@ func (r *router) Solicit() error {
|
||||
|
||||
// advertise the routes
|
||||
r.advertWg.Add(1)
|
||||
|
||||
go func() {
|
||||
defer r.advertWg.Done()
|
||||
r.publishAdvert(RouteUpdate, events)
|
||||
r.publishAdvert(Solicitation, events)
|
||||
r.advertWg.Done()
|
||||
}()
|
||||
|
||||
return nil
|
||||
|
@@ -111,6 +111,8 @@ const (
|
||||
Announce AdvertType = iota
|
||||
// RouteUpdate advertises route updates
|
||||
RouteUpdate
|
||||
// Solicitation indicates routes were solicited
|
||||
Solicitation
|
||||
)
|
||||
|
||||
// String returns human readable advertisement type
|
||||
@@ -120,6 +122,8 @@ func (t AdvertType) String() string {
|
||||
return "announce"
|
||||
case RouteUpdate:
|
||||
return "update"
|
||||
case Solicitation:
|
||||
return "solicitation"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
|
Reference in New Issue
Block a user