diff --git a/src/TerminalVelocity.Sharp/Downloader.cs b/src/TerminalVelocity.Sharp/Downloader.cs index 89263e1..b41ff26 100644 --- a/src/TerminalVelocity.Sharp/Downloader.cs +++ b/src/TerminalVelocity.Sharp/Downloader.cs @@ -72,7 +72,6 @@ internal static void StartDownloading(CancellationToken ct, FailureToken ft, try { - int writtenChunkZeroBased = 0; var readStack = new ConcurrentStack(); //add all of the chunks to the stack @@ -165,7 +164,7 @@ internal static void StartDownloading(CancellationToken ct, FailureToken ft, if (worker.SimulateTimedOut) Thread.Sleep(3000); // introduce delay for unit test to pick-up the condition } - catch (Exception ex) + catch (Exception) { } } } @@ -294,7 +293,7 @@ public static int ComputeProgressIndicator(long bytesWritten, long fileSize) } - internal Downloader(BufferManager bufferManager, + public Downloader(BufferManager bufferManager, ILargeFileDownloadParameters parameters, ConcurrentQueue writeQueue, ConcurrentStack readStack, @@ -431,7 +430,7 @@ internal static void ExecuteAndSquash( Action a) } } - internal static int ExpectedDownloadTimeInSeconds(int chunkSizeInBytes) + public static int ExpectedDownloadTimeInSeconds(int chunkSizeInBytes) { //so lets say 128Kbps per second with no overhead takes 62 seconds for 1MB 64kb = 16384bytes //20% latency @@ -443,12 +442,12 @@ internal static int ExpectedDownloadTimeInSeconds(int chunkSizeInBytes) } - internal static long GetChunkStart(int currentChunk, int maxChunkSize) + public static long GetChunkStart(int currentChunk, int maxChunkSize) { return currentChunk*(long)maxChunkSize; } - internal static int GetChunkCount(long fileSize, long chunkSize) + public static int GetChunkCount(long fileSize, long chunkSize) { if (chunkSize == 0) return 0; @@ -463,7 +462,7 @@ internal static int GetChunkCount(long fileSize, long chunkSize) return 1 + chunkCount; } - internal static int GetChunkSizeForCurrentChunk(long fileSize, int maxChunkSize, int zeroBasedChunkNumber) + public static int GetChunkSizeForCurrentChunk(long fileSize, int maxChunkSize, int zeroBasedChunkNumber) { int chunkCount = GetChunkCount(fileSize, maxChunkSize); diff --git a/src/TerminalVelocity.Sharp/FailureToken.cs b/src/TerminalVelocity.Sharp/FailureToken.cs index a172117..801a9fa 100644 --- a/src/TerminalVelocity.Sharp/FailureToken.cs +++ b/src/TerminalVelocity.Sharp/FailureToken.cs @@ -3,7 +3,7 @@ namespace Illumina.TerminalVelocity { - internal class FailureToken + public class FailureToken { public bool FailureDetected { get; private set; } diff --git a/src/TerminalVelocity.Sharp/LargeFileDownloadParameters.cs b/src/TerminalVelocity.Sharp/LargeFileDownloadParameters.cs index 9cd1843..41123c6 100644 --- a/src/TerminalVelocity.Sharp/LargeFileDownloadParameters.cs +++ b/src/TerminalVelocity.Sharp/LargeFileDownloadParameters.cs @@ -79,7 +79,7 @@ protected static FileStream CreateOutputStream(string filePath, long fileLength, return stream; } - internal static void EnsureCleanFile(string filePath, bool deleteIfExists) + public static void EnsureCleanFile(string filePath, bool deleteIfExists) { if ((File.Exists(filePath) && deleteIfExists) || !File.Exists(filePath)) { diff --git a/src/TerminalVelocity.Sharp/SimpleHttpGetByRangeClient.cs b/src/TerminalVelocity.Sharp/SimpleHttpGetByRangeClient.cs index cc9f168..0d36f42 100644 --- a/src/TerminalVelocity.Sharp/SimpleHttpGetByRangeClient.cs +++ b/src/TerminalVelocity.Sharp/SimpleHttpGetByRangeClient.cs @@ -142,7 +142,7 @@ protected void EnsureConnection(Uri uri, bool forceRebuild = false) if (baseUri.Scheme.ToLower() == "https") { SslStream sslStream; -#if XAMARIN // THIS IS AN UGLY HACK TO MAKE IT WORK FOR SPACE ELEVATOR. +#if XAMARIN // THIS IS AN UGLY HACK TO MAKE MONO TRUST EVERYTHING TO WORK FOR SPACE ELEVATOR (BaseSpace Downloader). sslStream = Helpers.IsRunningOnMono() ? new SslStream(clientStream, false, delegate { return true; }, null) : new SslStream(clientStream); #else sslStream = new SslStream(clientStream); @@ -160,7 +160,7 @@ protected void EnsureConnection(Uri uri, bool forceRebuild = false) } - internal static string BuildHttpRequest(Uri uri, long start, long length) + public static string BuildHttpRequest(Uri uri, long start, long length) { string hostHeader; // see if they provided a port explicitly in the URI. If so, that must be set in the header diff --git a/src/TerminalVelocity.Sharp/TerminalVelocity.Sharp.csproj b/src/TerminalVelocity.Sharp/TerminalVelocity.Sharp.csproj index faad5fb..3d314b1 100644 --- a/src/TerminalVelocity.Sharp/TerminalVelocity.Sharp.csproj +++ b/src/TerminalVelocity.Sharp/TerminalVelocity.Sharp.csproj @@ -21,7 +21,7 @@ full false bin\Debug\ - TRACE;DEBUG;XAMARIN + TRACE;DEBUG prompt 4 @@ -29,7 +29,7 @@ pdbonly true bin\Release\ - TRACE;XAMARIN + TRACE prompt 4 @@ -39,6 +39,24 @@ ..\..\..\SpaceElevator\src\SpaceElevator.Client\IlluminaStrongNameKey.snk + + bin\XamarinMacRelease\ + TRACE;XAMARIN + true + pdbonly + AnyCPU + prompt + MinimumRecommendedRules.ruleset + + + true + bin\XamarinMacDebug\ + TRACE;DEBUG;XAMARIN + full + AnyCPU + prompt + MinimumRecommendedRules.ruleset + diff --git a/tests/TerminalVelocity.Tests/TerminalVelocity.Tests.csproj b/tests/TerminalVelocity.Tests/TerminalVelocity.Tests.csproj index a1feafe..458de87 100644 --- a/tests/TerminalVelocity.Tests/TerminalVelocity.Tests.csproj +++ b/tests/TerminalVelocity.Tests/TerminalVelocity.Tests.csproj @@ -77,6 +77,9 @@ + + +