Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

yacybot user agent

orbiterce5274c19410
diff --git a/source/de/anomic/http/httpdProxyHandler.java b/source/de/anomic/http/httpdProxyHandler.java
index 70786c12e..4730f5ae3 100644
--- a/source/de/anomic/http/httpdProxyHandler.java
+++ b/source/de/anomic/http/httpdProxyHandler.java
@@ -127,7 +127,8 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
// private static final HashSet remoteProxyDisallowProxySet = new HashSet();
private static htmlFilterTransformer transformer = null;
- public static final String userAgent = "yacy (" + httpc.systemOST +") yacy.net";
+ public static final String proxyUserAgent = "yacy (" + httpc.systemOST +") yacy.net";
+ public static final String crawlerUserAgent = "yacybot (" + httpc.systemOST +") yacy.net";
private File htRootPath = null;
private static boolean doAccessLogging = false;
@@ -1489,7 +1490,7 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
private String generateUserAgent(httpHeader requestHeaders) {
this.userAgentStr.setLength(0);
- String browserUserAgent = (String) requestHeaders.get(httpHeader.USER_AGENT, userAgent);
+ String browserUserAgent = (String) requestHeaders.get(httpHeader.USER_AGENT, proxyUserAgent);
int pos = browserUserAgent.lastIndexOf(')');
if (pos >= 0) {
this.userAgentStr
diff --git a/source/de/anomic/plasma/plasmaCrawlWorker.java b/source/de/anomic/plasma/plasmaCrawlWorker.java
index d061bec05..d2b20d6a1 100644
--- a/source/de/anomic/plasma/plasmaCrawlWorker.java
+++ b/source/de/anomic/plasma/plasmaCrawlWorker.java
@@ -331,7 +331,7 @@ public final class plasmaCrawlWorker extends Thread {
try {
// create a request header
httpHeader requestHeader = new httpHeader();
- requestHeader.put(httpHeader.USER_AGENT, httpdProxyHandler.userAgent);
+ requestHeader.put(httpHeader.USER_AGENT, httpdProxyHandler.crawlerUserAgent);
requestHeader.put(httpHeader.REFERER, referer);
requestHeader.put(httpHeader.ACCEPT_LANGUAGE, sb.getConfig("crawler.acceptLanguage","en-us,en;q=0.5"));
requestHeader.put(httpHeader.ACCEPT_CHARSET, sb.getConfig("crawler.acceptCharset","ISO-8859-1,utf-8;q=0.7,*;q=0.7"));
diff --git a/source/de/anomic/yacy/yacyPeerActions.java b/source/de/anomic/yacy/yacyPeerActions.java
index fc056588f..1b167d9d7 100644
--- a/source/de/anomic/yacy/yacyPeerActions.java
+++ b/source/de/anomic/yacy/yacyPeerActions.java
@@ -301,7 +301,7 @@ public class yacyPeerActions {
* yacyCore.shortFormatter.format(new Date(ctime))); }
*/
- if (Math.abs(nowUTC0Time - ctimeUTC0) > 3600000) {
+ if (Math.abs(nowUTC0Time - ctimeUTC0) > 60 * 60 * 24 * 1000) {
// the new connection is out-of-age, we reject the connection
yacyCore.log.logFine("connect: rejecting out-dated peer '" + seed.getName() + "' from " + seed.getAddress() + "; nowUTC0=" + nowUTC0Time + ", seedUTC0=" + ctimeUTC0 + ", TimeDiff=" + serverDate.intervalToString(Math.abs(nowUTC0Time - ctimeUTC0)));
return false;
diff --git a/source/de/anomic/yacy/yacySeed.java b/source/de/anomic/yacy/yacySeed.java
index f4a17fd4d..c3015bcea 100644
--- a/source/de/anomic/yacy/yacySeed.java
+++ b/source/de/anomic/yacy/yacySeed.java
@@ -325,9 +325,9 @@ public class yacySeed {
try {
final long t = yacyCore.shortFormatter.parse(get(LASTSEEN, "20040101000000")).getTime();
// the problem here is: getTime applies a time shift according to local time zone:
- // it substracts the local UTF offset, but it should substract the remote UTC offset
- // so we correct it by first adding the local UTF offset and then subtractibg the remote
- // but the time zone was originally the seeds time zone
+ // it substracts the local UTF offset, but it should subtract the remote UTC offset
+ // so we correct it by first adding the local UTF offset and then subtracting the remote
+ // the time zone was originally the seeds time zone
// we correct this here
return t - getUTCDiff() + serverDate.UTCDiff();
} catch (java.text.ParseException e) {