aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputStream_http.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-20 17:07:13 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-20 17:07:13 +0000
commit6eb6c454be37c54a34fc871e21a9b1cc2ad41b89 (patch)
treecf26c19c6820838ed33c359f0b354397bd3828f0 /src/inputStream_http.c
parentd8dbd29c2dfd743bdcc152cad0c634b5a32121fc (diff)
downloadmpd-6eb6c454be37c54a34fc871e21a9b1cc2ad41b89.tar.gz
mpd-6eb6c454be37c54a34fc871e21a9b1cc2ad41b89.tar.xz
mpd-6eb6c454be37c54a34fc871e21a9b1cc2ad41b89.zip
fix qball's bug, crossfading playing with funny samplerate
git-svn-id: https://svn.musicpd.org/mpd/trunk@1585 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/inputStream_http.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/inputStream_http.c b/src/inputStream_http.c
index 66e98b5a8..7ea4470a4 100644
--- a/src/inputStream_http.c
+++ b/src/inputStream_http.c
@@ -20,6 +20,7 @@
#include "utils.h"
#include "log.h"
+#include "conf.h"
#include <stdio.h>
#include <sys/time.h>
@@ -61,6 +62,55 @@ typedef struct _InputStreemHTTPData {
int icyOffset;
} InputStreamHTTPData;
+void inputStream_initHttp() {
+ if(getConf()[CONF_HTTP_PROXY_HOST]) {
+ char * portStr = getConf()[CONF_HTTP_PROXY_PORT];
+ int port = 0;
+ char * test;
+
+ if(!portStr) {
+ ERROR("http_proxy_host specified but not the http_"
+ "proxy_port\n");
+ exit(EXIT_FAILURE);
+ }
+
+ port = strtol(portStr, &test, 10);
+ if(port <= 0 || *test != '\0') {
+ ERROR("http_proxy_port \"%s\" is not a positive integer"
+ "\n", portStr);
+ }
+
+ if(getConf()[CONF_HTTP_PROXY_USER] &&
+ !getConf()[CONF_HTTP_PROXY_PASSWORD])
+ {
+ ERROR("http_proxy_user specified, but not http_proxy_"
+ "password\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if(getConf()[CONF_HTTP_PROXY_PASSWORD] &&
+ !getConf()[CONF_HTTP_PROXY_USER])
+ {
+ ERROR("http proxy password specified, but not http "
+ "proxy user\n");
+ exit(EXIT_FAILURE);
+ }
+ }
+ else if(getConf()[CONF_HTTP_PROXY_PORT]) {
+ ERROR("http_proxy_port specified but not http_proxy_host\n");
+ exit(EXIT_FAILURE);
+ }
+ else if(getConf()[CONF_HTTP_PROXY_USER]) {
+ ERROR("http_proxy_user specified but not http_proxy_host\n");
+ exit(EXIT_FAILURE);
+ }
+ else if(getConf()[CONF_HTTP_PROXY_PASSWORD]) {
+ ERROR("http_proxy_password specified but not http_proxy_host"
+ "\n");
+ exit(EXIT_FAILURE);
+ }
+}
+
static InputStreamHTTPData * newInputStreamHTTPData() {
InputStreamHTTPData * ret = malloc(sizeof(InputStreamHTTPData));