diff options
author | Tej Chajed <tchajed+github@gmail.com> | 2014-05-31 22:33:11 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2014-06-04 13:42:17 +0200 |
commit | 374ee7afd3de63adb6022e4a87460bac46eee5d2 (patch) | |
tree | aab92dce22f9f0a9ca51b95aeb14cb32c2e2ed4c | |
parent | 47a24f476ef551a75ccf6b082c8139e15942c081 (diff) | |
download | pianobar-374ee7afd3de63adb6022e4a87460bac46eee5d2.tar.gz pianobar-374ee7afd3de63adb6022e4a87460bac46eee5d2.tar.bz2 pianobar-374ee7afd3de63adb6022e4a87460bac46eee5d2.zip |
Print error message when proxy URL format is incorrect
-rw-r--r-- | src/main.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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); + } } } |