summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTej Chajed <tchajed+github@gmail.com>2014-05-31 22:33:11 +0200
committerLars-Dominik Braun <lars@6xq.net>2014-06-04 13:42:17 +0200
commit374ee7afd3de63adb6022e4a87460bac46eee5d2 (patch)
treeaab92dce22f9f0a9ca51b95aeb14cb32c2e2ed4c /src
parent47a24f476ef551a75ccf6b082c8139e15942c081 (diff)
downloadpianobar-374ee7afd3de63adb6022e4a87460bac46eee5d2.tar.gz
pianobar-374ee7afd3de63adb6022e4a87460bac46eee5d2.tar.bz2
pianobar-374ee7afd3de63adb6022e4a87460bac46eee5d2.zip
Print error message when proxy URL format is incorrect
Diffstat (limited to 'src')
-rw-r--r--src/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 887bb84..fd87490 100644
--- a/src/main.c
+++ b/src/main.c
@@ -69,9 +69,17 @@ static void BarMainLoadProxy (const BarSettings_t *settings,
* firewalled fellows) */
if (settings->controlProxy != NULL) {
/* control proxy overrides global proxy */
- WaitressSetProxy (waith, settings->controlProxy);
+ if (!WaitressSetProxy (waith, settings->controlProxy)) {
+ /* if setting proxy fails, url is invalid */
+ BarUiMsg (settings, MSG_ERR, "Control proxy (%s) is invalid!\n",
+ settings->controlProxy);
+ }
} else if (settings->proxy != NULL && strlen (settings->proxy) > 0) {
- WaitressSetProxy (waith, settings->proxy);
+ if (!WaitressSetProxy (waith, settings->proxy)) {
+ /* if setting proxy fails, url is invalid */
+ BarUiMsg (settings, MSG_ERR, "Proxy (%s) is invalid!\n",
+ settings->proxy);
+ }
}
}