[Inteproxy-commits] r40 - trunk

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Apr 11 14:58:39 CEST 2007


Author: bh
Date: 2007-04-11 14:58:39 +0200 (Wed, 11 Apr 2007)
New Revision: 40

Modified:
   trunk/ChangeLog
   trunk/transcoder.py
Log:
* transcoder.py (get_transcoder): Simplify the logic.  We only
need to special case the "old" inteproxy style


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-04-11 10:59:21 UTC (rev 39)
+++ trunk/ChangeLog	2007-04-11 12:58:39 UTC (rev 40)
@@ -1,5 +1,10 @@
 2007-04-11  Bernhard Herzog  <bh at intevation.de>
 
+	* transcoder.py (get_transcoder): Simplify the logic.  We only
+	need to special case the "old" inteproxy style
+
+2007-04-11  Bernhard Herzog  <bh at intevation.de>
+
 	* transcoder.py (get_transcoder): Make "http" the default scheme
 	for the old InteProxy case, so that inteproxy by default simply
 	forwards the requests.

Modified: trunk/transcoder.py
===================================================================
--- trunk/transcoder.py	2007-04-11 10:59:21 UTC (rev 39)
+++ trunk/transcoder.py	2007-04-11 12:58:39 UTC (rev 40)
@@ -204,19 +204,18 @@
     """
     scheme, netloc, path, query, fragment = urlparse.urlsplit(url)
 
-    # If scheme is given, InteProxy is used as a HTTP proxy.
-    if scheme:
-        real_netloc = netloc
-        real_path = path
-    else:
+    # If scheme is given, InteProxy is used as a HTTP proxy, otherwise
+    # it's the old InteProxy approach.  Only the old approach needs
+    # special casing.
+    if not scheme:
+        scheme = "http"
         # determine the remote host encoded in the path
         split_path = path.split("/")
         if not split_path[0]:
             del split_path[0]
-        real_netloc = split_path.pop(0)
-        real_path = "/" + "/".join(split_path)
-        scheme = "http"
+        netloc = split_path.pop(0)
+        path = "/" + "/".join(split_path)
 
-    transcoder_class = transcoder_map.lookup(method, real_netloc, real_path)
+    transcoder_class = transcoder_map.lookup(method, netloc, path)
     return transcoder_class(method,
-                            (scheme, real_netloc, real_path, query, fragment))
+                            (scheme, netloc, path, query, fragment))



More information about the Inteproxy-commits mailing list