Exposing Restart #72
|
@ -28,6 +28,9 @@ type ACN interface {
|
|||
// Sets the calback function to be called when ACN status changes
|
||||
SetStatusCallback(callback func(int, string))
|
||||
|
||||
// Restarts the underlying connection
|
||||
Reboot()
|
||||
|
||||
// Open takes a hostname and returns a net.conn to the derived endpoint
|
||||
// Open allows a client to resolve various hostnames to connections
|
||||
// The supported types are onions address are:
|
||||
|
|
|
@ -121,7 +121,7 @@ func (tp *torProvider) Listen(identity PrivateKey, port int) (ListenService, err
|
|||
case ed25519.PrivateKey:
|
||||
privkey = pk
|
||||
gpubk := pk.Public()
|
||||
switch pubk := gpubk.(type) {
|
||||
switch pubk := gpubk.(type) {git
|
||||
case ed25519.PublicKey:
|
||||
onion = utils.GetTorV3Hostname(pubk)
|
||||
}
|
||||
|
@ -155,6 +155,10 @@ func (tp *torProvider) Listen(identity PrivateKey, port int) (ListenService, err
|
|||
return ols, nil
|
||||
}
|
||||
|
||||
func (tp *torProvider) Reboot() {
|
||||
tp.restart()
|
||||
}
|
||||
|
||||
func (tp *torProvider) Open(hostname string) (net.Conn, string, error) {
|
||||
tp.lock.Lock()
|
||||
|
||||
|
@ -285,6 +289,9 @@ func (tp *torProvider) monitorRestart() {
|
|||
}
|
||||
}
|
||||
lastBootstrapProgress = prog
|
||||
|
||||
tp.
|
||||
|
||||
case <-tp.breakChan:
|
||||
return
|
||||
}
|
||||
|
@ -324,6 +331,7 @@ func createFromExisting(controlport *control.Conn, datadir string) *tor.Tor {
|
|||
StopProcessOnClose: false,
|
||||
GeoIPCreatedFile: "",
|
||||
GeoIPv6CreatedFile: "",
|
||||
|
||||
}
|
||||
t.Control.DebugWriter = t.DebugWriter
|
||||
|
||||
|
|
Reference in New Issue