@@ -122,7 +122,7 @@ func (router *WshRouter) SendEvent(routeId string, event wps.WaveEvent) {
122122 // nothing to do
123123 return
124124 }
125- rpc .SendRpcMessage (msgBytes )
125+ rpc .SendRpcMessage (msgBytes , "eventrecv" )
126126}
127127
128128func (router * WshRouter ) handleNoRoute (msg RpcMessage ) {
@@ -173,7 +173,7 @@ func (router *WshRouter) handleAnnounceMessage(msg RpcMessage, input msgAndRoute
173173 // if we don't (we are the terminal router), then add it to our announced route map
174174 upstream := router .GetUpstreamClient ()
175175 if upstream != nil {
176- upstream .SendRpcMessage (input .msgBytes )
176+ upstream .SendRpcMessage (input .msgBytes , "announce-upstream" )
177177 return
178178 }
179179 if msg .Source == input .fromRouteId {
@@ -201,12 +201,12 @@ func (router *WshRouter) getAnnouncedRoute(routeId string) string {
201201func (router * WshRouter ) sendRoutedMessage (msgBytes []byte , routeId string ) bool {
202202 rpc := router .GetRpc (routeId )
203203 if rpc != nil {
204- rpc .SendRpcMessage (msgBytes )
204+ rpc .SendRpcMessage (msgBytes , "route" )
205205 return true
206206 }
207207 upstream := router .GetUpstreamClient ()
208208 if upstream != nil {
209- upstream .SendRpcMessage (msgBytes )
209+ upstream .SendRpcMessage (msgBytes , "route-upstream" )
210210 return true
211211 } else {
212212 // we are the upstream, so consult our announced routes map
@@ -216,7 +216,7 @@ func (router *WshRouter) sendRoutedMessage(msgBytes []byte, routeId string) bool
216216 log .Printf ("[router] no rpc for route id %q\n " , routeId )
217217 return false
218218 }
219- rpc .SendRpcMessage (msgBytes )
219+ rpc .SendRpcMessage (msgBytes , "route-local" )
220220 return true
221221 }
222222}
@@ -321,7 +321,7 @@ func (router *WshRouter) RegisterRoute(routeId string, rpc AbstractRpcClient, sh
321321 if shouldAnnounce && ! alreadyExists && router .GetUpstreamClient () != nil {
322322 announceMsg := RpcMessage {Command : wshrpc .Command_RouteAnnounce , Source : routeId }
323323 announceBytes , _ := json .Marshal (announceMsg )
324- router .GetUpstreamClient ().SendRpcMessage (announceBytes )
324+ router .GetUpstreamClient ().SendRpcMessage (announceBytes , "route-announce" )
325325 }
326326 for {
327327 msgBytes , ok := rpc .RecvRpcMessage ()
0 commit comments