Skip to content

Commit

Permalink
Make HTTP dialer accept socket config
Browse files Browse the repository at this point in the history
  • Loading branch information
Vigilans committed Sep 9, 2021
1 parent 37096b7 commit 28b33d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions transport/internet/http/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (

type dialerCanceller func()

func getHTTPClient(ctx context.Context, dest net.Destination, tlsSettings *tls.Config) (*http.Client, dialerCanceller) {
func getHTTPClient(ctx context.Context, dest net.Destination, tlsSettings *tls.Config, streamSettings *internet.MemoryStreamConfig) (*http.Client, dialerCanceller) {
globalDialerAccess.Lock()
defer globalDialerAccess.Unlock()

Expand Down Expand Up @@ -62,7 +62,7 @@ func getHTTPClient(ctx context.Context, dest net.Destination, tlsSettings *tls.C
address := net.ParseAddress(rawHost)

detachedContext := core.ToBackgroundDetachedContext(ctx)
pconn, err := internet.DialSystem(detachedContext, net.TCPDestination(address, port), nil)
pconn, err := internet.DialSystem(detachedContext, net.TCPDestination(address, port), streamSettings.SocketSettings)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -100,7 +100,7 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
if tlsConfig == nil {
return nil, newError("TLS must be enabled for http transport.").AtWarning()
}
client, canceller := getHTTPClient(ctx, dest, tlsConfig)
client, canceller := getHTTPClient(ctx, dest, tlsConfig, streamSettings)

opts := pipe.OptionsFromContext(ctx)
preader, pwriter := pipe.New(opts...)
Expand Down

0 comments on commit 28b33d0

Please sign in to comment.