Browse Source

Let proxies worry about which target to connect to, v4 or v6.

Change-Id: If346fc78ffb10e4302d129fd16386370398bec1d
Reviewed-on: http://gerrit.dmdirc.com/2971
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.8
Shane Mc Cormack 10 years ago
parent
commit
a7d737936a
1 changed files with 11 additions and 2 deletions
  1. 11
    2
      src/com/dmdirc/parser/irc/IRCParser.java

+ 11
- 2
src/com/dmdirc/parser/irc/IRCParser.java View File

@@ -853,6 +853,15 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
853 853
      * @throws IOException if there is an error.
854 854
      */
855 855
     private Socket findSocket(final URI target, final URI proxy) throws IOException {
856
+        if (proxy != null) {
857
+            // If we have a proxy, let it worry about all this instead.
858
+            //
859
+            // 1) We have no idea what sort of connectivity the proxy has
860
+            // 2) If we do this here, then any DNS-based geo-balancing is
861
+            //    going to be based on our location, not the proxy.
862
+            return newSocket(target, proxy);
863
+        }
864
+
856 865
         URI target6 = null;
857 866
         URI target4 = null;
858 867
 
@@ -884,7 +893,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
884 893
         Exception v6Exception = null;
885 894
         if (target6 != null) {
886 895
             try {
887
-                return newSocket(target6, proxy);
896
+                return newSocket(target6, null);
888 897
             } catch (final IOException ioe) {
889 898
                 if (target4 == null) {
890 899
                     throw ioe;
@@ -896,7 +905,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
896 905
         }
897 906
         if (target4 != null) {
898 907
             try {
899
-                return newSocket(target4, proxy);
908
+                return newSocket(target4, null);
900 909
             } catch (final IOException e2) {
901 910
                 callDebugInfo(DEBUG_SOCKET, "Exception trying to use IPv4: " + e2);
902 911
                 throw e2;

Loading…
Cancel
Save