Skip to content

Commit

Permalink
*) Some cosmetical changes and corrections
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3582 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
rramthun committed Apr 19, 2007
1 parent eeb5d62 commit e6fb642
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 31 deletions.
3 changes: 1 addition & 2 deletions htroot/NetworkPicture.java
Expand Up @@ -50,8 +50,7 @@
import de.anomic.server.serverSwitch;
import de.anomic.ymage.ymageMatrix;

// draw a picture of the yacy network

/** draw a picture of the yacy network */
public class NetworkPicture {

public static ymageMatrix respond(httpHeader header, serverObjects post, serverSwitch env) {
Expand Down
4 changes: 2 additions & 2 deletions locales/de.lng
Expand Up @@ -1039,8 +1039,8 @@ Passive \(disconnected Senior and Principal\)==Passiv (nicht verbundene Senior u
Potential \(Junior\)==Potenziell (Junior)
Network Total==Netzwerk insgesamt
#YaCy Cluster==YaCy Cluster
Indexing Speed: \#\[gppm\]\# Pages Per Minute \(PPM\)==Indexier Geschwindikeit: #[gppm]# Seiten pro Minute (PPM)
Query Frequency: \#\[gqph\]\# Queries Per Hour \(QPH\)==Suchfrequenz: #[gqph]# Suchanfragen pro Minute (QPH)
Indexing Speed: \#\[gppm\]\# Pages Per Minute \(PPM\)==Indexier Geschwindigkeit: #[gppm]# Seiten pro Minute (PPM)
Query Frequency: \#\[gqph\]\# Queries Per Hour \(QPH\)==Suchfrequenz: #[gqph]# Suchanfragen pro Stunde (QPH)
Your Peer:==Ihr Peer:
Version==Version
Own/Other==Eigene/Andere
Expand Down
14 changes: 6 additions & 8 deletions source/de/anomic/data/userDB.java
Expand Up @@ -5,7 +5,7 @@
//(C) 2005, 2006 by Martin Thelian
// Alexander Schier
//
//last change: $LastChangedDate$ by $LastChangedBy: $
//last change: $LastChangedDate$ by $LastChangedBy$
//Revision: $LastChangedRevision$
//
//This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -125,7 +125,7 @@ public String addEntry(Entry entry) {
}
}

/*
/**
* use a ProxyAuth String to authenticate a user
* @param auth a base64 Encoded String, which contains "username:pw".
*/
Expand Down Expand Up @@ -162,11 +162,9 @@ public Entry getUser(String auth, String ip, String cookies){
entry=proxyAuth(auth);
if(entry == null)
entry=cookieAuth(cookies);
if(entry == null)
entry=cookieAuth(cookies);
return entry;
}
/*
/**
* determinate, if a user has Adminrights from a authorisation http-headerfield
* it tests both userDB and oldstyle adminpw.
* @param auth the http-headerline for authorisation
Expand All @@ -175,13 +173,13 @@ public boolean hasAdminRight(String auth, String ip, String cookies){
Entry entry=getUser(auth, ip, cookies);
if(entry != null)
return entry.hasAdminRight();
else if(cookieAdminAuth(cookies))
else if(entry != null && cookieAdminAuth(cookies))
return entry.hasAdminRight();
else
return false;
}

/*
/**
* use a ProxyAuth String to authenticate a user and save the ip/username for ipAuth
* @param auth a base64 Encoded String, which contains "username:pw".
* @param ip an ip.
Expand All @@ -195,7 +193,7 @@ public Entry proxyAuth(String auth, String ip){
this.ipUsers.put(ip, entry.getUserName());
return entry;
}
/*
/**
* authenticate a user by ip, if he had used proxyAuth in the last 10 Minutes
* @param ip the IP of the User
*/
Expand Down
1 change: 1 addition & 0 deletions source/de/anomic/plasma/plasmaGrafics.java
Expand Up @@ -208,6 +208,7 @@ private static void drawNetworkPicture(int width, int height, int passiveLimit,
int count = 0;
int totalCount = 0;
Enumeration e = yacyCore.seedDB.seedsConnected(true, false, null, (float) 0.0);

while (e.hasMoreElements() && count < maxCount) {
seed = (yacySeed) e.nextElement();
if (seed != null) {
Expand Down
26 changes: 9 additions & 17 deletions source/de/anomic/plasma/plasmaHTCache.java
Expand Up @@ -7,7 +7,7 @@
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy: $
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -540,31 +540,23 @@ public static boolean isText(String mimeType) {
public static boolean noIndexingURL(String urlString) {
if (urlString == null) return false;
urlString = urlString.toLowerCase();
// return (
// (urlString.endsWith(".gz")) ||
// (urlString.endsWith(".msi")) ||
// (urlString.endsWith(".doc")) ||
// (urlString.endsWith(".zip")) ||
// (urlString.endsWith(".tgz")) ||
// (urlString.endsWith(".rar")) ||
// (urlString.endsWith(".pdf")) ||
// (urlString.endsWith(".ppt")) ||
// (urlString.endsWith(".xls")) ||
// (urlString.endsWith(".log")) ||
// (urlString.endsWith(".java")) ||
// (urlString.endsWith(".c")) ||
// (urlString.endsWith(".p"))
// );

//http://www.yacy.net/getimage.php?image.png

int idx = urlString.indexOf("?");
if (idx > 0) urlString = urlString.substring(0,idx);

//http://www.yacy.net/getimage.php

idx = urlString.lastIndexOf(".");
if (idx > 0) urlString = urlString.substring(idx+1);

//php

return plasmaParser.mediaExtContains(urlString);
}

/*
/**
* This function moves an old cached object (if it exists) to the new position
*/
private void moveCachedObject(File oldpath, File newpath) {
Expand Down
4 changes: 2 additions & 2 deletions source/de/anomic/yacy/yacySeedDB.java
Expand Up @@ -6,7 +6,7 @@
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy: $
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -535,7 +535,7 @@ public yacySeed lookupByIP(
if (seed != null) {
addressStr = seed.getAddress();
if (addressStr == null) {
serverLog.logWarning("YACY","lookupByIP: address of seed " + seed.getName() + "is null.");
serverLog.logWarning("YACY","lookupByIP: address of seed " + seed.getName() + " is null.");
continue;
}
if ((pos = addressStr.indexOf(":"))!= -1) {
Expand Down

0 comments on commit e6fb642

Please sign in to comment.