Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
-fixed file transmission with POST. The only usage was in ranking transmission, therefore: -fixed ranking transmission
orbiter8fe39ebd7488
diff --git a/source/de/anomic/http/JakartaCommonsHttpClient.java b/source/de/anomic/http/JakartaCommonsHttpClient.javaindex 9f6f55041..0320e1a40 100644--- a/source/de/anomic/http/JakartaCommonsHttpClient.java+++ b/source/de/anomic/http/JakartaCommonsHttpClient.java@@ -25,15 +25,12 @@// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USApackage de.anomic.http;-import java.io.BufferedInputStream;-import java.io.BufferedOutputStream;-import java.io.ByteArrayOutputStream;-import java.io.File;-import java.io.FileInputStream;import java.io.IOException;import java.io.InputStream;+import java.util.ArrayList;import java.util.Date;import java.util.HashMap;+import java.util.List;import java.util.Map;import org.apache.commons.httpclient.ConnectMethod;@@ -52,14 +49,12 @@ import org.apache.commons.httpclient.methods.multipart.ByteArrayPartSource;import org.apache.commons.httpclient.methods.multipart.FilePart;import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;import org.apache.commons.httpclient.methods.multipart.Part;-import org.apache.commons.httpclient.methods.multipart.StringPart;import org.apache.commons.httpclient.params.HttpMethodParams;import org.apache.commons.httpclient.protocol.Protocol;import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;import org.apache.commons.httpclient.util.DateUtil;import de.anomic.kelondro.kelondroBase64Order;-import de.anomic.server.serverFileUtils;import de.anomic.server.logging.serverLog;import de.anomic.yacy.yacyVersion;@@ -69,7 +64,7 @@ import de.anomic.yacy.yacyVersion;* @author danielr**/-public class JakartaCommonsHttpClient {+public class JakartaCommonsHttpClient {/*** "the HttpClient instance and connection manager should be shared among all threads for maximum efficiency."* (Concurrent execution of HTTP methods, http://hc.apache.org/httpclient-3.x/performance.html)@@ -231,7 +226,7 @@ public class JakartaCommonsHttpClient {* @return Instance of response with the content.* @throws IOException*/- public JakartaCommonsHttpResponse POST(final String uri, final Map<String, ?> files) throws IOException {+ public JakartaCommonsHttpResponse POST(final String uri, final List<Part> files) throws IOException {assert uri != null : "precondition violated: uri != null";final PostMethod post = new PostMethod(uri);@@ -239,8 +234,9 @@ public class JakartaCommonsHttpClient {if (files != null) {parts = new Part[files.size()];int i = 0;- for (final String key : files.keySet()) {- Object value = files.get(key);+ for (final Part part : files) {+ parts[i] = part;+ /*if (value instanceof File) {final File file = (File) value;if (file.isFile() && file.canRead()) {@@ -263,6 +259,7 @@ public class JakartaCommonsHttpClient {throw new IOException("cannot POST data: " + msg);// break; // post nothing is not what is expected by the caller}+ */i++;}} else {@@ -488,9 +485,9 @@ public class JakartaCommonsHttpClient {try {if (args.length > 1 && "post".equals(args[1])) {// POST- final HashMap<String, byte[]> files = new HashMap<String, byte[]>();- files.put("myfile.txt", "this is not a file ;)".getBytes());- files.put("anotherfile.raw", "this is not a binary file ;)".getBytes());+ final ArrayList<Part> files = new ArrayList<Part>();+ files.add(new FilePart("myfile.txt", new ByteArrayPartSource("myfile.txt", "this is not a file ;)".getBytes())));+ files.add(new FilePart("anotherfile.raw", new ByteArrayPartSource("anotherfile.raw", "this is not a binary file ;)".getBytes())));System.out.println("POST " + files.size() + " elements to " + url);final JakartaCommonsHttpClient client = new JakartaCommonsHttpClient(1000, null, null);resp = client.POST(url, files);diff --git a/source/de/anomic/http/httpdProxyHandler.java b/source/de/anomic/http/httpdProxyHandler.javaindex 8e294620e..4ed2d5e44 100644--- a/source/de/anomic/http/httpdProxyHandler.java+++ b/source/de/anomic/http/httpdProxyHandler.java@@ -1128,7 +1128,7 @@ public final class httpdProxyHandler {// respondHeader(respond, res.status, res.responseHeader);// Saver.writeContent(res, (chunked != null) ? new BufferedOutputStream(chunked) : new BufferedOutputStream(respond));/*- // *** (�bernommen aus Saver-Klasse: warum ist dies hier die einzige Methode, die einen OutputStream statt einen Writer benutzt?)+ // *** (Uebernommen aus Saver-Klasse: warum ist dies hier die einzige Methode, die einen OutputStream statt einen Writer benutzt?)try {serverFileUtils.copyToStream(new BufferedInputStream(res.getDataAsStream()), (chunked != null) ? new BufferedOutputStream(chunked) : new BufferedOutputStream(respond));} finally {diff --git a/source/de/anomic/kelondro/kelondroEcoTable.java b/source/de/anomic/kelondro/kelondroEcoTable.javaindex 85f77c299..dcfc1d20a 100644--- a/source/de/anomic/kelondro/kelondroEcoTable.java+++ b/source/de/anomic/kelondro/kelondroEcoTable.java@@ -194,12 +194,11 @@ public class kelondroEcoTable implements kelondroIndex {removeInFile(top.intValue());}}-- try {+ /* try {assert file.size() == index.size() + doubles.size() + fail : "file.size() = " + file.size() + ", index.size() = " + index.size() + ", doubles.size() = " + doubles.size() + ", fail = " + fail + ", i = " + i;} catch (IOException e) {e.printStackTrace();- }+ }*/} catch (FileNotFoundException e) {// should never happene.printStackTrace();diff --git a/source/de/anomic/yacy/yacyClient.java b/source/de/anomic/yacy/yacyClient.javaindex 5e6640771..9c9d14ac1 100644--- a/source/de/anomic/yacy/yacyClient.java+++ b/source/de/anomic/yacy/yacyClient.java@@ -49,9 +49,15 @@ import java.io.UnsupportedEncodingException;import java.util.ArrayList;import java.util.HashMap;import java.util.Iterator;+import java.util.List;import java.util.Map;import java.util.TreeMap;+import org.apache.commons.httpclient.methods.multipart.ByteArrayPartSource;+import org.apache.commons.httpclient.methods.multipart.FilePart;+import org.apache.commons.httpclient.methods.multipart.Part;+import org.apache.commons.httpclient.methods.multipart.StringPart;+import de.anomic.http.HttpClient;import de.anomic.http.JakartaCommonsHttpClient;import de.anomic.http.JakartaCommonsHttpResponse;@@ -76,7 +82,6 @@ import de.anomic.server.serverByteBuffer;import de.anomic.server.serverCodings;import de.anomic.server.serverCore;import de.anomic.server.serverDomains;-import de.anomic.server.serverObjects;import de.anomic.tools.crypt;import de.anomic.tools.nxTools;import de.anomic.xml.rssReader;@@ -103,11 +108,12 @@ public final class yacyClient {// this works of course only if we know the other peer's hash.HashMap<String, String> result = null;- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), null);+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), null, salt);for (int retry = 0; retry < 4; retry++) try {// generate request- post.put("count", "20");- post.put("seed", yacyCore.seedDB.mySeed().genSeedStr(post.get("key", "")));+ post.add(new StringPart("count", "20"));+ post.add(new StringPart("seed", yacyCore.seedDB.mySeed().genSeedStr(salt)));yacyCore.log.logFine("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' contacting peer at " + address);// send requestbyte[] content = wput("http://" + address + "/yacy/hello.html", yacySeed.b64Hash2hexHash(otherHash) + ".yacyh", post);@@ -140,7 +146,7 @@ public final class yacyClient {if (seed.length() > yacySeed.maxsize) {yacyCore.log.logInfo("hello/client 0: rejected contacting seed; too large (" + seed.length() + " > " + yacySeed.maxsize + ")");} else {- otherPeer = yacySeed.genRemoteSeed(seed, post.get("key", ""), true);+ otherPeer = yacySeed.genRemoteSeed(seed, salt, true);if (otherPeer == null || !otherPeer.hash.equals(otherHash)) {yacyCore.log.logFine("yacyClient.publishMySeed: consistency error: other peer '" + ((otherPeer==null)?"unknown":otherPeer.getName()) + "' wrong");return -1; // no success@@ -228,7 +234,7 @@ public final class yacyClient {if (seedStr.length() > yacySeed.maxsize) {yacyCore.log.logInfo("hello/client: rejected contacting seed; too large (" + seedStr.length() + " > " + yacySeed.maxsize + ")");} else {- if (yacyCore.peerActions.peerArrival(yacySeed.genRemoteSeed(seedStr, post.get("key", ""), true), (i == 1))) count++;+ if (yacyCore.peerActions.peerArrival(yacySeed.genRemoteSeed(seedStr, salt, true), (i == 1))) count++;}}return count;@@ -243,7 +249,7 @@ public final class yacyClient {* @return response body* @throws IOException*/- private static byte[] wput(final String url, String vhost, final Map<String, ?> post) throws IOException {+ private static byte[] wput(final String url, String vhost, final List<Part> post) throws IOException {return wput(url, vhost, post, 10000);}/**@@ -256,7 +262,7 @@ public final class yacyClient {* @return response body* @throws IOException*/- private static byte[] wput(final String url, String vhost, final Map<String, ?> post, final int timeout) throws IOException {+ private static byte[] wput(final String url, String vhost, final List<Part> post, final int timeout) throws IOException {JakartaCommonsHttpClient client = new JakartaCommonsHttpClient(timeout, null, null);client.setProxy(proxyConfig());@@ -288,18 +294,19 @@ public final class yacyClient {* @return* @throws IOException*/- private static byte[] postToFile(final yacySeed target, final String filename, final serverObjects post) throws IOException {+ private static byte[] postToFile(final yacySeed target, final String filename, final List<Part> post) throws IOException {return wput("http://" + target.getClusterAddress() + "/yacy/" + filename, target.getHexHash() + ".yacyh", post);}- private static byte[] postToFile(final String targetHash, final String filename, final serverObjects post) throws IOException {+ private static byte[] postToFile(final String targetHash, final String filename, final List<Part> post) throws IOException {return wput("http://" + targetAddress(targetHash) + "/yacy/" + filename, yacySeed.b64Hash2hexHash(targetHash)+ ".yacyh", post);}public static yacySeed querySeed(yacySeed target, String seedHash) {// prepare request- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash);- post.put("object", "seed");- post.put("env", seedHash);+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash, salt);+ post.add(new StringPart("object", "seed"));+ post.add(new StringPart("env", seedHash));// send requesttry {@@ -308,7 +315,7 @@ public final class yacyClient {if (result == null || result.size() == 0) { return null; }//final Date remoteTime = yacyCore.parseUniversalDate((String) result.get(yacySeed.MYTIME)); // read remote time- return yacySeed.genRemoteSeed((String) result.get("response"), post.get("key", ""), true);+ return yacySeed.genRemoteSeed((String) result.get("response"), salt, true);} catch (Exception e) {yacyCore.log.logSevere("yacyClient.querySeed error:" + e.getMessage());return null;@@ -317,10 +324,11 @@ public final class yacyClient {public static int queryRWICount(yacySeed target, String wordHash) {// prepare request- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash);- post.put("object", "rwicount");- post.put("ttl", "0");- post.put("env", wordHash);+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash, salt);+ post.add(new StringPart("object", "rwicount"));+ post.add(new StringPart("ttl", "0"));+ post.add(new StringPart("env", wordHash));// send requesttry {@@ -340,10 +348,11 @@ public final class yacyClient {if (yacyCore.seedDB.mySeed() == null) return -1;// prepare request- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash);- post.put("object", "lurlcount");- post.put("ttl", "0");- post.put("env", "");+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash, salt);+ post.add(new StringPart("object", "lurlcount"));+ post.add(new StringPart("ttl", "0"));+ post.add(new StringPart("env", ""));// send requesttry {@@ -371,9 +380,10 @@ public final class yacyClient {if (yacyCore.seedDB.mySeed() == null) return null;// prepare request- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash);- post.put("call", "remotecrawl");- post.put("count", count);+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash, salt);+ post.add(new StringPart("call", "remotecrawl"));+ post.add(new StringPart("count", Integer.toString(count)));// send requesttry {@@ -433,22 +443,23 @@ public final class yacyClient {// duetime : maximum time that a peer should spent to create a result// prepare request- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash);- post.put("myseed", yacyCore.seedDB.mySeed().genSeedStr(post.get("key", "")));- post.put("count", Math.max(10, count));- post.put("resource", ((global) ? "global" : "local"));- post.put("partitions", partitions);- post.put("query", wordhashes);- post.put("exclude", excludehashes);- post.put("duetime", 1000);- post.put("urls", urlhashes);- post.put("prefer", prefer);- post.put("filter", filter);- post.put("ttl", "0");- post.put("maxdist", maxDistance);- post.put("profile", crypt.simpleEncode(rankingProfile.toExternalString()));- post.put("constraint", (constraint == null) ? "" : constraint.exportB64());- if (abstractCache != null) post.put("abstracts", "auto");+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash, salt);+ post.add(new StringPart("myseed", yacyCore.seedDB.mySeed().genSeedStr(salt)));+ post.add(new StringPart("count", Integer.toString(Math.max(10, count))));+ post.add(new StringPart("resource", ((global) ? "global" : "local")));+ post.add(new StringPart("partitions", Integer.toString(partitions)));+ post.add(new StringPart("query", wordhashes));+ post.add(new StringPart("exclude", excludehashes));+ post.add(new StringPart("duetime", "1000"));+ post.add(new StringPart("urls", urlhashes));+ post.add(new StringPart("prefer", prefer));+ post.add(new StringPart("filter", filter));+ post.add(new StringPart("ttl", "0"));+ post.add(new StringPart("maxdist", Integer.toString(maxDistance)));+ post.add(new StringPart("profile", crypt.simpleEncode(rankingProfile.toExternalString())));+ post.add(new StringPart("constraint", (constraint == null) ? "" : constraint.exportB64()));+ if (abstractCache != null) post.add(new StringPart("abstracts", "auto"));final long timestamp = System.currentTimeMillis();// send request@@ -644,8 +655,9 @@ public final class yacyClient {if (yacyCore.seedDB == null || yacyCore.seedDB.mySeed() == null) { return null; }// prepare request- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), targetHash);- post.put("process", "permission");+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), targetHash, salt);+ post.add(new StringPart("process", "permission"));// send requesttry {@@ -663,14 +675,15 @@ public final class yacyClient {// this post a message to the remote message board// prepare request- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), targetHash);- post.put("process", "post");- post.put("myseed", yacyCore.seedDB.mySeed().genSeedStr(post.get("key", "")));- post.put("subject", subject);+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), targetHash, salt);+ post.add(new StringPart("process", "post"));+ post.add(new StringPart("myseed", yacyCore.seedDB.mySeed().genSeedStr(salt)));+ post.add(new StringPart("subject", subject));try {- post.put("message", new String(message, "UTF-8"));+ post.add(new StringPart("message", new String(message, "UTF-8")));} catch (UnsupportedEncodingException e) {- post.put("message", new String(message));+ post.add(new StringPart("message", new String(message)));}// send request@@ -701,12 +714,13 @@ public final class yacyClient {public static HashMap<String, String> transferPermission(String targetAddress, long filesize, String filename) {// prepare request- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), null);- post.put("process", "permission");- post.put("purpose", "crcon");- post.put("filename", filename);- post.put("filesize", Long.toString(filesize));- post.put("can-send-protocol", "http");+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), null, salt);+ post.add(new StringPart("process", "permission"));+ post.add(new StringPart("purpose", "crcon"));+ post.add(new StringPart("filename", filename));+ post.add(new StringPart("filesize", Long.toString(filesize)));+ post.add(new StringPart("can-send-protocol", "http"));// send requesttry {@@ -725,15 +739,14 @@ public final class yacyClient {public static HashMap<String, String> transferStore(String targetAddress, String access, String filename, byte[] file) {// prepare request- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), null);- post.put("process", "store");- post.put("purpose", "crcon");- post.put("filename", filename);- post.put("filesize", Long.toString(file.length));- post.put("md5", serverCodings.encodeMD5Hex(file));- post.put("access", access);- HashMap<String, byte[]> files = new HashMap<String, byte[]>();- files.put("filename", file);+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), null, salt);+ post.add(new StringPart("process", "store"));+ post.add(new StringPart("purpose", "crcon"));+ post.add(new StringPart("filesize", Long.toString(file.length)));+ post.add(new StringPart("md5", serverCodings.encodeMD5Hex(file)));+ post.add(new StringPart("access", access));+ post.add(new FilePart("filename", new ByteArrayPartSource(filename, file)));// send requesttry {@@ -799,13 +812,14 @@ public final class yacyClient {*/// prepare request- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash);- post.put("process", process);- post.put("urlhash", ((entry == null) ? "" : entry.hash()));- post.put("result", result);- post.put("reason", reason);- post.put("wordh", wordhashes);- post.put("lurlEntry", ((entry == null) ? "" : crypt.simpleEncode(entry.toString(), post.get("key", ""))));+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), target.hash, salt);+ post.add(new StringPart("process", process));+ post.add(new StringPart("urlhash", ((entry == null) ? "" : entry.hash())));+ post.add(new StringPart("result", result));+ post.add(new StringPart("reason", reason));+ post.add(new StringPart("wordh", wordhashes));+ post.add(new StringPart("lurlEntry", ((entry == null) ? "" : crypt.simpleEncode(entry.toString(), salt))));// determining target addressfinal String address = target.getClusterAddress();@@ -917,13 +931,14 @@ public final class yacyClient {if (address == null) { return null; }// prepare post values- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), targetSeed.hash);+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), targetSeed.hash, salt);// enabling gzip compression for post request bodyif ((gzipBody) && (targetSeed.getVersion() >= yacyVersion.YACY_SUPPORTS_GZIP_POST_REQUESTS)) {// TODO generate gzip-Header (and stream?)}- post.put("wordc", Integer.toString(indexes.length));+ post.add(new StringPart("wordc", Integer.toString(indexes.length)));int indexcount = 0;final StringBuffer entrypost = new StringBuffer(indexes.length*73);@@ -948,8 +963,8 @@ public final class yacyClient {return result;}- post.put("entryc", indexcount);- post.put("indexes", entrypost.toString());+ post.add(new StringPart("entryc", Integer.toString(indexcount)));+ post.add(new StringPart("indexes", entrypost.toString()));try {final byte[] content = wput("http://" + address + "/yacy/transferRWI.html", targetSeed.getHexHash() + ".yacyh", post);final ArrayList<String> v = nxTools.strings(content, "UTF-8");@@ -974,7 +989,8 @@ public final class yacyClient {if (address == null) { return null; }// prepare post values- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), targetSeed.hash);+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), targetSeed.hash, salt);// enabling gzip compression for post request bodyif ((gzipBody) && (targetSeed.getVersion() >= yacyVersion.YACY_SUPPORTS_GZIP_POST_REQUESTS)) {@@ -988,13 +1004,13 @@ public final class yacyClient {if (urls[i] != null) {resource = urls[i].toString();if (resource != null) {- post.put("url" + urlc, resource);+ post.add(new StringPart("url" + urlc, resource));urlPayloadSize += resource.length();urlc++;}}}- post.put("urlc", urlc);+ post.add(new StringPart("urlc", Integer.toString(urlc)));try {final byte[] content = wput("http://" + address + "/yacy/transferURL.html", targetSeed.getHexHash() + ".yacyh", post);final ArrayList<String> v = nxTools.strings(content, "UTF-8");@@ -1016,7 +1032,8 @@ public final class yacyClient {public static HashMap<String, String> getProfile(yacySeed targetSeed) {// this post a message to the remote message board- final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), targetSeed.hash);+ final String salt = crypt.randomSalt();+ final List<Part> post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), targetSeed.hash, salt);String address = targetSeed.getClusterAddress();if (address == null) { address = "localhost:8080"; }diff --git a/source/de/anomic/yacy/yacyNetwork.java b/source/de/anomic/yacy/yacyNetwork.javaindex 9764f3c4b..d22b30b8b 100644--- a/source/de/anomic/yacy/yacyNetwork.java+++ b/source/de/anomic/yacy/yacyNetwork.java@@ -27,14 +27,18 @@package de.anomic.yacy;+import java.util.ArrayList;import java.util.Date;+import java.util.List;++import org.apache.commons.httpclient.methods.multipart.Part;+import org.apache.commons.httpclient.methods.multipart.StringPart;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverCodings;import de.anomic.server.serverDate;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;-import de.anomic.tools.crypt;public class yacyNetwork {@@ -67,23 +71,22 @@ public class yacyNetwork {return false;}- public static final serverObjects basicRequestPost(serverSwitch<?> env, String targetHash) {+ public static final List<Part> basicRequestPost(serverSwitch<?> env, String targetHash, String salt) {// put in all the essentials for routing and network authentification// generate a session key- serverObjects post = new serverObjects();- final String salt = crypt.randomSalt();- post.put("key", salt);+ ArrayList<Part> post = new ArrayList<Part>();+ post.add(new StringPart("key", salt));// just standard identification essentials- post.put("iam", yacyCore.seedDB.mySeed().hash);- if (targetHash != null) post.put("youare", targetHash);+ post.add(new StringPart("iam", yacyCore.seedDB.mySeed().hash));+ if (targetHash != null) post.add(new StringPart("youare", targetHash));// time information for synchronization- post.put("mytime", serverDate.formatShortSecond(new Date()));- post.put("myUTC", System.currentTimeMillis());+ post.add(new StringPart("mytime", serverDate.formatShortSecond(new Date())));+ post.add(new StringPart("myUTC", Long.toString(System.currentTimeMillis())));// network identification- post.put("network.unit.name", plasmaSwitchboard.getSwitchboard().getConfig("network.unit.name", yacySeed.DFLT_NETWORK_UNIT));+ post.add(new StringPart("network.unit.name", plasmaSwitchboard.getSwitchboard().getConfig("network.unit.name", yacySeed.DFLT_NETWORK_UNIT)));// authentification essentialsString authentificationControl = env.getConfig("network.unit.protocol.control", "uncontrolled");@@ -93,7 +96,7 @@ public class yacyNetwork {// generate an authentification essential using the salt, the iam-hash and the network magicString magic = env.getConfig("network.unit.protocol.request.authentification.essentials", "");String md5 = serverCodings.encodeMD5Hex(salt + yacyCore.seedDB.mySeed().hash + magic);- post.put("magicmd5", md5);+ post.add(new StringPart("magicmd5", md5));}}