Permalink
Browse files

Restored peer URL host name stripping removed from previous commit.

Still useful for peers with IPv6 addresses.
  • Loading branch information...
luccioman committed Dec 15, 2017
1 parent 17e0045 commit c6e1befbcac9653f93f6c0a0400b97863343d577
Showing with 2 additions and 2 deletions.
  1. +2 −2 source/net/yacy/peers/Protocol.java
@@ -237,7 +237,7 @@ public Post(
} else {
try {
// patch the remote peer address to avoid that remote peers spoof the network with wrong addresses
String host = targetBaseURL.getHost();
String host = Domains.stripToHostName(targetBaseURL.getHost());
InetAddress ie = Domains.dnsResolve(host);
otherPeer = Seed.genRemoteSeed(seed, false, ie.getHostAddress());
if ( !otherPeer.hash.equals(targetHash) ) {
@@ -346,7 +346,7 @@ public Post(
} else {
try {
if ( i == 1 ) {
String host = targetBaseURL.getHost();
String host = Domains.stripToHostName(targetBaseURL.getHost());
InetAddress ia = Domains.dnsResolve(host);
if (ia == null) continue;
host = ia.getHostAddress(); // the actual address of the target as we had been successful when contacting them is patched here

0 comments on commit c6e1bef

Please sign in to comment.