r18213 - in /packages/unstable/libproxy/debian: changelog patches/50_px-wpad-fallback-env-var.patch

lool at users.alioth.debian.org lool at users.alioth.debian.org
Thu Jan 8 10:52:47 UTC 2009


Author: lool
Date: Thu Jan  8 10:52:47 2009
New Revision: 18213

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=18213
Log:
New patch, 50_px-wpad-fallback-env-var, check PX_WPAD_FALLBACK env var to
decide whether to fall back to wpad:// style autodetection or not,
defaulting to not fallback when the env var isn't set.

Added:
    packages/unstable/libproxy/debian/patches/50_px-wpad-fallback-env-var.patch
Modified:
    packages/unstable/libproxy/debian/changelog

Modified: packages/unstable/libproxy/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/libproxy/debian/changelog?rev=18213&op=diff
==============================================================================
--- packages/unstable/libproxy/debian/changelog (original)
+++ packages/unstable/libproxy/debian/changelog Thu Jan  8 10:52:47 2009
@@ -14,5 +14,8 @@
     - New patch, 70_autotools, split autotools generated files here to force
       them to be applied last and avoid timestamp skews issues.
     Thanks Sébastien Bacher and Ubuntu for the above.
+  * New patch, 50_px-wpad-fallback-env-var, check PX_WPAD_FALLBACK env var to
+    decide whether to fall back to wpad:// style autodetection or not,
+    defaulting to not fallback when the env var isn't set.
 
  -- Emilio Pozuelo Monfort <pochu at ubuntu.com>  Wed, 17 Dec 2008 23:25:40 +0100

Added: packages/unstable/libproxy/debian/patches/50_px-wpad-fallback-env-var.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/libproxy/debian/patches/50_px-wpad-fallback-env-var.patch?rev=18213&op=file
==============================================================================
--- packages/unstable/libproxy/debian/patches/50_px-wpad-fallback-env-var.patch (added)
+++ packages/unstable/libproxy/debian/patches/50_px-wpad-fallback-env-var.patch Thu Jan  8 10:52:47 2009
@@ -1,0 +1,52 @@
+diff -Nur -x '*.orig' -x '*~' libproxy-0.2.3/src/lib/proxy_factory.c libproxy-0.2.3.new/src/lib/proxy_factory.c
+--- libproxy-0.2.3/src/lib/proxy_factory.c	2008-06-05 22:56:15.000000000 +0200
++++ libproxy-0.2.3.new/src/lib/proxy_factory.c	2009-01-08 11:33:28.000000000 +0100
+@@ -514,6 +514,8 @@
+ 	pxConfig *config   = NULL;
+ 	char    **response = px_strsplit("direct://", ";");
+ 	char     *tmp = NULL, *order = NULL, **orderv = NULL;
++	char     *wpad_fallback_env = NULL;
++	int       do_wpad_fallback = 0;         // default to not fall back
+ 	
+ 	// Verify some basic stuff
+ 	if (!self)                    goto do_return;
+@@ -581,9 +583,27 @@
+ 	for (int i=0 ; self->configs && self->configs[i] && !config ; i++)
+ 		config = self->configs[i]->callback(self);
+ 	
++	// check PX_WPAD_FALLBACK env var for an override for the WPAD fall
++	// back mechanism
++	wpad_fallback_env = getenv("PX_WPAD_FALLBACK");
++	if (wpad_fallback_env)
++	{
++		if (!strcmp(wpad_fallback_env, "0")) {
++			do_wpad_fallback = 0;
++		} else if (!strcmp(wpad_fallback_env, "0")) {
++			do_wpad_fallback = 1;
++		}
++	}
++	px_free(wpad_fallback_env);
++
+ 	// No plugin returned a valid config, fall back to 'wpad://'
+ 	if (!config)
+ 	{
++		if (!do_wpad_fallback)
++		{
++			fprintf(stderr, "*** Unable to locate valid config and WPAD fallback disabled! Falling back to direct...\n");
++			goto do_return;
++		}
+ 		fprintf(stderr, "*** Unable to locate valid config! Falling back to auto-detection...\n");
+ 		config         = px_malloc0(sizeof(pxConfig));
+ 		config->url    = px_strdup("wpad://");
+@@ -597,6 +617,11 @@
+ 		  !strcmp (config->url, "wpad://") ||
+ 		  !strcmp (config->url, "direct://")))
+ 	{
++		if (!do_wpad_fallback)
++		{
++			fprintf(stderr, "*** Config plugin returned invalid URL type and WPAD fallback disabled! Falling back to direct...\n");
++			goto do_return;
++		}
+ 		fprintf(stderr, "*** Config plugin returned invalid URL type! Falling back to auto-detection...\n");
+ 		px_free(config->url);
+ 		config->url = px_strdup("wpad://");




More information about the pkg-gnome-commits mailing list