forked from cwtch.im/ui
33 lines
867 B
Go
33 lines
867 B
Go
package characters
|
|
|
|
func TorStatusPoller(setTorStatus func(int, string)) {
|
|
//TODO: convert this from asaur to bine
|
|
/*
|
|
for {
|
|
time.Sleep(time.Second)
|
|
//todo: this should use a config manager
|
|
//todo: also, try dialing the proxy to differentiate tor not running vs control port not configured
|
|
rawStatus, err := asaur.GetInfo("localhost:9051", "tcp4", "", "status/bootstrap-phase")
|
|
if err != nil {
|
|
setTorStatus(0, "can't find tor. is it running? is the controlport configured?")
|
|
continue
|
|
}
|
|
|
|
status := asaur.ParseBootstrapPhase(rawStatus)
|
|
progress, _ := strconv.Atoi(status["PROGRESS"])
|
|
|
|
if status["TAG"] == "done" {
|
|
setTorStatus(3, "tor appears to be running just fine!")
|
|
continue
|
|
}
|
|
|
|
if progress == 0 {
|
|
setTorStatus(1, "tor is trying to start up")
|
|
continue
|
|
}
|
|
|
|
setTorStatus(2, status["SUMMARY"])
|
|
}
|
|
*/
|
|
}
|