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:
parent
4e467ee53f
commit
8ab20013a7
|
@ -240,8 +240,8 @@ public class CaldavConnection extends AbstractConnection {
|
||||||
ExchangeSession.EventResult eventResult = session.createOrUpdateEvent(paths[4], body, etag, noneMatch);
|
ExchangeSession.EventResult eventResult = session.createOrUpdateEvent(paths[4], body, etag, noneMatch);
|
||||||
if (eventResult.etag != null) {
|
if (eventResult.etag != null) {
|
||||||
HashMap<String, String> responseHeaders = new HashMap<String, String>();
|
HashMap<String, String> responseHeaders = new HashMap<String, String>();
|
||||||
responseHeaders.put("GetETag", eventResult.etag);
|
responseHeaders.put("ETag", eventResult.etag);
|
||||||
sendHttpResponse(eventResult.status, responseHeaders, "text/html", "", true);
|
sendHttpResponse(eventResult.status, responseHeaders, null, "", true);
|
||||||
} else {
|
} else {
|
||||||
sendHttpResponse(eventResult.status, true);
|
sendHttpResponse(eventResult.status, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1550,7 +1550,11 @@ public class ExchangeSession {
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
status = wdr.retrieveSessionInstance().executeMethod(putmethod);
|
status = wdr.retrieveSessionInstance().executeMethod(putmethod);
|
||||||
if (status == HttpURLConnection.HTTP_OK) {
|
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) {
|
} else if (status != HttpURLConnection.HTTP_CREATED) {
|
||||||
LOGGER.warn("Unable to create or update message " + status + " " + putmethod.getStatusLine());
|
LOGGER.warn("Unable to create or update message " + status + " " + putmethod.getStatusLine());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue