diff options
author | Thibaut Mattern <tmattern@users.sourceforge.net> | 2004-12-01 22:55:31 +0000 |
---|---|---|
committer | Thibaut Mattern <tmattern@users.sourceforge.net> | 2004-12-01 22:55:31 +0000 |
commit | 589b10571d063b0ae4b0dcc12d4c3a30a3f5fc00 (patch) | |
tree | 65d02e7786d1e0bf7774ff7d9df0e1072bde7114 /src/input/http_helper.c | |
parent | f1ed7f17cf382ae1ce43d865196b369486cb1756 (diff) | |
download | xine-lib-589b10571d063b0ae4b0dcc12d4c3a30a3f5fc00.tar.gz xine-lib-589b10571d063b0ae4b0dcc12d4c3a30a3f5fc00.tar.bz2 |
- handle "uvox://" URLs
- handle stupid Nullsoft URL scheme like :
http://208.53.131.46:9502;stream.nsv
CVS patchset: 7183
CVS date: 2004/12/01 22:55:31
Diffstat (limited to 'src/input/http_helper.c')
-rw-r--r-- | src/input/http_helper.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/input/http_helper.c b/src/input/http_helper.c index f962766e4..3418a1d50 100644 --- a/src/input/http_helper.c +++ b/src/input/http_helper.c @@ -19,7 +19,7 @@ * * URL helper functions * - * $Id: http_helper.c,v 1.3 2004/09/20 19:30:04 valtri Exp $ + * $Id: http_helper.c,v 1.4 2004/12/01 22:55:31 tmattern Exp $ */ #ifdef HAVE_CONFIG_H @@ -38,6 +38,7 @@ int _x_parse_url (char *url, char **proto, char** host, int *port, char *at = NULL; char *portcolon = NULL; char *slash = NULL; + char *semicolon = NULL; char *end = NULL; char *strtol_err = NULL; @@ -68,6 +69,11 @@ int _x_parse_url (char *url, char **proto, char** host, int *port, start += 3; at = strchr(start, '@'); slash = strchr(start, '/'); + + /* stupid Nullsoft URL scheme */ + semicolon = strchr(start, ';'); + if (semicolon && (!slash || (semicolon < slash))) + slash = semicolon; if (at && slash && (at > slash)) at = NULL; @@ -145,10 +151,19 @@ int _x_parse_url (char *url, char **proto, char** host, int *port, /* uri */ start = slash; - if (start) - *uri = strdup(start); - else + if (start) { + /* handle crazy Nullsoft URL scheme */ + if (*start == ';') { + /* ";stream.nsv" => "/;stream.nsv" */ + *uri = malloc(strlen(start) + 2); + *uri[0] = '/'; + strcpy(*uri + 1, start); + } else { + *uri = strdup(start); + } + } else { *uri = strdup("/"); + } return 1; |