setDERPForcedWebsocket handles callbacks from the magicConn about DERP regions that are forced to use websockets (instead of Upgrade: derp). This information is for debugging only.
(region int, reason string)
| 157 | // setDERPForcedWebsocket handles callbacks from the magicConn about DERP regions that are forced to |
| 158 | // use websockets (instead of Upgrade: derp). This information is for debugging only. |
| 159 | func (u *nodeUpdater) setDERPForcedWebsocket(region int, reason string) { |
| 160 | u.L.Lock() |
| 161 | defer u.L.Unlock() |
| 162 | dirty := u.derpForcedWebsockets[region] != reason |
| 163 | u.derpForcedWebsockets[region] = reason |
| 164 | if dirty { |
| 165 | u.dirty = true |
| 166 | u.Broadcast() |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | // setStatus handles the status callback from the wireguard engine to learn about new endpoints |
| 171 | // (e.g. discovered by STUN). u.L MUST NOT be held |