PBAP: Wrong behaviour when SYNCEVOLUTION_PBAP_CHUNK_TRANSFER_TIME is <= 0.

Setting SYNCEVOLUTION_PBAP_CHUNK_TRANSFER_TIME to value <= 0 is not
working like described in README file.
Currently in such case desired chunk size is very quickly decreasing
to 0 and causing synchronization finish without downloading all
contacts.

This patch is disabling tuning desired chunk size in such case,
keeping transfer size constant and equal to initially set value.
This commit is contained in:
Mateusz Polrola 2014-09-22 12:58:52 +02:00 committed by Patrick Ohly
parent d6a3ab3209
commit 569e6b29bf
1 changed files with 2 additions and 1 deletions

View File

@ -983,7 +983,8 @@ bool PullAll::getContact(const char *id, pcrecpp::StringPiece &vcard)
// time. Ignore clipped or suspended transfers, they are
// not representative. Also avoid completely bogus
// observations.
if (!m_wasSuspended &&
if (m_pullParams.m_timePerChunk > 0 &&
!m_wasSuspended &&
m_transferMaxCount == m_desiredMaxCount &&
m_lastTransferRate > 0 &&
m_lastContactSizeAverage > 0) {