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. --- src/input/input_http.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/input/input_http.c') 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 From 9064cfa92cc82627442ca0a9df20e759b792acc8 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 26 May 2007 03:37:45 +0100 Subject: Shuffle the HTTP input plugin's internal data slightly. --- src/input/input_http.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/input/input_http.c') diff --git a/src/input/input_http.c b/src/input/input_http.c index b3e5a033b..12b7f3f35 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -93,16 +93,18 @@ typedef struct { char preview[MAX_PREVIEW_SIZE]; off_t preview_size; - + + /* 2 spare bytes here */ + + /* NSV */ + unsigned char is_nsv; /* bool */ + /* ShoutCast */ - int shoutcast_mode; + unsigned char shoutcast_mode; /* bool */ int shoutcast_metaint; off_t shoutcast_pos; char *shoutcast_songtitle; - /* NSV */ - int is_nsv; - /* scratch buffer for forward seeking */ char seek_buf[BUFSIZE]; -- cgit v1.2.3