Switch received messages on the right header

This commit is contained in:
Milos Gajdos 2019-08-20 21:30:25 +01:00
parent a6e1287b27
commit 6c1f1d66f7
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F

View File

@ -140,12 +140,8 @@ func (n *network) process(client transport.Client) {
}
// switch on type of message and take action
switch m.Header["Micro-Tunnel"] {
case n.Router.Options().Id:
// NOTE: this should not happen
// skip local adverts
continue
default:
switch m.Header["Micro-Method"] {
case "advert":
pbAdvert := &pb.Advert{}
if err := proto.Unmarshal(m.Body, pbAdvert); err != nil {
continue