Commit db49f76d authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

net/http: document Transport.Dial concurrency

Fixes #25019

Change-Id: I715e3bb560b2a0301240cecb09a5126ab04a666e
Reviewed-on: https://go-review.googlesource.com/116375Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 9be4f312
......@@ -109,10 +109,20 @@ type Transport struct {
// DialContext specifies the dial function for creating unencrypted TCP connections.
// If DialContext is nil (and the deprecated Dial below is also nil),
// then the transport dials using package net.
//
// DialContext runs concurrently with calls to RoundTrip.
// A RoundTrip call that initiates a dial may end up using
// an connection dialed previously when the earlier connection
// becomes idle before the later DialContext completes.
DialContext func(ctx context.Context, network, addr string) (net.Conn, error)
// Dial specifies the dial function for creating unencrypted TCP connections.
//
// Dial runs concurrently with calls to RoundTrip.
// A RoundTrip call that initiates a dial may end up using
// an connection dialed previously when the earlier connection
// becomes idle before the later Dial completes.
//
// Deprecated: Use DialContext instead, which allows the transport
// to cancel dials as soon as they are no longer needed.
// If both are set, DialContext takes priority.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment