TUN-6617: Dont fallback to http2 if QUIC conn was successful.
cloudflared falls back aggressively to HTTP/2 protocol if a connection attempt with QUIC failed. This was done to ensure that machines with UDP egress disabled did not stop clients from connecting to the cloudlfare edge. This PR improves on that experience by having cloudflared remember if a QUIC connection was successful which implies UDP egress works. In this case, cloudflared does not fallback to HTTP/2 and keeps trying to connect to the edge with QUIC.
This commit is contained in:
parent
679a89c7df
commit
68d370af19
|
@ -61,13 +61,15 @@ def cloudflared_cmd(config, config_path, cfd_args, cfd_pre_args, root):
|
||||||
def run_cloudflared_background(cmd, allow_input, capture_output):
|
def run_cloudflared_background(cmd, allow_input, capture_output):
|
||||||
output = subprocess.PIPE if capture_output else subprocess.DEVNULL
|
output = subprocess.PIPE if capture_output else subprocess.DEVNULL
|
||||||
stdin = subprocess.PIPE if allow_input else None
|
stdin = subprocess.PIPE if allow_input else None
|
||||||
|
cfd = None
|
||||||
try:
|
try:
|
||||||
cfd = subprocess.Popen(cmd, stdin=stdin, stdout=output, stderr=output)
|
cfd = subprocess.Popen(cmd, stdin=stdin, stdout=output, stderr=output)
|
||||||
yield cfd
|
yield cfd
|
||||||
finally:
|
finally:
|
||||||
cfd.terminate()
|
if cfd:
|
||||||
if capture_output:
|
cfd.terminate()
|
||||||
LOGGER.info(f"cloudflared log: {cfd.stderr.read()}")
|
if capture_output:
|
||||||
|
LOGGER.info(f"cloudflared log: {cfd.stderr.read()}")
|
||||||
|
|
||||||
|
|
||||||
def wait_tunnel_ready(tunnel_url=None, require_min_connections=1, cfd_logs=None):
|
def wait_tunnel_ready(tunnel_url=None, require_min_connections=1, cfd_logs=None):
|
||||||
|
|
Loading…
Reference in New Issue