summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/input/input_http.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 12b7f3f35..d1202ae14 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -832,11 +832,10 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
httpcode, httpstatus);
return -7;
} else if (httpcode == 401) {
- _x_message(this->stream, XINE_MSG_AUTHENTICATION_NEEDED, this->mrl, NULL);
xine_log (this->stream->xine, XINE_LOG_MSG,
_("input_http: http status not 2xx: >%d %s<\n"),
httpcode, httpstatus);
- return -8;
+ /* don't return - there may be a WWW-Authenticate header... */
} else if (httpcode == 403) {
_x_message(this->stream, XINE_MSG_PERMISSION_ERROR, this->mrl, NULL);
xine_log (this->stream->xine, XINE_LOG_MSG,
@@ -874,6 +873,10 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
return http_plugin_open(this_gen);
}
+ if (!strncasecmp (this->buf, "WWW-Authenticate: ", 18))
+ strcpy (this->preview, this->buf + 18);
+
+
/* Icecast / ShoutCast Stuff */
if (!strncasecmp(this->buf, TAG_ICY_NAME, sizeof(TAG_ICY_NAME) - 1)) {
_x_meta_info_set(this->stream, XINE_META_INFO_ALBUM,
@@ -933,6 +936,10 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
lprintf ("end of headers\n");
+ if (httpcode == 401)
+ _x_message(this->stream, XINE_MSG_AUTHENTICATION_NEEDED,
+ this->mrl, *this->preview ? this->preview : NULL, NULL);
+
/*
* fill preview buffer
*/