mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #1034 from wabbajack-tools/copy-to-limit-exit
Fix endless loop in CopyToLimit
This commit is contained in:
commit
fb4a05f6c8
@ -10,10 +10,10 @@
|
||||
<WarningsAsErrors>nullable</WarningsAsErrors>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
<PackageVersion>2.2.1.1</PackageVersion>
|
||||
<Version>2.2.1.1</Version>
|
||||
<AssemblyVersion>2.2.1.1</AssemblyVersion>
|
||||
<FileVersion>2.2.1.1</FileVersion>
|
||||
<PackageVersion>2.2.1.2</PackageVersion>
|
||||
<Version>2.2.1.2</Version>
|
||||
<AssemblyVersion>2.2.1.2</AssemblyVersion>
|
||||
<FileVersion>2.2.1.2</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<DocumentationFile>Compression.BSA.xml</DocumentationFile>
|
||||
|
@ -27,7 +27,7 @@ namespace Wabbajack.Common
|
||||
retries += 1;
|
||||
if (retries > maxRetries)
|
||||
throw;
|
||||
Utils.Log($"(Retry {retries} of {maxRetries}), got exception {ex.Message}, waiting {delay.Value.TotalMilliseconds}ms");
|
||||
Utils.Log($"(Retry {retries} of {maxRetries}), got exception {ex.Message}, waiting {delay!.Value.TotalMilliseconds}ms");
|
||||
await Task.Delay(delay.Value);
|
||||
delay = delay * multipler;
|
||||
goto TOP;
|
||||
@ -51,7 +51,7 @@ namespace Wabbajack.Common
|
||||
retries += 1;
|
||||
if (retries > maxRetries)
|
||||
throw;
|
||||
Utils.Log($"(Retry {retries} of {maxRetries}), got exception {ex.Message}, waiting {delay.Value.TotalMilliseconds}ms");
|
||||
Utils.Log($"(Retry {retries} of {maxRetries}), got exception {ex.Message}, waiting {delay!.Value.TotalMilliseconds}ms");
|
||||
await Task.Delay(delay.Value);
|
||||
delay = delay * multipler;
|
||||
goto TOP;
|
||||
@ -75,7 +75,7 @@ namespace Wabbajack.Common
|
||||
retries += 1;
|
||||
if (retries > maxRetries)
|
||||
throw;
|
||||
Utils.Log($"(Retry {retries} of {maxRetries}), got exception {ex.Message}, waiting {delay.Value.TotalMilliseconds}ms");
|
||||
Utils.Log($"(Retry {retries} of {maxRetries}), got exception {ex.Message}, waiting {delay!.Value.TotalMilliseconds}ms");
|
||||
Thread.Sleep(delay.Value);
|
||||
delay = delay * multipler;
|
||||
goto TOP;
|
||||
|
@ -108,7 +108,7 @@ namespace Wabbajack
|
||||
// We have another value that came in to fire.
|
||||
// Reregister for callback
|
||||
dueTimeDisposable.Disposable = scheduler.Schedule(interval, internalCallback);
|
||||
o.OnNext(value);
|
||||
o.OnNext(value!);
|
||||
value = default;
|
||||
hasValue = false;
|
||||
}
|
||||
|
@ -11,7 +11,6 @@
|
||||
return Enumerable.Range(0, hex.Length)
|
||||
.Where(x => x % 2 == 0)
|
||||
.Select(x => Convert.ToByte(hex.Substring(x, 2), 16))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
var files = new string[] {"bsasigs.txt", "file_sigs_RAW.txt"};
|
||||
|
@ -1034,6 +1034,8 @@ namespace Wabbajack.Common
|
||||
{
|
||||
var to_read = Math.Min(buff.Length, limit);
|
||||
var read = await frm.ReadAsync(buff, 0, (int)to_read);
|
||||
if (read == 0)
|
||||
throw new Exception("End of stream before end of limit");
|
||||
await tw.WriteAsync(buff, 0, read);
|
||||
limit -= read;
|
||||
}
|
||||
|
@ -14,10 +14,10 @@
|
||||
<PackageIconUrl>https://www.wabbajack.org/favicon.ico</PackageIconUrl>
|
||||
<RepositoryUrl>https://github.com/wabbajack-tools/wabbajack</RepositoryUrl>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
<PackageVersion>2.2.1.1</PackageVersion>
|
||||
<Version>2.2.1.1</Version>
|
||||
<AssemblyVersion>2.2.1.1</AssemblyVersion>
|
||||
<FileVersion>2.2.1.1</FileVersion>
|
||||
<PackageVersion>2.2.1.2</PackageVersion>
|
||||
<Version>2.2.1.2</Version>
|
||||
<AssemblyVersion>2.2.1.2</AssemblyVersion>
|
||||
<FileVersion>2.2.1.2</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<DocumentationFile>Wabbajack.Common.xml</DocumentationFile>
|
||||
|
Loading…
Reference in New Issue
Block a user