mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
Network.html: removed ; from location
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4658 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
parent
319144f4b2
commit
ab330cfdca
|
@ -498,29 +498,29 @@ public class Network {
|
|||
*/
|
||||
private static String parseLocationInUserAgent(final String userAgent) {
|
||||
final String location;
|
||||
|
||||
|
||||
final int firstOpenParenthesis = userAgent.indexOf('(');
|
||||
final int lastSemicolon = userAgent.lastIndexOf(';');
|
||||
final int firstClosedParenthesis = userAgent.indexOf(')');
|
||||
|
||||
if(lastSemicolon > 0) {
|
||||
// ; Location)
|
||||
location = (firstClosedParenthesis > 0) ? userAgent.substring(lastSemicolon, firstClosedParenthesis).trim()
|
||||
: userAgent.substring(lastSemicolon + 1).trim();
|
||||
|
||||
if (lastSemicolon > 0) {
|
||||
// ; Location )
|
||||
location = (firstClosedParenthesis > 0) ? userAgent.substring(lastSemicolon + 1, firstClosedParenthesis)
|
||||
.trim() : userAgent.substring(lastSemicolon + 1).trim();
|
||||
} else {
|
||||
if(firstOpenParenthesis > 0) {
|
||||
if(firstClosedParenthesis > 0) {
|
||||
// (Location)
|
||||
location = userAgent.substring(firstOpenParenthesis, firstClosedParenthesis).trim();
|
||||
if (firstOpenParenthesis > 0) {
|
||||
if (firstClosedParenthesis > 0) {
|
||||
// ( Location )
|
||||
location = userAgent.substring(firstOpenParenthesis + 1, firstClosedParenthesis).trim();
|
||||
} else {
|
||||
// ( Location <end>
|
||||
location = userAgent.substring(firstOpenParenthesis).trim();
|
||||
location = userAgent.substring(firstOpenParenthesis + 1).trim();
|
||||
}
|
||||
} else {
|
||||
location = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return location;
|
||||
}
|
||||
}
|
|
@ -50,8 +50,8 @@ public class HttpFactory {
|
|||
/**
|
||||
* generates a new HttpClient object with given header and timeout
|
||||
*
|
||||
* @param header
|
||||
* @param timeout
|
||||
* @param header used for all HTTP-requests (unless another one is set)
|
||||
* @param timeout in milliseconds
|
||||
* @return
|
||||
*/
|
||||
public static HttpClient newClient(httpHeader header, int timeout) {
|
||||
|
|
|
@ -248,7 +248,7 @@ public final class yacyClient {
|
|||
* @throws IOException
|
||||
*/
|
||||
private static byte[] wput(final String url, String vhost, final Map<String, ?> post) throws IOException {
|
||||
HttpClient client = HttpFactory.newClient(null, 12000);
|
||||
HttpClient client = HttpFactory.newClient(null, 3600000); // abort after 1 hour
|
||||
client.setProxy(proxyConfig());
|
||||
|
||||
// address vhost
|
||||
|
|
Loading…
Reference in New Issue
Block a user