Merge pull request #1034 from wabbajack-tools/copy-to-limit-exit

Fix endless loop in CopyToLimit
This commit is contained in:
Timothy Baldridge 2020-08-16 21:16:51 -07:00 committed by GitHub
commit fb4a05f6c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 13 deletions

View File

@ -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>

View File

@ -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;

View File

@ -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;
}

View File

@ -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"};

View File

@ -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;
}

View File

@ -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>