summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2012-04-14 16:49:51 +0200
committerLars-Dominik Braun <lars@6xq.net>2012-04-14 16:49:51 +0200
commit35763dea799c96361e288a10eab0fbd16c36e880 (patch)
treeeeedf6a184106a8da119f1c59f110aac6d9a8329 /src/ui.c
parented6d013054f589f2999926b02f4ac6dc76c7fe91 (diff)
downloadpianobar-35763dea799c96361e288a10eab0fbd16c36e880.tar.gz
pianobar-35763dea799c96361e288a10eab0fbd16c36e880.tar.bz2
pianobar-35763dea799c96361e288a10eab0fbd16c36e880.zip
Add force_tls setting
Use TLS for all actions when requested. Closes #234
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ui.c b/src/ui.c
index 104ee04..4162dce 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -134,14 +134,15 @@ void BarUiMsg (const BarSettings_t *settings, const BarUiMsg_t type,
/* fetch http resource (post request)
* @param waitress handle
* @param piano request (initialized by PianoRequest())
+ * @param ignore libpiano TLS hint and use it always
*/
static WaitressReturn_t BarPianoHttpRequest (WaitressHandle_t *waith,
- PianoRequest_t *req) {
+ PianoRequest_t *req, bool forceTls) {
waith->extraHeaders = "Content-Type: text/xml\r\n";
waith->postData = req->postData;
waith->method = WAITRESS_METHOD_POST;
waith->url.path = req->urlPath;
- waith->url.tls = req->secure;
+ waith->url.tls = req->secure || forceTls;
return WaitressFetchBuf (waith, &req->responseData);
}
@@ -172,7 +173,7 @@ int BarUiPianoCall (BarApp_t * const app, PianoRequestType_t type,
return 0;
}
- *wRet = BarPianoHttpRequest (&app->waith, &req);
+ *wRet = BarPianoHttpRequest (&app->waith, &req, app->settings.forceTls);
if (*wRet != WAITRESS_RET_OK) {
BarUiMsg (&app->settings, MSG_NONE, "Network error: %s\n", WaitressErrorToStr (*wRet));
if (req.responseData != NULL) {