Skip to content

Commit 605af28

Browse files
committed
Avoid race condition
1 parent ca80e7e commit 605af28

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

service/hub.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,10 @@ func (h *connectionsHub) UnpairRemoteService(ski string) error {
519519
func (h *connectionsHub) ReportMdnsEntries(entries map[string]MdnsEntry) {
520520
h.muxMdns.Lock()
521521
defer h.muxMdns.Unlock()
522-
for ski, entry := range entries {
522+
523+
mdnsEntries := entries
524+
525+
for ski, entry := range mdnsEntries {
523526
// check if this ski is already connected
524527
if h.isSkiConnected(ski) {
525528
continue

0 commit comments

Comments
 (0)