Fix clearing callbacks for timeout-ed requests.

This commit is contained in:
John Preston 2018-07-18 22:21:09 +03:00
parent be043a4437
commit 091d1157da
2 changed files with 5 additions and 1 deletions

View File

@ -2322,7 +2322,7 @@ void ConnectionPrivate::requestsAcked(const QVector<MTPlong> &ids, bool byRespon
while (ackedCount-- > MTPIdsBufferSize) {
auto i = wereAcked.begin();
clearedBecauseTooOld.push_back(RPCCallbackClear(
i.key(),
i.value(),
RPCError::TimeoutError));
wereAcked.erase(i);
}

View File

@ -941,6 +941,10 @@ void Instance::Private::clearCallbacks(mtpRequestId requestId, int32 errorCode)
}
}
if (errorCode && found) {
LOG(("API Error: callbacks cleared without handling! "
"Request: %1, error code: %2"
).arg(requestId
).arg(errorCode));
rpcErrorOccured(requestId, h, internal::rpcClientError("CLEAR_CALLBACK", QString("did not handle request %1, error code %2").arg(requestId).arg(errorCode)));
}
}