don't hold mutex across net calls

This commit is contained in:
Ted Unangst 2019-04-15 23:54:29 -04:00
parent 3cfdaacdb3
commit a5f21922e9
1 changed files with 3 additions and 1 deletions

View File

@ -845,12 +845,14 @@ func gofish(name string) string {
return "" return ""
} }
handlock.Lock() handlock.Lock()
defer handlock.Unlock()
ref, ok := handfull[name] ref, ok := handfull[name]
handlock.Unlock()
if ok { if ok {
return ref return ref
} }
j, err := GetJunk(fmt.Sprintf("https://%s/.well-known/webfinger?resource=acct:%s", m[1], name)) j, err := GetJunk(fmt.Sprintf("https://%s/.well-known/webfinger?resource=acct:%s", m[1], name))
handlock.Lock()
defer handlock.Unlock()
if err != nil { if err != nil {
log.Printf("failed to go fish %s: %s", name, err) log.Printf("failed to go fish %s: %s", name, err)
handfull[name] = "" handfull[name] = ""