Skip to content

Commit

Permalink
fix: Fix redial using TLS
Browse files Browse the repository at this point in the history
Change-Id: Iecb5ff4bc8b992bae62fb3dd8131cebc68e4b720
  • Loading branch information
andeya committed Oct 24, 2019
1 parent 4519178 commit a0e0923
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion examples/simple/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
func main() {
defer tp.SetLoggerLevel("ERROR")()

cli := tp.NewPeer(tp.PeerConfig{})
cli := tp.NewPeer(tp.PeerConfig{RedialTimes: -1})
defer cli.Close()
cli.SetTLSConfig(tp.GenerateTLSConfigForClient())

Expand Down
3 changes: 0 additions & 3 deletions peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,6 @@ func (p *peer) renewSessionForClientLocked(sess *session, dialFunc func() (net.C
if dialErr != nil {
return statDialFailed.Copy(dialErr)
}
if p.tlsConfig != nil {
conn = tls.Client(conn, p.tlsConfig)
}
oldIP := sess.LocalAddr().String()
oldID := sess.ID()
oldConn := sess.getConn()
Expand Down

0 comments on commit a0e0923

Please sign in to comment.