File tree Expand file tree Collapse file tree
internal/certificatetransparency Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,10 +23,8 @@ import (
2323var (
2424 processedCerts int64
2525 processedPrecerts int64
26- urlMapMutex sync.Mutex
26+ urlMapMutex sync.RWMutex
2727 urlMap = make (map [string ]int64 )
28- ownerMapMutex sync.Mutex
29- ownerMap = make (map [string ]int64 )
3028)
3129
3230func GetProcessedCerts () int64 {
@@ -38,13 +36,23 @@ func GetProcessedPrecerts() int64 {
3836}
3937
4038func GetCertCountForLog (logname string ) int64 {
41- urlMapMutex .Lock ()
42- defer urlMapMutex .Unlock ()
39+ urlMapMutex .RLock ()
40+ defer urlMapMutex .RUnlock ()
4341 return urlMap [logname ]
4442}
4543
46- func GetLogs () map [string ]int64 {
47- return urlMap
44+ func GetLogs () []string {
45+ urlMapMutex .RLock ()
46+ defer urlMapMutex .RUnlock ()
47+
48+ urls := make ([]string , len (urlMap ))
49+
50+ counter := 0
51+ for key := range urlMap {
52+ urls [counter ] = key
53+ counter ++
54+ }
55+ return urls
4856}
4957
5058// Watcher describes a component that watches for new certificates in a CT log.
You can’t perform that action at this time.
0 commit comments