summaryrefslogtreecommitdiff
path: root/src/input/input_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/input_http.c')
-rw-r--r--src/input/input_http.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 38658b161..f2e91c226 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -79,9 +79,6 @@ typedef struct {
char buf[BUFSIZE];
char proxybuf[BUFSIZE];
- char auth[BUFSIZE];
- char proxyauth[BUFSIZE];
-
char preview[MAX_PREVIEW_SIZE];
off_t preview_size;
@@ -232,7 +229,7 @@ static int _x_use_proxy(http_input_class_t *this, const char *host) {
}
static int http_plugin_basicauth (const char *user, const char *password, char* dest, int len) {
- static char *enctable="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+ static const char enctable[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
char *tmp;
char *sptr;
char *dptr;
@@ -249,7 +246,7 @@ static int http_plugin_basicauth (const char *user, const char *password, char*
if (len < enclen)
return -1;
- tmp = malloc (sizeof(char) * (totlen + 1));
+ tmp = malloc (totlen + 1);
strcpy (tmp, user);
strcat (tmp, ":");
if (password != NULL)
@@ -667,6 +664,8 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
int use_proxy;
int proxyport;
int mpegurl_redirect = 0;
+ char auth[BUFSIZE];
+ char proxyauth[BUFSIZE];
use_proxy = this_class->proxyhost && strlen(this_class->proxyhost);
@@ -674,7 +673,7 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
if (this_class->proxyuser && strlen(this_class->proxyuser)) {
if (http_plugin_basicauth (this_class->proxyuser,
this_class->proxypassword,
- this->proxyauth, BUFSIZE)) {
+ proxyauth, BUFSIZE)) {
_x_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "proxy error", NULL);
return 0;
}
@@ -693,7 +692,7 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
this->port = DEFAULT_HTTP_PORT;
if (this->user && strlen(this->user)) {
- if (http_plugin_basicauth (this->user, this->password, this->auth, BUFSIZE)) {
+ if (http_plugin_basicauth (this->user, this->password, auth, BUFSIZE)) {
_x_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "basic auth error", NULL);
return -1;
}
@@ -776,12 +775,12 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
buflen = strlen(this->buf);
if (this_class->proxyuser && strlen(this_class->proxyuser)) {
snprintf (this->buf + buflen, BUFSIZE - buflen,
- "Proxy-Authorization: Basic %s\015\012", this->proxyauth);
+ "Proxy-Authorization: Basic %s\015\012", proxyauth);
buflen = strlen(this->buf);
}
if (this->user && strlen(this->user)) {
snprintf (this->buf + buflen, BUFSIZE - buflen,
- "Authorization: Basic %s\015\012", this->auth);
+ "Authorization: Basic %s\015\012", auth);
buflen = strlen(this->buf);
}