1
0
mirror of https://github.com/etesync/android synced 2024-11-29 11:28:19 +00:00

Fallback to PROPFIND when REPORT addressbook-query returns 400, 403, 500 or 501

* increase max. log line length to 80 characters
This commit is contained in:
Ricki Hirner 2015-10-21 12:47:12 +02:00
parent 9d19d9757c
commit 34de8431ae
No known key found for this signature in database
GPG Key ID: C4A212CF0B2B4566
2 changed files with 8 additions and 2 deletions

View File

@ -33,7 +33,7 @@ import de.duenndns.ssl.MemorizingTrustManager;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
public class HttpClient extends OkHttpClient { public class HttpClient extends OkHttpClient {
private final int MAX_LOG_LINE_LENGTH = 71; private final int MAX_LOG_LINE_LENGTH = 80;
final static UserAgentInterceptor userAgentInterceptor = new UserAgentInterceptor(); final static UserAgentInterceptor userAgentInterceptor = new UserAgentInterceptor();

View File

@ -117,7 +117,13 @@ public class ContactsSyncManager extends SyncManager {
try { try {
davAddressBook().addressbookQuery(); davAddressBook().addressbookQuery();
} catch(HttpException e) { } catch(HttpException e) {
if (e.status/100 == 4) { /* non-successful responses to CARDDAV:addressbook-query with empty filter, tested on 2015/10/21
* fastmail.com 403 Forbidden (DAV:error CARDDAV:supported-filter)
* mailbox.org (OpenXchange) 400 Bad Request
* SOGo 207 Multi-status, but without entries http://www.sogo.nu/bugs/view.php?id=3370
* Zimbra ZCS 500 Server Error https://bugzilla.zimbra.com/show_bug.cgi?id=101902
*/
if (e.status == 400 || e.status == 403 || e.status == 500 || e.status == 501) {
log.warn("Server error on REPORT addressbook-query, falling back to PROPFIND", e); log.warn("Server error on REPORT addressbook-query, falling back to PROPFIND", e);
davAddressBook().propfind(1, GetETag.NAME); davAddressBook().propfind(1, GetETag.NAME);
} else } else