[vlc-devel] [PATCH] support libproxy for http access

Rémi Denis-Courmont rdenis at simphalempin.com
Sun Jun 8 10:54:20 CEST 2008

Le dimanche 8 juin 2008 11:36:52 Dominique Leuenberger, vous avez écrit :
> Remi,
> Thanks for the comment... as you might have realized I actually have no
> clue about programming :-)
> Nevertheless I tried to update the patch... I give some comments below.

* Please squash fixes with the origin (buggy) patches (git rebase -i ...).

-       char *buf ; sprintf(buf, "%s://%s", p_access->psz_access, 
+       char *buf;
+       buf = (char *) malloc(strlen(p_access->psz_access) + 
strlen(p_access->psz_path) + 3);
+       sprintf(buf, "%s://%s", p_access->psz_access, p_access->psz_path);

Use asprintf().

+       if (proxies[0]) 
+       {
+           msg_Warn(p_access, "libproxy suggest to use '%s'", proxies[0]);
+           p_sys->b_proxy = true;
+           vlc_UrlParse( &p_sys->proxy, proxies[0], 0);

Are you sure this will not cause VLC to fail if libproxy returns direct:// ?

Also, if libproxy return socks:// this will not work. You probably need to 
call var_Create and var_SetString to export the SOCKS settings to 

+       free(buf);
+       free(proxies);

It seems to still leak proxies[0..n]  and the proxy factory.

Rémi Denis-Courmont

More information about the vlc-devel mailing list