fix marker for selector
This commit is contained in:
parent
118ee91c95
commit
ce60160cd7
@ -104,7 +104,7 @@ func (c *Chain) Route(ctx context.Context, network, address string, opts ...chai
|
|||||||
tr.Options().Route = rt
|
tr.Options().Route = rt
|
||||||
node = node.Copy()
|
node = node.Copy()
|
||||||
node.Options().Transport = tr
|
node.Options().Transport = tr
|
||||||
rt = NewRoute()
|
rt = NewRoute(ChainRouteOption(c))
|
||||||
}
|
}
|
||||||
|
|
||||||
rt.addNode(node)
|
rt.addNode(node)
|
||||||
|
@ -129,10 +129,11 @@ func (r *route) connect(ctx context.Context, logger logger.Logger) (conn net.Con
|
|||||||
metrics.Labels{"chain": name, "node": node.Name}); v != nil {
|
metrics.Labels{"chain": name, "node": node.Name}); v != nil {
|
||||||
v.Inc()
|
v.Inc()
|
||||||
}
|
}
|
||||||
} else {
|
return
|
||||||
if marker != nil {
|
}
|
||||||
marker.Reset()
|
|
||||||
}
|
if marker != nil {
|
||||||
|
marker.Reset()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
@ -70,6 +70,19 @@ func (d *http2Dialer) Dial(ctx context.Context, address string, opts ...dialer.D
|
|||||||
opt(&options)
|
opt(&options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// Check whether the connection is established properly
|
||||||
|
netd := options.NetDialer
|
||||||
|
if netd == nil {
|
||||||
|
netd = net_dialer.DefaultNetDialer
|
||||||
|
}
|
||||||
|
conn, err := netd.Dial(ctx, "tcp", address)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
conn.Close()
|
||||||
|
}
|
||||||
|
|
||||||
client = &http.Client{
|
client = &http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
TLSClientConfig: d.options.TLSConfig,
|
TLSClientConfig: d.options.TLSConfig,
|
||||||
@ -81,17 +94,16 @@ func (d *http2Dialer) Dial(ctx context.Context, address string, opts ...dialer.D
|
|||||||
return netd.Dial(ctx, network, addr)
|
return netd.Dial(ctx, network, addr)
|
||||||
},
|
},
|
||||||
ForceAttemptHTTP2: true,
|
ForceAttemptHTTP2: true,
|
||||||
MaxIdleConns: 100,
|
MaxIdleConns: 16,
|
||||||
IdleConnTimeout: 90 * time.Second,
|
IdleConnTimeout: 30 * time.Second,
|
||||||
TLSHandshakeTimeout: 10 * time.Second,
|
TLSHandshakeTimeout: 30 * time.Second,
|
||||||
ExpectContinueTimeout: 1 * time.Second,
|
ExpectContinueTimeout: 15 * time.Second,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
d.clients[address] = client
|
d.clients[address] = client
|
||||||
}
|
}
|
||||||
|
|
||||||
var c net.Conn
|
var c net.Conn = &conn{
|
||||||
c = &conn{
|
|
||||||
localAddr: &net.TCPAddr{},
|
localAddr: &net.TCPAddr{},
|
||||||
remoteAddr: raddr,
|
remoteAddr: raddr,
|
||||||
onClose: func() {
|
onClose: func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user