summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Cichoń <michcic@gmail.com>2017-05-20 21:41:38 +0200
committerMichał Cichoń <michcic@gmail.com>2017-05-20 21:41:38 +0200
commitfff5aeb8bad31464dd50927af12d1baa04ff157a (patch)
treea38e5f13fe650334c3e2efbffaf318fd5f34ac04
parentd85cf786935f3b3517b4156074d2bbbbf1e43494 (diff)
downloadpianobar-windows-feature/control-proxy.tar.gz
pianobar-windows-feature/control-proxy.tar.bz2
pianobar-windows-feature/control-proxy.zip
Print out proxy setting errors.feature/control-proxy
-rw-r--r--src/http/http.c6
-rw-r--r--src/main.c10
2 files changed, 15 insertions, 1 deletions
diff --git a/src/http/http.c b/src/http/http.c
index 4576d04..441ff8b 100644
--- a/src/http/http.c
+++ b/src/http/http.c
@@ -301,6 +301,9 @@ bool HttpSetProxy (http_t http, const char* url) {
HttpUrlDecodeInplace (widePassword);
}
}
+ else {
+ HttpSetLastErrorFromWinHttp(http);
+ }
ZeroMemory(&urlComponents, sizeof(urlComponents));
urlComponents.dwStructSize = sizeof(urlComponents);
@@ -312,6 +315,9 @@ bool HttpSetProxy (http_t http, const char* url) {
free(widePassword);
return false;
}
+ else {
+ HttpSetLastErrorFromWinHttp(http);
+ }
if (urlComponents.lpszHostName && urlComponents.dwHostNameLength > 0) {
wideUrl2 = wcsdup(urlComponents.lpszHostName);
diff --git a/src/main.c b/src/main.c
index 4f4214a..d2e9e3a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -413,7 +413,15 @@ int main(int argc, char **argv)
HttpInit(&app.http2, app.settings.rpcHost, app.settings.rpcTlsPort);
if (app.settings.controlProxy)
- HttpSetProxy(app.http2, app.settings.controlProxy);
+ {
+ if (!HttpSetProxy(app.http2, app.settings.controlProxy))
+ {
+ BarUiMsg(&app.settings, MSG_NONE, "Control Proxy error: %s\n",
+ HttpGetError(app.http2));
+
+ return 0;
+ }
+ }
BarReadlineInit(&app.rl);