Add dial parallel for outbound dialer
This commit is contained in:
@@ -85,10 +85,9 @@ func (t *TLSTransport) offer(ctx context.Context) (*dnsConnection, error) {
|
||||
func (t *TLSTransport) newConnection(conn *dnsConnection) {
|
||||
defer close(conn.done)
|
||||
defer conn.Close()
|
||||
ctx, cancel := context.WithCancel(t.ctx)
|
||||
err := task.Any(t.ctx, func() error {
|
||||
err := task.Any(t.ctx, func(ctx context.Context) error {
|
||||
return t.loopIn(conn)
|
||||
}, func() error {
|
||||
}, func(ctx context.Context) error {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil
|
||||
@@ -96,7 +95,6 @@ func (t *TLSTransport) newConnection(conn *dnsConnection) {
|
||||
return os.ErrClosed
|
||||
}
|
||||
})
|
||||
cancel()
|
||||
conn.err = err
|
||||
if err != nil {
|
||||
t.logger.Debug("connection closed: ", err)
|
||||
|
||||
Reference in New Issue
Block a user