From b555586cde88c7afa6455e7375800310e4dd7a89 Mon Sep 17 00:00:00 2001 From: mguessan Date: Thu, 21 May 2009 10:47:10 +0000 Subject: [PATCH] Avoid 401 roundtrips git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@577 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index bf74c94e..b966ec73 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -6,6 +6,7 @@ import davmail.exception.DavMailAuthenticationException; import davmail.exception.DavMailException; import davmail.http.DavGatewayHttpClientFacade; import org.apache.commons.httpclient.*; +import org.apache.commons.httpclient.params.HttpClientParams; import org.apache.commons.httpclient.methods.ByteArrayRequestEntity; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.PostMethod; @@ -154,6 +155,8 @@ public class ExchangeSession { httpClient = DavGatewayHttpClientFacade.getInstance(httpURL); + // avoid 401 roundtrips + httpClient.getParams().setParameter(HttpClientParams.PREEMPTIVE_AUTHENTICATION, true); // get webmail root url // providing credentials