Skip to content

Commit

Permalink
Start reporting progress before hydration starts.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
Camila San authored and camilasan committed Jun 17, 2024
1 parent da80a4f commit d678a9a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/libsync/vfs/cfapi/cfapiwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,17 @@ void CALLBACK cfApiFetchDataCallback(const CF_CALLBACK_INFO *callbackInfo, const
callbackInfo->FileSize.QuadPart);
};

// The operation that was requested is pending completion.
const auto pendingTransferInfo = [=] {
cfApiSendTransferInfo(callbackInfo->ConnectionKey,
callbackInfo->TransferKey,
STATUS_PENDING,
nullptr,
callbackParameters->FetchData.RequiredFileOffset.QuadPart,
callbackParameters->FetchData.RequiredLength.QuadPart,
callbackInfo->FileSize.QuadPart);
};

auto vfs = reinterpret_cast<OCC::VfsCfApi *>(callbackInfo->CallbackContext);
Q_ASSERT(vfs->metaObject()->className() == QByteArrayLiteral("OCC::VfsCfApi"));
const auto path = QString(QString::fromWCharArray(callbackInfo->VolumeDosName) + QString::fromWCharArray(callbackInfo->NormalizedPath));
Expand All @@ -170,6 +181,7 @@ void CALLBACK cfApiFetchDataCallback(const CF_CALLBACK_INFO *callbackInfo, const
return;
}

pendingTransferInfo();
qCDebug(lcCfApiWrapper) << "Successfully triggered hydration for" << path << requestId;

// Block and wait for vfs to signal back the hydration is ready
Expand Down

0 comments on commit d678a9a

Please sign in to comment.