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 on type of message and take action
switch m.Header["Micro-Tunnel"] { switch m.Header["Micro-Method"] {
case n.Router.Options().Id: case "advert":
// NOTE: this should not happen
// skip local adverts
continue
default:
pbAdvert := &pb.Advert{} pbAdvert := &pb.Advert{}
if err := proto.Unmarshal(m.Body, pbAdvert); err != nil { if err := proto.Unmarshal(m.Body, pbAdvert); err != nil {
continue continue