[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

access repository via HTTP proxy (patch)

From: Mark Benedetto King <bking_at_answerfriend.com>
Date: 2001-10-17 23:33:30 CEST

If this is a double-post, please accept my apologies.

This patch takes advantage of neon's built-in proxy support.

I used the "http_proxy" environment variable because both
"wget" and "lynx" use it. There's safety in numbers.

It might make sense to add it to the "bootstrap" release, as
well. I needed it in order to make the bootstrap check out
the trunk.

--ben

===================================================================
--- ./subversion/libsvn_ra_dav/.svn/text-base/session.c Wed Oct 17 11:34:54 2001
+++ ./subversion/libsvn_ra_dav/session.c Wed Oct 17 15:30:15 2001
@@ -103,6 +103,7 @@
   ne_session *sess, *sess2;
   struct uri uri = { 0 };
   svn_ra_session_t *ras;
+ char *proxy;
 
   /* Sanity check the URI */
   if (uri_parse(repository, &uri, NULL)
@@ -121,6 +122,26 @@
   /* Create two neon session objects, and set their properties... */
   sess = ne_session_create();
   sess2 = ne_session_create();
+
+ /* Proxy setup must be done early */
+ proxy = getenv("http_proxy");
+ if (proxy != NULL)
+ {
+ struct uri proxy_uri = { 0 };
+ struct uri proxy_uri_default = { port: 80 };
+ if (uri_parse(proxy, &proxy_uri, &proxy_uri_default)
+ || uri.host == NULL)
+ {
+ return svn_error_create(SVN_ERR_RA_ILLEGAL_URL, 0, NULL, pool,
+ "illegal URL for proxy");
+ }
+ if (ne_session_proxy(sess, proxy_uri.host, proxy_uri.port)
+ || ne_session_proxy(sess2, proxy_uri.host, proxy_uri.port))
+ {
+ return svn_error_createf(SVN_ERR_RA_HOSTNAME_LOOKUP, 0, NULL, pool,
+ "Hostname not found: %s", proxy_uri.host);
+ }
+ }
 
 #if 0
   /* #### enable this block for debugging output on stderr. */

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:45 2006

This is an archived mail posted to the Subversion Dev mailing list.