fix yacyRelease download

(http://forum.yacy-websuche.de/viewtopic.php?f=5&t=2920&p=20545#p20545)
better cookie policy

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7014 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
sixcooler 15 years ago
parent 1bfa21f973
commit 39d96abbb5

@ -299,7 +299,7 @@ public final class yacyRelease extends yacyVersion {
try {
if (this.publicKey != null) {
// final byte[] signatureData = Client.wget(this.getUrl().toString() + ".sig", reqHeader, 6000);
final byte[] signatureData = client.GETbytes(this.getUrl().toString());
final byte[] signatureData = client.GETbytes(this.getUrl().toString() + ".sig");
if (signatureData == null) {
Log.logWarning("yacyVersion", "download of signature " + this.getUrl().toString() + " failed. ignoring signature file.");
} else try {

@ -21,7 +21,6 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpHead;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.params.ClientPNames;
import org.apache.http.client.params.CookiePolicy;
import org.apache.http.client.params.HttpClientParams;
import org.apache.http.conn.ClientConnectionManager;
@ -123,12 +122,13 @@ public class Client {
final SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
// cookie policy
HttpClientParams.setCookiePolicy(httpParams, CookiePolicy.BEST_MATCH);
ClientConnectionManager clientConnectionManager = new ThreadSafeClientConnManager(httpParams, schemeRegistry);
httpClient = new DefaultHttpClient(clientConnectionManager, httpParams);
// cookie policy
httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BEST_MATCH);
// ask for gzip
((AbstractHttpClient) httpClient).addRequestInterceptor(new GzipRequestInterceptor());
// uncompress gzip

Loading…
Cancel
Save