InternalLocalChecksum,这个函数返回大于64位的结果,前64位是正常的:
function TkbmMWCustomFileClient.InternalLocalChecksum(Path:string):string;
begin
...
Result:=kbmMWDigestToString(digest);
Result:=Result.Substring(0,64); //前64位是正常的结果
...
end;
InternalSameFileEx卡死应用,注释掉用线程用法,结果正常了,那问题就出在ev.WaitRun这一行上:
function TkbmMWCustomFileClient.InternalSameFileEx(LocalPath:string; RemotePath:string; const Args:array of Variant{$IFDEF KBMMW_LICENSE_MESSAGING}; const AOptions:TkbmMWMessageOptions = []; const APostSubject:string = ''{$ENDIF}):boolean;
var
sLocal,sRemote:string;
{$IFDEF KBMMW_LICENSE_SCHEDULER}
ev:IkbmMWScheduledEvent;
{$ENDIF}
begin
//{$IFDEF KBMMW_LICENSE_SCHEDULER}
// ev:=Scheduler.Run(procedure(const AEvent:IkbmMWScheduledEvent)
// begin
// AEvent.Data:=null;
// AEvent.Data:=InternalLocalChecksum(LocalPath);
// end)
// .Precise.Activate;
// try
// sRemote:=InternalChecksumEx(RemotePath,Args{$IFDEF KBMMW_LICENSE_MESSAGING},AOptions,APostSubject{$ENDIF});
// finally
// // Await local checksum done before continuing.
// ev.WaitRun;
// end;
// sLocal:=ev.Data;
// Result:=sLocal=sRemote;
//{$ELSE}
sLocal:=InternalLocalChecksum(LocalPath);
sRemote:=InternalChecksumEx(RemotePath,Args{$IFDEF KBMMW_LICENSE_MESSAGING},AOptions,APostSubject{$ENDIF});
Result:=sLocal=sRemote;
//{$ENDIF}
end;