Commit f9650a79 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet Committed by Brian Tiger Chow

allow service to have nil handler

@perfmode this means we can create a Service first, give it to
the network and protocol (removing interdep).
parent 5426a1b5
......@@ -161,6 +161,11 @@ func (s *Service) handleIncomingMessage(ctx context.Context, m msg.NetMessage) {
// if it's a request (or has no RequestID), handle it
if rid == nil || rid.IsRequest() {
if s.Handler == nil {
u.PErr("service dropped msg: %v\n", m)
return // no handler, drop it.
}
r1, err := s.Handler.HandleMessage(ctx, m2)
if err != nil {
u.PErr("handled message yielded error %v\n", err)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment