1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-11-09 16:57:15 -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:
單dar 于ɦʷa
2020-10-31 11:03:46 +08:00
committed by GitHub
parent a36489bfaa
commit e3b96a1b56

View File

@@ -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)
if netConn != nil {
if _, ok := netConn.(*http2Conn); !ok {
if _, err := netConn.Write(firstPayload); err != nil {
netConn.Close()
return err
}
}
conn = internet.Connection(netConn)
}
return err
@@ -159,11 +165,6 @@ func setUpHTTPTunnel(ctx context.Context, dest net.Destination, target string, u
return nil, err
}
if _, err := rawConn.Write(firstPayload); err != nil {
rawConn.Close()
return nil, err
}
resp, err := http.ReadResponse(bufio.NewReader(rawConn), req)
if err != nil {
rawConn.Close()