Mercurial > mplayer.hg
comparison stream/url.c @ 32534:899d7464d246
Unescape username/password when URL-parsing.
This makes MPlayer handle it teh same way as curl,
and it also is the only method that works with
http_proxy://...http://user:password@...
author | reimar |
---|---|
date | Fri, 12 Nov 2010 07:16:32 +0000 |
parents | b39155e98ac3 |
children | c44141d4e443 |
comparison
equal
deleted
inserted
replaced
32533:c41773445d3b | 32534:899d7464d246 |
---|---|
151 mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed); | 151 mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed); |
152 goto err_out; | 152 goto err_out; |
153 } | 153 } |
154 strncpy( Curl->password, ptr3+1, len2); | 154 strncpy( Curl->password, ptr3+1, len2); |
155 Curl->password[len2]='\0'; | 155 Curl->password[len2]='\0'; |
156 } | 156 url_unescape_string(Curl->password, Curl->password); |
157 } | |
158 url_unescape_string(Curl->username, Curl->username); | |
157 ptr1 = ptr2+1; | 159 ptr1 = ptr2+1; |
158 pos1 = ptr1-escfilename; | 160 pos1 = ptr1-escfilename; |
159 } | 161 } |
160 | 162 |
161 // before looking for a port number check if we have an IPv6 type numeric address | 163 // before looking for a port number check if we have an IPv6 type numeric address |
250 free(url); | 252 free(url); |
251 } | 253 } |
252 | 254 |
253 | 255 |
254 /* Replace escape sequences in an URL (or a part of an URL) */ | 256 /* Replace escape sequences in an URL (or a part of an URL) */ |
255 /* works like strcpy(), but without return argument */ | 257 /* works like strcpy(), but without return argument, |
258 except that outbuf == inbuf is allowed */ | |
256 void | 259 void |
257 url_unescape_string(char *outbuf, const char *inbuf) | 260 url_unescape_string(char *outbuf, const char *inbuf) |
258 { | 261 { |
259 unsigned char c,c1,c2; | 262 unsigned char c,c1,c2; |
260 int i,len=strlen(inbuf); | 263 int i,len=strlen(inbuf); |