mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-05-16 20:18:36 -04:00
parent
78e01a37c7
commit
405a051c50
@ -583,7 +583,7 @@ func TestHTTP2(t *testing.T) {
|
|||||||
|
|
||||||
var errg errgroup.Group
|
var errg errgroup.Group
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
errg.Go(testTCPConn(clientPort, 10240*1024, time.Second*40))
|
errg.Go(testTCPConn(clientPort, 7168*1024, time.Second*40))
|
||||||
}
|
}
|
||||||
if err := errg.Wait(); err != nil {
|
if err := errg.Wait(); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
|
@ -23,7 +23,7 @@ var (
|
|||||||
globalDialerAccess sync.Mutex
|
globalDialerAccess sync.Mutex
|
||||||
)
|
)
|
||||||
|
|
||||||
func getHTTPClient(_ context.Context, dest net.Destination, tlsSettings *tls.Config) *http.Client {
|
func getHTTPClient(ctx context.Context, dest net.Destination, tlsSettings *tls.Config) *http.Client {
|
||||||
globalDialerAccess.Lock()
|
globalDialerAccess.Lock()
|
||||||
defer globalDialerAccess.Unlock()
|
defer globalDialerAccess.Unlock()
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ func getHTTPClient(_ context.Context, dest net.Destination, tlsSettings *tls.Con
|
|||||||
}
|
}
|
||||||
address := net.ParseAddress(rawHost)
|
address := net.ParseAddress(rawHost)
|
||||||
|
|
||||||
pconn, err := internet.DialSystem(context.Background(), net.TCPDestination(address, port), nil)
|
pconn, err := internet.DialSystem(ctx, net.TCPDestination(address, port), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -68,9 +68,6 @@ func getHTTPClient(_ context.Context, dest net.Destination, tlsSettings *tls.Con
|
|||||||
if p := state.NegotiatedProtocol; p != http2.NextProtoTLS {
|
if p := state.NegotiatedProtocol; p != http2.NextProtoTLS {
|
||||||
return nil, newError("http2: unexpected ALPN protocol " + p + "; want q" + http2.NextProtoTLS).AtError()
|
return nil, newError("http2: unexpected ALPN protocol " + p + "; want q" + http2.NextProtoTLS).AtError()
|
||||||
}
|
}
|
||||||
if !state.NegotiatedProtocolIsMutual {
|
|
||||||
return nil, newError("http2: could not negotiate protocol mutually").AtError()
|
|
||||||
}
|
|
||||||
return cn, nil
|
return cn, nil
|
||||||
},
|
},
|
||||||
TLSClientConfig: tlsSettings.GetTLSConfig(tls.WithDestination(dest)),
|
TLSClientConfig: tlsSettings.GetTLSConfig(tls.WithDestination(dest)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user