Keep prewarmed session
This commit is contained in:
@@ -266,7 +266,7 @@ void KOReaderSyncActivity::performSync() {
|
|||||||
// still useful for manual conflict decisions.
|
// still useful for manual conflict decisions.
|
||||||
// Pre-map remote progress now so compare UI always shows concrete chapter/
|
// Pre-map remote progress now so compare UI always shows concrete chapter/
|
||||||
// page data. The mapped result is cached and reused if Apply is chosen.
|
// page data. The mapped result is cached and reused if Apply is chosen.
|
||||||
if (!ensureRemotePositionMapped()) {
|
if (!ensureRemotePositionMapped(false)) {
|
||||||
{
|
{
|
||||||
RenderLock lock(*this);
|
RenderLock lock(*this);
|
||||||
state = SYNC_FAILED;
|
state = SYNC_FAILED;
|
||||||
@@ -555,14 +555,17 @@ bool KOReaderSyncActivity::ensureEpubLoadedForMapping() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KOReaderSyncActivity::ensureRemotePositionMapped() {
|
bool KOReaderSyncActivity::ensureRemotePositionMapped(const bool closeSessionBeforeMapping) {
|
||||||
if (remotePositionMapped) {
|
if (remotePositionMapped) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply needs remote->local mapping, which triggers EPUB inflate work.
|
// Mapping remote->local can trigger EPUB inflate work. For apply/pull paths,
|
||||||
// Release HTTP/TLS session first so mapping has maximum heap headroom.
|
// release HTTP/TLS first to maximize heap headroom. Compare pre-map keeps
|
||||||
KOReaderSyncClient::endPersistentSession();
|
// the warmed session alive so Upload can reuse it without a fresh handshake.
|
||||||
|
if (closeSessionBeforeMapping) {
|
||||||
|
KOReaderSyncClient::endPersistentSession();
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
RenderLock lock(*this);
|
RenderLock lock(*this);
|
||||||
|
|||||||
@@ -115,5 +115,5 @@ class KOReaderSyncActivity final : public Activity {
|
|||||||
void releaseEpubForMapping();
|
void releaseEpubForMapping();
|
||||||
bool computeLocalProgressAndChapter();
|
bool computeLocalProgressAndChapter();
|
||||||
void computeRemoteChapter();
|
void computeRemoteChapter();
|
||||||
bool ensureRemotePositionMapped();
|
bool ensureRemotePositionMapped(bool closeSessionBeforeMapping = true);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user