diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-19 01:09:39 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-19 01:09:39 +0100 |
commit | fedec814a0af828f9c4e97ed49cdb727e0d64ad0 (patch) | |
tree | 6614288d9f0937b640d0efcb757a6ea13bac7a6d /src/input/input_http.c | |
parent | 5c2f96797e1ad0c9e1e930fd86941fcec27abdc4 (diff) | |
parent | 64596f317f7d03ed1f3e747cd2b0664b1d4f6535 (diff) | |
download | xine-lib-fedec814a0af828f9c4e97ed49cdb727e0d64ad0.tar.gz xine-lib-fedec814a0af828f9c4e97ed49cdb727e0d64ad0.tar.bz2 |
Merge from 1.2 branch.
Diffstat (limited to 'src/input/input_http.c')
-rw-r--r-- | src/input/input_http.c | 17 |
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); } |