summaryrefslogtreecommitdiff
path: root/src/input/input_http.c
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2003-09-25 13:42:19 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2003-09-25 13:42:19 +0000
commitf70bc36953d83daf54df12a7b83cd169ecaadd11 (patch)
tree995e719e66ca400e6646b427b5a1a2e2b31ad4f9 /src/input/input_http.c
parentaf6491f4959e4a289f0e11fb2c79f3d7ab635601 (diff)
downloadxine-lib-f70bc36953d83daf54df12a7b83cd169ecaadd11.tar.gz
xine-lib-f70bc36953d83daf54df12a7b83cd169ecaadd11.tar.bz2
IPv6 patch from Njål T. Borch <Njaal.Borch@njaal.net>
CVS patchset: 5413 CVS date: 2003/09/25 13:42:19
Diffstat (limited to 'src/input/input_http.c')
-rw-r--r--src/input/input_http.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/input/input_http.c b/src/input/input_http.c
index ea87ccbe7..d785b52ac 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -19,7 +19,7 @@
*
* input plugin for http network streams
*
- * $Id: input_http.c,v 1.63 2003/08/21 00:37:29 miguelfreitas Exp $
+ * $Id: input_http.c,v 1.64 2003/09/25 13:42:19 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -205,7 +205,32 @@ static int http_plugin_parse_url (char *urlbuf, char **user, char **password,
} else
if (host != NULL)
*host = start;
-
+
+#ifdef ENABLE_IPV6
+ // Add support for RFC 2732
+ {
+ char *hostbracket, *hostendbracket;
+
+ hostbracket = strchr(start, '[');
+ if (hostbracket != NULL) {
+
+ hostendbracket = strchr(hostbracket, ']');
+
+ if (hostendbracket != NULL) {
+
+ *hostendbracket = '\0';
+ *host = (hostbracket + 1);
+
+ // Might have a trailing port
+
+ if (*(hostendbracket+1) == ':') {
+ portcolon = (hostendbracket + 1);
+ }
+ }
+ }
+ }
+#endif
+
if (slash != 0)
{
*slash = '\0';