Update Signature
This commit is contained in:
parent
66d6b0b51e
commit
8eeea02997
|
@ -106,7 +106,7 @@ func (s *BaseOnionService) Connect(hostname string, app tapir.Application) (bool
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debugf("Connected to %v [%v]", hostname, connectionID)
|
log.Debugf("Connected to %v [%v]", hostname, connectionID)
|
||||||
s.connections.Store(connectionID, tapir.NewConnection(s.id, hostname, true, conn, app.NewInstance(), s))
|
s.connections.Store(connectionID, tapir.NewConnection(s, s.id, hostname, true, conn, app.NewInstance()))
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
log.Debugf("Error connecting to %v %v", hostname, err)
|
log.Debugf("Error connecting to %v %v", hostname, err)
|
||||||
|
@ -137,7 +137,7 @@ func (s *BaseOnionService) Listen(app tapir.Application) error {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
tempHostname := s.getNewConnectionID()
|
tempHostname := s.getNewConnectionID()
|
||||||
log.Debugf("Accepted connection from %v", tempHostname)
|
log.Debugf("Accepted connection from %v", tempHostname)
|
||||||
s.connections.Store(tempHostname, tapir.NewConnection(s.id, tempHostname, false, conn, app.NewInstance(), s))
|
s.connections.Store(tempHostname, tapir.NewConnection(s, s.id, tempHostname, false, conn, app.NewInstance()))
|
||||||
} else {
|
} else {
|
||||||
log.Debugf("Error accepting connection %v", err)
|
log.Debugf("Error accepting connection %v", err)
|
||||||
return err
|
return err
|
||||||
|
|
Binary file not shown.
|
@ -58,7 +58,7 @@ type connection struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewConnection creates a new Connection
|
// NewConnection creates a new Connection
|
||||||
func NewConnection(id *primitives.Identity, hostname string, outbound bool, conn io.ReadWriteCloser, app Application, service Service) Connection {
|
func NewConnection(service Service, id *primitives.Identity, hostname string, outbound bool, conn io.ReadWriteCloser, app Application) Connection {
|
||||||
connection := new(connection)
|
connection := new(connection)
|
||||||
connection.hostname = hostname
|
connection.hostname = hostname
|
||||||
connection.conn = conn
|
connection.conn = conn
|
||||||
|
|
|
@ -64,7 +64,7 @@ func TestTapirMaliciousRemote(t *testing.T) {
|
||||||
log.Infof("closing ACN...")
|
log.Infof("closing ACN...")
|
||||||
acn.Close()
|
acn.Close()
|
||||||
sg.Wait()
|
sg.Wait()
|
||||||
time.Sleep(time.Second * 2)
|
time.Sleep(time.Second * 5) // wait for goroutines to finish...
|
||||||
log.Infof("Number of goroutines open at close: %d", runtime.NumGoroutine())
|
log.Infof("Number of goroutines open at close: %d", runtime.NumGoroutine())
|
||||||
if numRoutinesStart != runtime.NumGoroutine() {
|
if numRoutinesStart != runtime.NumGoroutine() {
|
||||||
t.Errorf("Potential goroutine leak: Num Start:%v NumEnd: %v", numRoutinesStart, runtime.NumGoroutine())
|
t.Errorf("Potential goroutine leak: Num Start:%v NumEnd: %v", numRoutinesStart, runtime.NumGoroutine())
|
||||||
|
|
Loading…
Reference in New Issue