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

Rémi Denis-Courmont rdenis at simphalempin.com
Sat Jun 7 23:02:33 CEST 2008


Le samedi 7 juin 2008 23:09:31 Dominique Leuenberger, vous avez écrit :
> Addition of patch 0002: fixes up configure.ac to check if proxy.h exists
> and uses it only in this case.

I assume libproxy does not support pkg-config, right?

+       pxProxyFactory *pf = px_proxy_factory_new();
+        if (!pf)
+        {
+               msg_Warn(p_access, "Loading of libproxy failed");

If libproxy actually failed to load, the linker would refuse to open the 
plugin, so we would not reach this. The error message is probably misleading.

+                return 1;
+        }
+       char *buf ; sprintf(buf, "%s://%s", p_access->psz_access, 
p_access->psz_path);

Does the compiler not warn about buf here?

+       msg_Warn(p_access, "asking libproxy about url '%s'", buf);

Don't use msg_Warn() here.

+       char **proxies = px_proxy_factory_get_proxies(pf, buf);
+       if (proxies[0]) 
+       {
+           msg_Warn(p_access, "libproxy suggest to use '%s'", proxies[0]);

Don't use msg_Warn() here.

+           p_sys->b_proxy = true;
+           vlc_UrlParse( &p_sys->proxy, proxies[0], 0);
+       }
+    }

... Where are the resources freed?


-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list