Skip to content

Commit

Permalink
IPv6 Fix for push interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Orbiter committed Feb 4, 2015
1 parent fe50e5a commit 974d58b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion htroot/api/push_p.java
Expand Up @@ -20,6 +20,7 @@

import java.net.MalformedURLException;
import java.util.Date;
import java.util.Set;

import net.yacy.cora.document.encoding.ASCII;
import net.yacy.cora.document.encoding.UTF8;
Expand Down Expand Up @@ -120,7 +121,11 @@ public static serverObjects respond(@SuppressWarnings("unused") final RequestHea
sb.indexingDocumentProcessor.enQueue(in);
}
prop.put("mode_results_" + i + "_success", "1");
prop.put("mode_results_" + i + "_success_message", "http://" + Domains.myPublicLocalIP().getHostAddress() + ":" + sb.getLocalPort("port", 8090) + "/solr/select?q=sku:%22" + u + "%22");

Set<String> ips = Domains.myPublicIPs();
String address = ips.size() == 0 ? "127.0.0.1" : ips.iterator().next();
if (address == null) address = "127.0.0.1";
prop.put("mode_results_" + i + "_success_message", "http://" + address + ":" + sb.getLocalPort("port", 8090) + "/solr/select?q=sku:%22" + u + "%22");
countsuccess++;
} catch (MalformedURLException e) {
e.printStackTrace();
Expand Down

0 comments on commit 974d58b

Please sign in to comment.