Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix that curl generates a SIGPIPE that causes application to exit due to upstream device killing idle TCP connection #2906

Merged
merged 11 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update PR
* Add forced HTTP/1.1 downgrade based on bad curl versions usually found in Ubuntu distributions
  • Loading branch information
abraunegg committed Oct 20, 2024
commit 6fd3e9d8df34545174231d2aba14b91047917919
12 changes: 12 additions & 0 deletions src/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,18 @@ int main(string[] cliArgs) {
// Update the current runtime application configuration (default or 'config' fileread-in options) from any passed in command line arguments
appConfig.updateFromArgs(cliArgs);

// Is the version of curl or libcurl a known bad curl version for HTTP/2 support
if (isBadCurlVersion(getCurlVersionNumeric())) {
// add warning message
string curlWarningMessage = format("WARNING: Your curl/libcurl version (%s) has known HTTP/2 bugs that impact this application.", getCurlVersionNumeric());
addLogEntry();
addLogEntry(curlWarningMessage);
addLogEntry(" Please report this to your distribution and request that they provide a newer version for your platform or upgrade this yourself.");
addLogEntry(" Downgrading all application operations to use HTTP/1.1 to ensure maximum operational stability.");
addLogEntry();
appConfig.setValueBool("force_http_11" , true);
}

// If --disable-notifications has not been used, check if everything exists to enable notifications
if (!appConfig.getValueBool("disable_notifications")) {
// If notifications was compiled in, we need to ensure that these variables are actually available before we enable GUI Notifications
Expand Down
15 changes: 15 additions & 0 deletions src/util.d
Original file line number Diff line number Diff line change
Expand Up @@ -1385,3 +1385,18 @@ string getCurlVersionNumeric() {
// Return the version in the format "major.minor.patch"
return major.to!string ~ "." ~ minor.to!string ~ "." ~ patch.to!string;
}

// Test the curl version against known curl versions with HTTP/2 issues
bool isBadCurlVersion(string curlVersion) {
// List of known curl versions with HTTP/2 issues
string[] supportedVersions = [
"7.68.0",
"7.74.0",
"7.81.0",
"7.88.1",
"8.10.0"
];

// Check if the current version matches one of the supported versions
return canFind(supportedVersions, curlVersion);
}
Loading