summaryrefslogtreecommitdiff
path: root/src/input/input_http.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@users.sourceforge.net>2003-03-17 11:59:41 +0000
committerBastien Nocera <hadess@users.sourceforge.net>2003-03-17 11:59:41 +0000
commitbdbd28a877f462b1b253dd492ab85b6ad195b0ba (patch)
treeb6d1a5fad9d7eaf6e22c685ccd48e7176327bf01 /src/input/input_http.c
parent7f734e68339a364a0d9f5edbf2fd95b4947e97f8 (diff)
downloadxine-lib-bdbd28a877f462b1b253dd492ab85b6ad195b0ba.tar.gz
xine-lib-bdbd28a877f462b1b253dd492ab85b6ad195b0ba.tar.bz2
- support HTTP redirections, streams from live365.com still don't work
though, demuxer problem it seems CVS patchset: 4435 CVS date: 2003/03/17 11:59:41
Diffstat (limited to 'src/input/input_http.c')
-rw-r--r--src/input/input_http.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/input/input_http.c b/src/input/input_http.c
index c525a18fa..7a23530fa 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -653,7 +653,7 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
http_input_plugin_t *this;
char *proxy;
int done,len,linenum;
- int shoutcast = 0;
+ int shoutcast = 0, httpcode;
this = (http_input_plugin_t *) xine_xmalloc(sizeof(http_input_plugin_t));
this->shoutcast_pos = 0;
@@ -821,7 +821,7 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
#endif
if (linenum == 1) {
- int httpver, httpsub, httpcode;
+ int httpver, httpsub;
char httpstatus[BUFSIZE];
if (sscanf(this->buf, "HTTP/%d.%d %d %[^\015\012]", &httpver, &httpsub,
@@ -838,15 +838,12 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
done = 1;
}
}
-
+
if (httpcode >= 300 && httpcode < 400) {
xine_log (this->stream->xine, XINE_LOG_MSG,
- _("input_http: 3xx redirection not implemented: >%d %s<\n"),
+ _("input_http: 3xx redirection: >%d %s<\n"),
httpcode, httpstatus);
- free (this);
- return NULL;
- }
- if (httpcode < 200 || httpcode >= 300) {
+ } else if (httpcode < 200 || httpcode >= 300) {
xine_log (this->stream->xine, XINE_LOG_MSG,
_("input_http: http status not 2xx: >%d %s<\n"),
httpcode, httpstatus);
@@ -865,12 +862,17 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
}
if (!strncasecmp(this->buf, "Location: ", 10)) {
- xine_log (this->stream->xine, XINE_LOG_MSG, _("input_http: Location redirection not implemented\n"));
+ char *href = strdup (this->buf + 10);
+
+#ifdef LOG
+ printf ("input_http: trying to open target of redirection: >%s<\n",
+ href);
+#endif
free (this);
- return NULL;
+ return open_plugin (cls_gen, stream, href);
}
}
-
+
if (len == -1)
done = 1;
else
@@ -908,6 +910,7 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
this->mrlbuf2[3] = ' ';
if (read_shoutcast_header(this)) {
/* problem when reading shoutcast header */
+ printf ("troubles with shoutcast header\n");
free (this);
return NULL;
}