From 253833045491a69f36bce52af119a880c7ccdfb5 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Fri, 25 May 2007 02:54:46 +0100 Subject: Add a message code to distinguish between HTTP response codes 401 and 403. This should allow for front ends to do things such as prompt for authentication. --- ChangeLog | 3 +++ include/xine.h.in | 1 + src/input/input_http.c | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 28a795a3f..16c495541 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,9 @@ xine-lib (1.1.90) (Unreleased) FreeType2 and the standard bitmap fonts for OSD. * Replace internal libdts 0.0.2 with libdca 0.0.5, and contextually move it to contrib/libdca to separate from xine's own code. + * Add another message code to allow for auth prompts. Previously, it was + not possible to distinguish between 401 Authentication Requried and 403 + Forbidden. xine-lib (1.1.7) (unreleased) * Support libdca (new name for libdts) by shuffling around the dts.h file. diff --git a/include/xine.h.in b/include/xine.h.in index facee6e31..8425cc17d 100644 --- a/include/xine.h.in +++ b/include/xine.h.in @@ -1932,6 +1932,7 @@ typedef struct { #define XINE_MSG_AUDIO_OUT_UNAVAILABLE 11 /* none */ #define XINE_MSG_PERMISSION_ERROR 12 /* (file name or mrl) */ #define XINE_MSG_FILE_EMPTY 13 /* file is empty */ +#define XINE_MSG_AUTHENTICATION_NEEDED 14 /* (mrl, likely http) */ /* opaque xine_event_queue_t */ typedef struct xine_event_queue_s xine_event_queue_t; diff --git a/src/input/input_http.c b/src/input/input_http.c index 6e8932700..b3e5a033b 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -829,7 +829,13 @@ static int http_plugin_open (input_plugin_t *this_gen ) { _("input_http: http status not 2xx: >%d %s<\n"), httpcode, httpstatus); return -7; - } else if (httpcode == 403 || httpcode == 401) { + } 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; + } else if (httpcode == 403) { _x_message(this->stream, XINE_MSG_PERMISSION_ERROR, this->mrl, NULL); xine_log (this->stream->xine, XINE_LOG_MSG, _("input_http: http status not 2xx: >%d %s<\n"), -- cgit v1.2.3