Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2dfd67b490 |
@@ -280,7 +280,7 @@ func startForwarder(t *testing.T) (string, func(addr string)) {
|
||||
})
|
||||
|
||||
var (
|
||||
lock sync.Mutex
|
||||
mu sync.Mutex
|
||||
to string
|
||||
)
|
||||
|
||||
@@ -288,8 +288,8 @@ func startForwarder(t *testing.T) (string, func(addr string)) {
|
||||
// holds the lock throughout, so once another address is set, nothing
|
||||
// connects to the one before.
|
||||
dial := func() net.Conn {
|
||||
lock.Lock()
|
||||
defer lock.Unlock()
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
|
||||
if to == "" {
|
||||
return nil
|
||||
@@ -323,8 +323,8 @@ func startForwarder(t *testing.T) (string, func(addr string)) {
|
||||
}()
|
||||
|
||||
return listener.Addr().String(), func(addr string) {
|
||||
lock.Lock()
|
||||
defer lock.Unlock()
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
|
||||
to = addr
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user