Skip to content

Commit

Permalink
*better logging
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4526 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
borg-0300 committed Mar 5, 2008
1 parent 4b0339f commit 3445b1e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions source/de/anomic/http/httpd.java
Expand Up @@ -54,7 +54,6 @@
import java.io.UnsupportedEncodingException;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Arrays;
import java.util.Date;
Expand Down Expand Up @@ -198,16 +197,16 @@ public void initSession(serverCore.Session newsession) throws IOException {
if (this.userAddress.isAnyLocalAddress()) this.clientIP = "localhost";
if (this.clientIP.equals("0:0:0:0:0:0:0:1")) this.clientIP = "localhost";
if (this.clientIP.equals("127.0.0.1")) this.clientIP = "localhost";
String proxyClient = switchboard.getConfig("proxyClient", "*");
String serverClient = switchboard.getConfig("serverClient", "*");
final String proxyClient = switchboard.getConfig("proxyClient", "*");
final String serverClient = switchboard.getConfig("serverClient", "*");

this.allowProxy = (proxyClient.equals("*")) ? true : match(this.clientIP, proxyClient);
this.allowServer = (serverClient.equals("*")) ? true : match(this.clientIP, serverClient);
this.allowYaCyHop = switchboard.getConfigBool("YaCyHop", false);

// check if we want to allow this socket to connect us
if (!(this.allowProxy || this.allowServer || this.allowYaCyHop)) {
String errorMsg = "CONNECTION FROM " + this.userAddress.getHostName() + " FORBIDDEN";
final String errorMsg = "CONNECTION FROM " + this.userAddress.getHostName() + " [" + this.clientIP + "] FORBIDDEN";
this.log.logWarning(errorMsg);
throw new IOException(errorMsg);
}
Expand Down

0 comments on commit 3445b1e

Please sign in to comment.