mirror of
https://github.com/etesync/android
synced 2024-11-25 17:38:13 +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:
parent
9d19d9757c
commit
34de8431ae
@ -33,7 +33,7 @@ import de.duenndns.ssl.MemorizingTrustManager;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
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();
|
||||
|
||||
|
@ -117,7 +117,13 @@ public class ContactsSyncManager extends SyncManager {
|
||||
try {
|
||||
davAddressBook().addressbookQuery();
|
||||
} 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);
|
||||
davAddressBook().propfind(1, GetETag.NAME);
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user