mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
Disable 0-rtt mechanism for http/1 outbound (#372)
Fix #357 Co-authored-by: August Njam Brong <longran1989@gmail.com>
This commit is contained in:
parent
a36489bfaa
commit
e3b96a1b56
@ -97,6 +97,12 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter
|
|||||||
|
|
||||||
netConn, err := setUpHTTPTunnel(ctx, dest, targetAddr, user, dialer, firstPayload)
|
netConn, err := setUpHTTPTunnel(ctx, dest, targetAddr, user, dialer, firstPayload)
|
||||||
if netConn != nil {
|
if netConn != nil {
|
||||||
|
if _, ok := netConn.(*http2Conn); !ok {
|
||||||
|
if _, err := netConn.Write(firstPayload); err != nil {
|
||||||
|
netConn.Close()
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
conn = internet.Connection(netConn)
|
conn = internet.Connection(netConn)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
@ -159,11 +165,6 @@ func setUpHTTPTunnel(ctx context.Context, dest net.Destination, target string, u
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := rawConn.Write(firstPayload); err != nil {
|
|
||||||
rawConn.Close()
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := http.ReadResponse(bufio.NewReader(rawConn), req)
|
resp, err := http.ReadResponse(bufio.NewReader(rawConn), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
rawConn.Close()
|
rawConn.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user