summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2012-01-10 22:49:12 +0100
committerLars-Dominik Braun <lars@6xq.net>2012-01-10 22:52:19 +0100
commita28839739c62cd589b1c31e76696fd5831f84520 (patch)
treea028a4c7466b147e608f1c84afa1caf9910e06dd /src
parent2a11e69bb6400f292183f4150265d3d24f74b905 (diff)
downloadpianobar-a28839739c62cd589b1c31e76696fd5831f84520.tar.gz
pianobar-a28839739c62cd589b1c31e76696fd5831f84520.tar.bz2
pianobar-a28839739c62cd589b1c31e76696fd5831f84520.zip
getFragment does not support TLS any more
You can’t handle the load? Closes #202
Diffstat (limited to 'src')
-rw-r--r--src/libpiano/piano.c4
-rw-r--r--src/libpiano/piano.h3
-rw-r--r--src/ui.c1
3 files changed, 8 insertions, 0 deletions
diff --git a/src/libpiano/piano.c b/src/libpiano/piano.c
index 56f2bf7..d4d8156 100644
--- a/src/libpiano/piano.c
+++ b/src/libpiano/piano.c
@@ -236,6 +236,8 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req,
assert (req != NULL);
req->type = type;
+ /* no tls by default */
+ req->secure = false;
switch (req->type) {
case PIANO_REQUEST_LOGIN: {
@@ -257,6 +259,8 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req,
case 1: {
char *xmlencodedPassword = NULL;
+ req->secure = true;
+
/* username == email address does not contain &,<,>," */
if ((xmlencodedPassword =
PianoXmlEncodeString (logindata->password)) ==
diff --git a/src/libpiano/piano.h b/src/libpiano/piano.h
index 7267901..d953dec 100644
--- a/src/libpiano/piano.h
+++ b/src/libpiano/piano.h
@@ -24,6 +24,8 @@ THE SOFTWARE.
#ifndef _PIANO_H
#define _PIANO_H
+#include <stdbool.h>
+
/* this is our public API; don't expect this api to be stable as long as
* pandora does not provide a stable api
* all strings _must_ be utf-8 encoded. i won't care, but pandora does. so
@@ -152,6 +154,7 @@ typedef enum {
typedef struct PianoRequest {
PianoRequestType_t type;
+ bool secure;
void *data;
char urlPath[1024];
char *postData;
diff --git a/src/ui.c b/src/ui.c
index d24db1c..f67d3a6 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -141,6 +141,7 @@ static WaitressReturn_t BarPianoHttpRequest (WaitressHandle_t *waith,
waith->postData = req->postData;
waith->method = WAITRESS_METHOD_POST;
waith->url.path = req->urlPath;
+ waith->url.tls = req->secure;
return WaitressFetchBuf (waith, &req->responseData);
}