Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
fix #114 , connstat routine sync
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Apr 19, 2021
1 parent f16239e commit 9b9f939
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,5 +546,10 @@ func (e *Engine) WriteStauts(_w io.Writer) {
}

func (e *Engine) ConnStat() torrent.ConnStats {
return e.client.ConnStats()
e.RLock()
defer e.RUnlock()
if e.client != nil {
return e.client.ConnStats()
}
return torrent.ConnStats{}
}

0 comments on commit 9b9f939

Please sign in to comment.