summaryrefslogtreecommitdiff
path: root/src/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings.c')
-rw-r--r--src/settings.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/settings.c b/src/settings.c
index 4ac2fea..1dee0ea 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -72,6 +72,7 @@ void BarSettingsInit (BarSettings_t *settings) {
*/
void BarSettingsDestroy (BarSettings_t *settings) {
free (settings->controlProxy);
+ free (settings->proxy);
free (settings->username);
free (settings->password);
free (settings->autostartStation);
@@ -130,6 +131,8 @@ void BarSettingsRead (BarSettings_t *settings) {
}
if (strcmp ("control_proxy", key) == 0) {
settings->controlProxy = strdup (val);
+ } else if (strcmp ("proxy", key) == 0) {
+ settings->proxy = strdup (val);
} else if (strcmp ("user", key) == 0) {
settings->username = strdup (val);
} else if (strcmp ("password", key) == 0) {
@@ -159,5 +162,13 @@ void BarSettingsRead (BarSettings_t *settings) {
}
}
+ /* check environment variable if proxy is not set explicitly */
+ if (settings->proxy == NULL) {
+ char *tmpProxy = getenv ("http_proxy");
+ if (tmpProxy != NULL && strlen (tmpProxy) > 0) {
+ settings->proxy = strdup (tmpProxy);
+ }
+ }
+
fclose (configfd);
}