[MPlayer-dev-eng] [PATCH] Do not escape authentication information
Clément Bœsch
ubitux at gmail.com
Sat Oct 16 19:48:13 CEST 2010
Hi,
URL are url-encoded and so login/password are if specified
(http_proxy://login:password@...). This causes issues if you try to
authenticate with special characters. I attached a patch to this mail in
order to correct this. 'Hope it will be fine.
Regards,
--
Clément B.
-------------- next part --------------
Index: stream/url.c
===================================================================
--- stream/url.c (revision 32493)
+++ stream/url.c (working copy)
@@ -343,6 +343,21 @@
}
}
+ // Do not escape login:password
+ tmp = strstr(inbuf, "://");
+ if (tmp) {
+ char *slash_ptr, *authsep_ptr;
+
+ tmp += sizeof("://") - 1;
+ slash_ptr = strchr(tmp, '/');
+ authsep_ptr = strchr(tmp, '@');
+ if (authsep_ptr && (!slash_ptr || authsep_ptr < slash_ptr)) {
+ i = authsep_ptr + 1 - inbuf;
+ strncpy(outbuf, inbuf, i);
+ outbuf += i;
+ }
+ }
+
tmp = NULL;
while(i < len) {
// look for the next char that must be kept
More information about the MPlayer-dev-eng
mailing list