Caldav: do not try to access inbox on shared calendar (to avoid 440 login timeout errors and session reset)

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@975 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-03-29 08:52:35 +00:00
parent 37aa6db3f2
commit 5f7226bddf
1 changed files with 11 additions and 7 deletions

View File

@ -421,12 +421,15 @@ public class CaldavConnection extends AbstractConnection {
String ctag = "0";
String etag = "0";
String exchangeFolderPath = request.getExchangeFolderPath(subFolder);
try {
ctag = base64Encode(session.getFolderCtag(exchangeFolderPath));
etag = session.getFolderResourceTag(exchangeFolderPath);
} catch (HttpException e) {
// unauthorized access, probably an inbox on shared calendar
DavGatewayTray.debug(new BundleMessage("LOG_ACCESS_FORBIDDEN", exchangeFolderPath, e.getMessage()));
// do not try to access inbox on shared calendar
if (!session.isSharedFolder(exchangeFolderPath)) {
try {
ctag = base64Encode(session.getFolderCtag(exchangeFolderPath));
etag = session.getFolderResourceTag(exchangeFolderPath);
} catch (HttpException e) {
// unauthorized access, probably an inbox on shared calendar
DavGatewayTray.debug(new BundleMessage("LOG_ACCESS_FORBIDDEN", exchangeFolderPath, e.getMessage()));
}
}
response.startResponse(URIUtil.encodePath(request.getPath(subFolder)));
response.startPropstat();
@ -504,7 +507,8 @@ public class CaldavConnection extends AbstractConnection {
CaldavResponse response = new CaldavResponse(HttpStatus.SC_MULTI_STATUS);
response.startMultistatus();
appendInbox(response, request, null);
if (request.getDepth() == 1 && !Settings.getBooleanProperty("davmail.caldavDisableInbox")) {
// do not try to access inbox on shared calendar
if (!session.isSharedFolder(request.getExchangeFolderPath(null)) && request.getDepth() == 1 && !Settings.getBooleanProperty("davmail.caldavDisableInbox")) {
try {
DavGatewayTray.debug(new BundleMessage("LOG_SEARCHING_CALENDAR_MESSAGES"));
List<ExchangeSession.Event> events = session.getEventMessages(request.getExchangeFolderPath());