summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2007-05-30 15:58:10 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2007-05-30 15:58:10 +0100
commit17b4d5acdbcfdf069e549ba27b49b8dc89ce2488 (patch)
tree236a1b84f76c459ead39dd8d2d04273eb061a142
parent7e47ddb2c84ddaddfa859d49d336f92f8b6e53d3 (diff)
downloadxine-lib-17b4d5acdbcfdf069e549ba27b49b8dc89ce2488.tar.gz
xine-lib-17b4d5acdbcfdf069e549ba27b49b8dc89ce2488.tar.bz2
Include the WWW-Authenticate header content in the "authentication needed" msg.
-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
*/