Expose Restart
the build failed
Details
the build failed
Details
This commit is contained in:
parent
94389db18e
commit
c3451dd068
|
@ -28,8 +28,8 @@ type ACN interface {
|
|||
// Sets the calback function to be called when ACN status changes
|
||||
SetStatusCallback(callback func(int, string))
|
||||
|
||||
// Restarts the underlying connection
|
||||
Reboot()
|
||||
// Restart the underlying connection
|
||||
Restart()
|
||||
|
||||
// Open takes a hostname and returns a net.conn to the derived endpoint
|
||||
// Open allows a client to resolve various hostnames to connections
|
||||
|
|
|
@ -38,6 +38,10 @@ func (lp *localProvider) SetStatusCallback(callback func(int, string)) {
|
|||
// nop
|
||||
}
|
||||
|
||||
func (lp *localProvider) Restart() {
|
||||
// noop
|
||||
}
|
||||
|
||||
// WaitTillBootstrapped Blocks until underlying network is bootstrapped
|
||||
func (lp *localProvider) WaitTillBootstrapped() {
|
||||
}
|
||||
|
|
|
@ -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) {git
|
||||
switch pubk := gpubk.(type) {
|
||||
case ed25519.PublicKey:
|
||||
onion = utils.GetTorV3Hostname(pubk)
|
||||
}
|
||||
|
@ -155,10 +155,6 @@ 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()
|
||||
|
||||
|
@ -178,6 +174,13 @@ func (tp *torProvider) Open(hostname string) (net.Conn, string, error) {
|
|||
return conn, resolvedHostname, err
|
||||
}
|
||||
|
||||
func (tp *torProvider) Restart() {
|
||||
if tp.statusCallback != nil {
|
||||
tp.statusCallback(0, "rebooting")
|
||||
}
|
||||
tp.restart()
|
||||
}
|
||||
|
||||
func (tp *torProvider) Close() {
|
||||
for _, child := range tp.childListeners {
|
||||
child.Close()
|
||||
|
@ -289,9 +292,6 @@ func (tp *torProvider) monitorRestart() {
|
|||
}
|
||||
}
|
||||
lastBootstrapProgress = prog
|
||||
|
||||
tp.
|
||||
|
||||
case <-tp.breakChan:
|
||||
return
|
||||
}
|
||||
|
@ -331,7 +331,6 @@ func createFromExisting(controlport *control.Conn, datadir string) *tor.Tor {
|
|||
StopProcessOnClose: false,
|
||||
GeoIPCreatedFile: "",
|
||||
GeoIPv6CreatedFile: "",
|
||||
|
||||
}
|
||||
t.Control.DebugWriter = t.DebugWriter
|
||||
|
||||
|
|
Reference in New Issue