1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-01-13 06:28:19 -05:00

Caldav: Send events back to the client after each get on REPORT request (avoid iCal timeout)

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@496 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-04-01 23:53:26 +00:00
parent 44c4cba9fd
commit 0998567fdf
2 changed files with 6 additions and 6 deletions

View File

@ -436,6 +436,9 @@ public class CaldavConnection extends AbstractConnection {
public void reportEvents(CaldavRequest request, String principal, String path) throws IOException { public void reportEvents(CaldavRequest request, String principal, String path) throws IOException {
List<ExchangeSession.Event> events; List<ExchangeSession.Event> events;
List<String> notFound = new ArrayList<String>(); List<String> notFound = new ArrayList<String>();
CaldavResponse response = new CaldavResponse(HttpStatus.SC_MULTI_STATUS);
response.startMultistatus();
if (request.isMultiGet()) { if (request.isMultiGet()) {
events = new ArrayList<ExchangeSession.Event>(); events = new ArrayList<ExchangeSession.Event>();
int count = 0; int count = 0;
@ -449,7 +452,7 @@ public class CaldavConnection extends AbstractConnection {
} else if ("inbox".equals(eventName) || "calendar".equals(eventName)) { } else if ("inbox".equals(eventName) || "calendar".equals(eventName)) {
// Sunbird: just ignore // Sunbird: just ignore
} else { } else {
events.add(session.getEvent(principal, path, eventName)); appendEventResponse(response, request, path, session.getEvent(principal, path, eventName));
} }
} catch (HttpException e) { } catch (HttpException e) {
notFound.add(href); notFound.add(href);
@ -457,13 +460,11 @@ public class CaldavConnection extends AbstractConnection {
} }
} else if ("INBOX".equals(path)) { } else if ("INBOX".equals(path)) {
events = session.getEventMessages(principal); events = session.getEventMessages(principal);
appendEventsResponses(response, request, path, events);
} else { } else {
events = session.getAllEvents(principal); events = session.getAllEvents(principal);
}
CaldavResponse response = new CaldavResponse(HttpStatus.SC_MULTI_STATUS);
response.startMultistatus();
appendEventsResponses(response, request, path, events); appendEventsResponses(response, request, path, events);
}
// send not found events errors // send not found events errors
for (String href : notFound) { for (String href : notFound) {

View File

@ -1237,7 +1237,6 @@ public class ExchangeSession {
public Event getEvent(String principal, String path, String eventName) throws IOException { public Event getEvent(String principal, String path, String eventName) throws IOException {
String eventPath = URIUtil.encodePath(replacePrincipal(getFolderPath(path), principal)) + "/" + URIUtil.encodeWithinQuery(eventName); String eventPath = URIUtil.encodePath(replacePrincipal(getFolderPath(path), principal)) + "/" + URIUtil.encodeWithinQuery(eventName);
LOGGER.debug("getEvent(" + eventPath + "/" + eventName + ")");
MultiStatusResponse[] responses = DavGatewayHttpClientFacade.executePropFindMethod(httpClient, eventPath, 0, EVENT_REQUEST_PROPERTIES); MultiStatusResponse[] responses = DavGatewayHttpClientFacade.executePropFindMethod(httpClient, eventPath, 0, EVENT_REQUEST_PROPERTIES);
if (responses.length == 0) { if (responses.length == 0) {
throw new IOException("Unable to get calendar event"); throw new IOException("Unable to get calendar event");