mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Merge pull request #8580 from nextcloud/bugfix/noid/cfapi-cancel-crash
fix(cfapi): only log process info if it's present
This commit is contained in:
commit
265cc99c94
@ -129,9 +129,7 @@ void cfApiSendTransferInfo(const CF_CONNECTION_KEY &connectionKey, const CF_TRAN
|
||||
void CALLBACK cfApiFetchDataCallback(const CF_CALLBACK_INFO *callbackInfo, const CF_CALLBACK_PARAMETERS *callbackParameters)
|
||||
{
|
||||
qCDebug(lcCfApiWrapper) << "Fetch data callback called. File size:" << callbackInfo->FileSize.QuadPart;
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client proccess id:" << QCoreApplication::applicationPid();
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by proccess id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client process id:" << QCoreApplication::applicationPid();
|
||||
|
||||
const auto sendTransferError = [=] {
|
||||
cfApiSendTransferInfo(callbackInfo->ConnectionKey,
|
||||
@ -158,6 +156,15 @@ void CALLBACK cfApiFetchDataCallback(const CF_CALLBACK_INFO *callbackInfo, const
|
||||
const auto path = QString(QString::fromWCharArray(callbackInfo->VolumeDosName) + QString::fromWCharArray(callbackInfo->NormalizedPath));
|
||||
const auto requestId = QString::number(callbackInfo->TransferKey.QuadPart, 16);
|
||||
|
||||
if (!callbackInfo->ProcessInfo) {
|
||||
qCCritical(lcCfApiWrapper) << "Callback parameters did not contain required process info required for the implicit hydration check, aborting" << path << requestId;
|
||||
sendTransferError();
|
||||
return;
|
||||
}
|
||||
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by process id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
|
||||
if (QCoreApplication::applicationPid() == callbackInfo->ProcessInfo->ProcessId) {
|
||||
qCCritical(lcCfApiWrapper) << "implicit hydration triggered by the client itself. Will lead to a deadlock. Cancel" << path << requestId;
|
||||
sendTransferError();
|
||||
@ -356,9 +363,11 @@ void CALLBACK cfApiCancelFetchData(const CF_CALLBACK_INFO *callbackInfo, const C
|
||||
const auto path = QString(QString::fromWCharArray(callbackInfo->VolumeDosName) + QString::fromWCharArray(callbackInfo->NormalizedPath));
|
||||
|
||||
qCInfo(lcCfApiWrapper) << "Cancel fetch data of" << path;
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client proccess id:" << QCoreApplication::applicationPid();
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by proccess id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client process id:" << QCoreApplication::applicationPid();
|
||||
if (callbackInfo->ProcessInfo) {
|
||||
qCInfo(lcCfApiWrapper) << "Cancel fetch data requested by process id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Cancel fetch data requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
}
|
||||
|
||||
auto vfs = reinterpret_cast<OCC::VfsCfApi *>(callbackInfo->CallbackContext);
|
||||
Q_ASSERT(vfs->metaObject()->className() == QByteArrayLiteral("OCC::VfsCfApi"));
|
||||
@ -380,9 +389,11 @@ void CALLBACK cfApiNotifyFileOpenCompletion(const CF_CALLBACK_INFO *callbackInfo
|
||||
const auto requestId = QString::number(callbackInfo->TransferKey.QuadPart, 16);
|
||||
|
||||
qCDebug(lcCfApiWrapper) << "Open file completion:" << path << requestId;
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client proccess id:" << QCoreApplication::applicationPid();
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by proccess id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client process id:" << QCoreApplication::applicationPid();
|
||||
if (callbackInfo->ProcessInfo) {
|
||||
qCInfo(lcCfApiWrapper) << "Open file completed by process id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Open file completed by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
}
|
||||
}
|
||||
|
||||
void CALLBACK cfApiValidateData(const CF_CALLBACK_INFO *callbackInfo, const CF_CALLBACK_PARAMETERS * /*callbackParameters*/)
|
||||
@ -394,9 +405,11 @@ void CALLBACK cfApiValidateData(const CF_CALLBACK_INFO *callbackInfo, const CF_C
|
||||
const auto requestId = QString::number(callbackInfo->TransferKey.QuadPart, 16);
|
||||
|
||||
qCDebug(lcCfApiWrapper) << "Validate data:" << path << requestId;
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client proccess id:" << QCoreApplication::applicationPid();
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by proccess id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client process id:" << QCoreApplication::applicationPid();
|
||||
if (callbackInfo->ProcessInfo) {
|
||||
qCInfo(lcCfApiWrapper) << "Validate data requested by process id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Validate data requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
}
|
||||
}
|
||||
|
||||
void CALLBACK cfApiCancelFetchPlaceHolders(const CF_CALLBACK_INFO *callbackInfo, const CF_CALLBACK_PARAMETERS * /*callbackParameters*/)
|
||||
@ -408,9 +421,11 @@ void CALLBACK cfApiCancelFetchPlaceHolders(const CF_CALLBACK_INFO *callbackInfo,
|
||||
const auto requestId = QString::number(callbackInfo->TransferKey.QuadPart, 16);
|
||||
|
||||
qCDebug(lcCfApiWrapper) << "Cancel fetch placeholder:" << path << requestId;
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client proccess id:" << QCoreApplication::applicationPid();
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by proccess id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client process id:" << QCoreApplication::applicationPid();
|
||||
if (callbackInfo->ProcessInfo) {
|
||||
qCInfo(lcCfApiWrapper) << "Cancel fetch placeholder requested by process id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Cancel fetch placeholder requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
}
|
||||
}
|
||||
|
||||
void CALLBACK cfApiNotifyFileCloseCompletion(const CF_CALLBACK_INFO *callbackInfo, const CF_CALLBACK_PARAMETERS * /*callbackParameters*/)
|
||||
@ -422,9 +437,11 @@ void CALLBACK cfApiNotifyFileCloseCompletion(const CF_CALLBACK_INFO *callbackInf
|
||||
const auto requestId = QString::number(callbackInfo->TransferKey.QuadPart, 16);
|
||||
|
||||
qCDebug(lcCfApiWrapper) << "Close file completion:" << path << requestId;
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client proccess id:" << QCoreApplication::applicationPid();
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by proccess id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client process id:" << QCoreApplication::applicationPid();
|
||||
if (callbackInfo->ProcessInfo) {
|
||||
qCInfo(lcCfApiWrapper) << "Close file completion by process id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Close file completion by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
}
|
||||
}
|
||||
|
||||
CF_CALLBACK_REGISTRATION cfApiCallbacks[] = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user