utils/curl: refactor curl_with_workarounds

This commit is contained in:
hyuraku 2021-02-03 09:54:09 +09:00
parent c538d4d84e
commit 16f8638236

View File

@ -72,7 +72,11 @@ module Utils
env: { "SSL_CERT_FILE" => nil }.merge(env),
**command_options
if !result.success? && args.exclude?("--http1.1")
return result if result.success? || !args.exclude?("--http1.1")
# Error in the HTTP2 framing layer
return curl_with_workarounds(*args, "--http1.1", **command_options, **options) if result.status.exitstatus == 16
# This is a workaround for https://github.com/curl/curl/issues/1618.
if result.status.exitstatus == 56 # Unexpected EOF
out = curl_output("-V").stdout
@ -87,11 +91,6 @@ module Utils
return curl_with_workarounds(*args, "--http1.1", **command_options, **options)
end
if result.status.exitstatus == 16 # Error in the HTTP2 framing layer
return curl_with_workarounds(*args, "--http1.1", **command_options, **options)
end
end
result
end