Limit redirects to 10 instead of 100

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@508 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-04-07 12:46:26 +00:00
parent e4a985b24a
commit e9dc9eb6b0
1 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.apache.commons.httpclient.params.HttpClientParams;
import org.apache.jackrabbit.webdav.DavException;
import org.apache.jackrabbit.webdav.MultiStatusResponse;
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
@ -23,6 +24,7 @@ import java.util.ArrayList;
*/
public final class DavGatewayHttpClientFacade {
final static String IE_USER_AGENT = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)";
final static int MAX_REDIRECTS = 10;
static MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager;
final static long ONE_MINUTE = 60000;
@ -47,6 +49,7 @@ public final class DavGatewayHttpClientFacade {
// create an HttpClient instance
HttpClient httpClient = new HttpClient();
httpClient.getParams().setParameter(HttpMethodParams.USER_AGENT, IE_USER_AGENT);
httpClient.getParams().setParameter(HttpClientParams.MAX_REDIRECTS, MAX_REDIRECTS);
configureClient(httpClient);
return httpClient;
}
@ -54,6 +57,7 @@ public final class DavGatewayHttpClientFacade {
public static HttpClient getInstance(HttpURL httpURL) throws URIException {
HttpClient httpClient = new HttpClient();
httpClient.getParams().setParameter(HttpMethodParams.USER_AGENT, IE_USER_AGENT);
httpClient.getParams().setParameter(HttpClientParams.MAX_REDIRECTS, MAX_REDIRECTS);
HostConfiguration hostConfig = httpClient.getHostConfiguration();
hostConfig.setHost(httpURL);
UsernamePasswordCredentials hostCredentials =