zrhoffman commented on code in PR #7302:
URL: https://github.com/apache/trafficcontrol/pull/7302#discussion_r1147848462


##########
traffic_monitor/todata/todata.go:
##########
@@ -179,6 +187,10 @@ func (d TODataThreadsafe) Update(to 
towrap.TrafficOpsSessionThreadsafe, cdn stri
                return fmt.Errorf("getting server types from monitoring config: 
%v", err)
        }
 
+       if val, ok := mc.Config["tm.sameipservers.control"]; ok && val.(string) 
== "true" {
+               newTOData.SameIpServers = getSameIPServers(mc)
+       }

Review Comment:
   If the condition is false, `newTOData.SameIpServers` will be `nil`, so 
should be an `else` here creating an empty map.



##########
traffic_monitor/datareq/crstate.go:
##########
@@ -58,16 +62,17 @@ func srvTRState(
                }
        }
 
-       data, err := srvTRStateDerived(combinedStates, local && 
distributedPollingEnabled)
+       data, err := srvTRStateDerived(combinedStates, local && 
distributedPollingEnabled, toData)
 
        return data, http.StatusOK, err
 }
 
-func srvTRStateDerived(combinedStates peer.CRStatesThreadsafe, 
directlyPolledOnly bool) ([]byte, error) {
+func srvTRStateDerived(combinedStates peer.CRStatesThreadsafe, 
directlyPolledOnly bool, toData todata.TODataThreadsafe) ([]byte, error) {
        if !directlyPolledOnly {
-               return tc.CRStatesMarshall(combinedStates.Get())
+               combinedStatesC := updateStatusSameIpServers(combinedStates, 
toData)

Review Comment:
   This should only be checked if `tm.sameipservers.control` is `true`, right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to