yacybot user agent

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1786 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 3b7e66ab48
commit ce5274c194

@ -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

@ -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"));

@ -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;

@ -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) {

Loading…
Cancel
Save