Skip to content

Commit 0a8ea0c

Browse files
committed
fix: singleflight should not reuse if connection local addr is set
1 parent 14cf9a0 commit 0a8ea0c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sip/transport_connection_pool.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,16 @@ func (p *ConnectionPool) addSingleflight(raddr Addr, laddr Addr, reuse bool, do
5555

5656
if laddr.Port > 0 || reuse {
5757
// TODO: remplement this here to avoid type conversion
58-
if c := p.Get(a); c != nil {
59-
return c, nil
60-
}
6158

6259
laddrStr := laddr.String()
6360
if laddr.Port > 0 {
6461
if c := p.Get(laddrStr); c != nil {
6562
return c, nil
6663
}
64+
} else {
65+
if c := p.Get(a); c != nil {
66+
return c, nil
67+
}
6768
}
6869

6970
conn, err, _ := p.sf.Do(laddrStr+a, func() (any, error) {

0 commit comments

Comments
 (0)