don't hold mutex across net calls
Ted Unangst tedu@tedunangst.com
Mon, 15 Apr 2019 23:54:29 -0400
1 files changed,
3 insertions(+),
1 deletions(-)
jump to
M
honk.go
→
honk.go
@@ -845,12 +845,14 @@ log.Printf("bad fish name: %s", name)
return "" } handlock.Lock() - defer handlock.Unlock() ref, ok := handfull[name] + handlock.Unlock() if ok { return ref } j, err := GetJunk(fmt.Sprintf("https://%s/.well-known/webfinger?resource=acct:%s", m[1], name)) + handlock.Lock() + defer handlock.Unlock() if err != nil { log.Printf("failed to go fish %s: %s", name, err) handfull[name] = ""