Hi All,

[[[
Use Neon's system_proxy autodetection if no proxy has been explicitly
specified.
]]]

As a notebook user I'm of course using it on different
locations/networks and one thing rather annoying is that subversion only
cares for it's own configuration file when it comes to proxy
connections.

Since version 0.29.0 of libneon, it features a ne_session_system_proxy
API, which allows to transparently have the proxy settings filled, based
on what you have configured in your gnome/kde session (it uses libproxy
in the background for this). Should you happen to run subversion on any
different kind of session, is is falling back to using envvar.

I've been working with subversion the last few days with this
modification and it served me a lot, as I do only have to change my
gnome session's proxy settings now. svn is inheriting them, avoiding the
need to configure this file in plus (one location to rule them all!).

I'd be really glad if you would consider merging this patch (I wrote it
initially for 1.6.12, then later ported to svn trunk, which is slightly
different... I only tested the 1.6.12 version of the patch!).

Both patches are attached here for reference.

Best regards,
Dominique


Index: build/ac-macros/neon.m4
===================================================================
--- build/ac-macros/neon.m4	(revision 1001661)
+++ build/ac-macros/neon.m4	(working copy)
@@ -96,6 +96,11 @@
                            [Define to 1 if you have Neon 0.28 or later.])
       fi
 
+      if test -n ["`echo "$NEON_VERSION" | $EGREP '^0\.(29|3[0-9])\.'`"] ; then
+        AC_DEFINE_UNQUOTED([SVN_NEON_0_29], [1],
+                           [Define to 1 if you have Neon 0.29 or later.])
+      fi
+
       for svn_allowed_neon in $NEON_ALLOWED_LIST; do
         if test -n "`echo "$NEON_VERSION" | grep "^$svn_allowed_neon"`" ||
            test "$svn_allowed_neon" = "any"; then
Index: subversion/libsvn_ra_neon/session.c
===================================================================
--- subversion/libsvn_ra_neon/session.c	(revision 1001661)
+++ subversion/libsvn_ra_neon/session.c	(working copy)
@@ -907,7 +907,18 @@
           }
 #endif
       }
+#ifdef SVN_NEON_0_29
+    else
+      {
+        /* If we do not have any proxy specified for this host and
+           we're running a new enough neon implementation, we use
+           neon's session proxy autodetection (via libproxy). */
+        ne_session_system_proxy(sess, 0);
+        ne_session_system_proxy(sess2, 0);
+      }
+#endif
 
+
     if (!timeout)
       timeout = DEFAULT_HTTP_TIMEOUT;
     ne_set_read_timeout(sess, timeout);
Index: subversion/libsvn_ra_neon/session.c
===================================================================
--- subversion/libsvn_ra_neon/session.c.orig
+++ subversion/libsvn_ra_neon/session.c
@@ -885,6 +885,17 @@ svn_ra_neon__open(svn_ra_session_t *sess
           }
 #endif
       }
+#ifdef SVN_NEON_0_29
+    else
+      {
+        /* If we do not have any proxy specified for this host and
+           we're running a new enough neon implementation, we use
+           neon's session proxy autodetection (via libproxy). */
+        ne_session_system_proxy(sess, 0);
+        ne_session_system_proxy(sess2, 0);
+      }
+#endif
+
 
     if (!timeout)
       timeout = DEFAULT_HTTP_TIMEOUT;
Index: build/ac-macros/neon.m4
===================================================================
--- build/ac-macros/neon.m4.orig
+++ build/ac-macros/neon.m4
@@ -69,6 +69,11 @@ AC_DEFUN(SVN_LIB_NEON,
                            [Define to 1 if you have Neon 0.28 or later.])
       fi
 
+      if test -n ["`echo "$NEON_VERSION" | grep '^0\.29\.'`"] ; then
+        AC_DEFINE_UNQUOTED([SVN_NEON_0_29], [1],
+                           [Define to 1 if you have Neon 0.29 or later.])
+      fi
+
       for svn_allowed_neon in $NEON_ALLOWED_LIST; do
         if test -n "`echo "$NEON_VERSION" | grep "^$svn_allowed_neon"`" ||
            test "$svn_allowed_neon" = "any"; then
@@ -160,6 +165,11 @@ AC_DEFUN(SVN_NEON_CONFIG,
                            [Define to 1 if you have Neon 0.28 or later.])
       fi
 
+      if test -n ["`echo "$NEON_VERSION" | grep '^0\.29\.'`"] ; then
+        AC_DEFINE_UNQUOTED([SVN_NEON_0_29], [1],
+                           [Define to 1 if you have Neon 0.29 or later.])
+      fi
+
       for svn_allowed_neon in $NEON_ALLOWED_LIST; do
         if test -n "`echo "$NEON_VERSION" | grep "^$svn_allowed_neon"`" ||
            test "$svn_allowed_neon" = "any"; then

Reply via email to