frps: fix a panic bug caused by reading map

This commit is contained in:
fatedier committed 2016-12-20 01:30:10 +08:00
1 parent d7d2b72431
commit 52fe721202
2 files changed
+9 -2

No files matched your search

+7
View File
@@ -392,3 +392,10 @@ func DeleteProxy(proxyName string) {
defer ProxyServersMutex.Unlock()
delete(ProxyServers, proxyName)
}
func GetProxyServer(proxyName string) (p *ProxyServer, ok bool) {
ProxyServersMutex.RLock()
defer ProxyServersMutex.RUnlock()
p, ok = ProxyServers[proxyName]
return
}