summaryrefslogtreecommitdiff
path: root/src/input/http_helper.c
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2009-10-10 14:50:31 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2009-10-10 14:50:31 +0100
commitac4a311c81c5d01cfbc332d248907bb833ecfed3 (patch)
tree1019df995b3db215778237b5d7cc4cace176eb99 /src/input/http_helper.c
parentc579d6f6fb0fd0075faf02a80be1a24f7f75071a (diff)
parent556f8d0d0799bd05f38cfb454fdb80de85dd2f7c (diff)
downloadxine-lib-ac4a311c81c5d01cfbc332d248907bb833ecfed3.tar.gz
xine-lib-ac4a311c81c5d01cfbc332d248907bb833ecfed3.tar.bz2
Merge from 1.1.
Diffstat (limited to 'src/input/http_helper.c')
-rw-r--r--src/input/http_helper.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/input/http_helper.c b/src/input/http_helper.c
index f4950a084..9bd54cb6e 100644
--- a/src/input/http_helper.c
+++ b/src/input/http_helper.c
@@ -29,8 +29,18 @@
#include <xine/xine_internal.h>
#include "http_helper.h"
+
+const char *_x_url_user_agent (const char *url)
+{
+ if (!strncasecmp (url, "qthttp://", 9))
+ return "QuickTime"; /* needed for Apple trailers */
+ return NULL;
+}
+
int _x_parse_url (char *url, char **proto, char** host, int *port,
- char **user, char **password, char **uri) {
+ char **user, char **password, char **uri,
+ const char **user_agent)
+{
char *start = NULL;
char *authcolon = NULL;
char *at = NULL;
@@ -63,6 +73,9 @@ int _x_parse_url (char *url, char **proto, char** host, int *port,
end = start + strlen(start) - 1;
*proto = strndup(url, start - url);
+ if (user_agent)
+ *user_agent = _x_url_user_agent (url);
+
/* user:password */
start += 3;
at = strchr(start, '@');
@@ -234,7 +247,7 @@ static int check_url(char *url, int ok) {
printf("--------------------------------\n");
printf("url=%s\n", url);
res = _x_parse_url (url,
- &proto, &host, &port, &user, &password, &uri);
+ &proto, &host, &port, &user, &password, &uri, NULL);
if (res) {
printf("proto=%s, host=%s, port=%d, user=%s, password=%s, uri=%s\n",
proto, host, port, user, password, uri);