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

Use 'notify' for curl version warning #2926

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
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
26 changes: 13 additions & 13 deletions src/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ 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);

// 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
flagEnvironmentVariablesAvailable(appConfig.validateGUINotificationEnvironmentVariables());
// If we are not using --display-config attempt to enable GUI notifications
if (!appConfig.getValueBool("display_config")) {
// Attempt to enable GUI Notifications
validateDBUSServerAvailability();
}
}

// If 'force_http_11' = false, we need to check the curl version being used
if (!appConfig.getValueBool("force_http_11")) {
// get the curl version
Expand All @@ -198,7 +209,7 @@ int main(string[] cliArgs) {
// add warning message
string curlWarningMessage = format("WARNING: Your curl/libcurl version (%s) has known HTTP/2 bugs that impact the use of this application.", curlVersion);
addLogEntry();
addLogEntry(curlWarningMessage);
addLogEntry(curlWarningMessage, ["info", "notify"]);
addLogEntry(" Please report this to your distribution and request that they provide a newer curl version for your platform or upgrade this yourself.");
addLogEntry(" Downgrading all application operations to use HTTP/1.1 to ensure maximum operational stability.");
addLogEntry(" Please read https://github.com/abraunegg/onedrive/blob/master/docs/usage.md#compatibility-with-curl for more information.");
Expand All @@ -214,23 +225,12 @@ int main(string[] cliArgs) {
// add warning message
string curlWarningMessage = format("WARNING: Your curl/libcurl version (%s) has known operational bugs that impact the use of this application.", curlVersion);
addLogEntry();
addLogEntry(curlWarningMessage);
addLogEntry(curlWarningMessage, ["info", "notify"]);
addLogEntry(" Please report this to your distribution and request that they provide a newer curl version for your platform or upgrade this yourself.");
addLogEntry();
}
}

// 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
flagEnvironmentVariablesAvailable(appConfig.validateGUINotificationEnvironmentVariables());
// If we are not using --display-config attempt to enable GUI notifications
if (!appConfig.getValueBool("display_config")) {
// Attempt to enable GUI Notifications
validateDBUSServerAvailability();
}
}

// In a debug scenario, to assist with understanding the run-time configuration, ensure this flag is set
if (debugLogging) {
appConfig.setValueBool("display_running_config", true);
Expand Down
Loading