Caldav: Improved message on update and fixed Etag response header

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@424 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-03-05 16:56:04 +00:00
parent 4e467ee53f
commit 8ab20013a7
2 changed files with 7 additions and 3 deletions

View File

@ -240,8 +240,8 @@ public class CaldavConnection extends AbstractConnection {
ExchangeSession.EventResult eventResult = session.createOrUpdateEvent(paths[4], body, etag, noneMatch);
if (eventResult.etag != null) {
HashMap<String, String> responseHeaders = new HashMap<String, String>();
responseHeaders.put("GetETag", eventResult.etag);
sendHttpResponse(eventResult.status, responseHeaders, "text/html", "", true);
responseHeaders.put("ETag", eventResult.etag);
sendHttpResponse(eventResult.status, responseHeaders, null, "", true);
} else {
sendHttpResponse(eventResult.status, true);
}

View File

@ -1550,7 +1550,11 @@ public class ExchangeSession {
if (status == 0) {
status = wdr.retrieveSessionInstance().executeMethod(putmethod);
if (status == HttpURLConnection.HTTP_OK) {
LOGGER.warn("Overwritten event " + messageUrl);
if (etag != null) {
LOGGER.debug("Updated event " + messageUrl);
} else {
LOGGER.warn("Overwritten event " + messageUrl);
}
} else if (status != HttpURLConnection.HTTP_CREATED) {
LOGGER.warn("Unable to create or update message " + status + " " + putmethod.getStatusLine());
}