fixed problem with not http client

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5801 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 6504b21cea
commit c0e8ed5461

@ -144,7 +144,7 @@ public final class HTTPLoader {
final httpClient client = new httpClient(socketTimeout, requestHeader);
httpResponse res = null;
//try {
try {
// send request
res = client.GET(entry.url().toString());
@ -237,13 +237,12 @@ public final class HTTPLoader {
sb.crawlQueues.errorURL.newEntry(entry, sb.webIndex.peers().mySeed().hash, new Date(), 1, "wrong http status code " + res.getStatusCode() + ")");
throw new IOException("REJECTED WRONG STATUS TYPE '" + res.getStatusLine() + "' for URL " + entry.url().toString());
}
/*
} finally {
if(res != null) {
// release connection
res.closeStream();
}
}*/
}
return htCache;
}

@ -299,18 +299,6 @@ public class httpClient {
return execute(post);
}
/**
* This method sends several data at once via a POST request (multipart-message)
*
* @param uri
* @param multiparts
* @return
* @throws IOException
*/
public httpResponse POST(final String uri, final List<Part> multiparts) throws IOException {
return POST(uri, multiparts, false);
}
/**
* This method sends several data at once via a POST request (multipart-message), maybe compressed
*
@ -648,7 +636,7 @@ public class httpClient {
"this is not a binary file ;)".getBytes())));
System.out.println("POST " + files.size() + " elements to " + url);
final httpClient client = new httpClient(1000);
resp = client.POST(url, files);
resp = client.POST(url, files, false);
System.out.println("----- Header: -----");
System.out.println(resp.getResponseHeader().toString());
System.out.println("----- Body: -----");
@ -763,11 +751,17 @@ public class httpClient {
final httpClient client = new httpClient(timeout, header);
// do the request
httpResponse response = null;
try {
final httpResponse response = client.GET(uri);
response = client.GET(uri);
return response.getData();
} catch (final IOException e) {
Log.logWarning("HTTPC", "wget(" + uri + ") failed: " + e.getMessage());
} finally {
// release connection
if (response != null) {
response.closeStream();
}
}
return null;
}

Loading…
Cancel
Save