From 7e670894d9a608cc17c43f90dba7c35a6c9d8f86 Mon Sep 17 00:00:00 2001 From: theli Date: Fri, 25 Nov 2005 00:40:35 +0000 Subject: [PATCH] *) Suppressing stackTraces in proxyError message for "connect timed out" errors See: http://www.yacy-forum.de/viewtopic.php?t=1504 *) Increasing default http client timeout git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1129 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/http/httpd.java | 2 +- source/de/anomic/http/httpdProxyHandler.java | 5 ++++- yacy.init | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.java index 3c3f76057..927d4513f 100644 --- a/source/de/anomic/http/httpd.java +++ b/source/de/anomic/http/httpd.java @@ -1084,7 +1084,7 @@ public final class httpd implements serverHandler { switch (errorcase) { case 4: - tp.put("errorMessageType_detailedErrorMsg",(detailedErrorMsgText==null)?"":detailedErrorMsgText); + tp.put("errorMessageType_detailedErrorMsg",(detailedErrorMsgText==null)?"":detailedErrorMsgText.replaceAll("\n","
")); break; case 5: tp.put("errorMessageType_file",(detailedErrorMsgFile==null)?"":detailedErrorMsgFile); diff --git a/source/de/anomic/http/httpdProxyHandler.java b/source/de/anomic/http/httpdProxyHandler.java index 97f942172..7982f61c5 100644 --- a/source/de/anomic/http/httpdProxyHandler.java +++ b/source/de/anomic/http/httpdProxyHandler.java @@ -74,6 +74,7 @@ import java.net.ConnectException; import java.net.MalformedURLException; import java.net.NoRouteToHostException; import java.net.Socket; +import java.net.SocketTimeoutException; import java.net.URL; import java.net.UnknownHostException; import java.util.Date; @@ -1295,7 +1296,9 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt } else if (e instanceof NoRouteToHostException) { errorMessage = "No route to destination host"; } else if (e instanceof UnknownHostException) { - errorMessage = "IP address of the destination host could not be determined"; + errorMessage = "IP address of the destination host could not be determined"; + } else if (e instanceof SocketTimeoutException) { + errorMessage = "Unable to establish a connection to the destination host. Connect timed out."; } else { String exceptionMsg = e.getMessage(); if ((exceptionMsg != null) && (exceptionMsg.indexOf("Corrupt GZIP trailer") >= 0)) { diff --git a/yacy.init b/yacy.init index 75a3c0bfc..0a4c7c0b7 100644 --- a/yacy.init +++ b/yacy.init @@ -19,7 +19,7 @@ port = 8080 # since this applies only to the client-proxy connection, # it can be rather short # milliseconds -clientTimeout = 8000 +clientTimeout = 30000 # maximal number of httpd sessions # a client may open several connections at one, and the httpdMaxActiveSessions value sets