summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/settings.c3
-rw-r--r--src/settings.h1
-rw-r--r--src/ui.c9
3 files changed, 13 insertions, 0 deletions
diff --git a/src/settings.c b/src/settings.c
index f1aa707..115a71c 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -111,6 +111,7 @@ void BarSettingsInit (BarSettings_t *settings) {
void BarSettingsDestroy (BarSettings_t *settings) {
free (settings->controlProxy);
free (settings->proxy);
+ free (settings->bindTo);
free (settings->username);
free (settings->password);
free (settings->passwordCmd);
@@ -269,6 +270,8 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->controlProxy = strdup (val);
} else if (streq ("proxy", key)) {
settings->proxy = strdup (val);
+ } else if (streq ("bind_to", key)) {
+ settings->bindTo = strdup (val);
} else if (streq ("user", key)) {
settings->username = strdup (val);
} else if (streq ("password", key)) {
diff --git a/src/settings.h b/src/settings.h
index d35a64c..0b40113 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -93,6 +93,7 @@ typedef struct {
char *password, *passwordCmd;
char *controlProxy; /* non-american listeners need this */
char *proxy;
+ char *bindTo;
char *autostartStation;
char *eventCmd;
char *loveIcon;
diff --git a/src/ui.c b/src/ui.c
index 5350dea..69bf9ee 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -209,6 +209,15 @@ static CURLcode BarPianoHttpRequest (CURL * const http,
setAndCheck (CURLOPT_CAINFO, settings->caBundle);
}
+ if (settings->bindTo!= NULL) {
+ if (curl_easy_setopt (http, CURLOPT_INTERFACE,
+ settings->bindTo) != CURLE_OK) {
+ /* if binding fails, notice about that */
+ BarUiMsg (settings, MSG_ERR, "bindTo (%s) is invalid!\n",
+ settings->bindTo);
+ }
+ }
+
/* set up proxy (control proxy for non-us citizen or global proxy for poor
* firewalled fellows) */
if (settings->controlProxy != NULL) {