Skip to content

Commit

Permalink
fix: adding on success to dialer
Browse files Browse the repository at this point in the history
  • Loading branch information
WendelHime committed Nov 19, 2024
1 parent b82c397 commit 04bb1c2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,22 @@ func newTestUserConfig() *common.UserConfigData {
}

func resetDialers(client *Client, dial func(network, addr string) (net.Conn, error)) {
rdyC := make(chan struct{}, 1)
d := dialer.New(&dialer.Options{
Dialers: []dialer.ProxyDialer{&testDialer{
name: "test-dialer",
dial: dial,
}},
OnSuccess: func(dialer dialer.ProxyDialer) {
select {
case rdyC <- struct{}{}:
default:
}
},
})
client.dialer.set(d)
// Wait for the dialer to be ready
<-rdyC
}

func newClient() *Client {
Expand Down

0 comments on commit 04bb1c2

Please sign in to comment.