Skip to content
13 changes: 6 additions & 7 deletions src/TerminalVelocity.Sharp/Downloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ internal static void StartDownloading(CancellationToken ct, FailureToken ft,
try
{

int writtenChunkZeroBased = 0;
var readStack = new ConcurrentStack<int>();

//add all of the chunks to the stack
Expand Down Expand Up @@ -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)
{ }
}
}
Expand Down Expand Up @@ -294,7 +293,7 @@ public static int ComputeProgressIndicator(long bytesWritten, long fileSize)

}

internal Downloader(BufferManager bufferManager,
public Downloader(BufferManager bufferManager,
ILargeFileDownloadParameters parameters,
ConcurrentQueue<ChunkedFilePart> writeQueue,
ConcurrentStack<int> readStack,
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/TerminalVelocity.Sharp/FailureToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Illumina.TerminalVelocity
{
internal class FailureToken
public class FailureToken
{
public bool FailureDetected { get; private set; }

Expand Down
2 changes: 1 addition & 1 deletion src/TerminalVelocity.Sharp/LargeFileDownloadParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
4 changes: 2 additions & 2 deletions src/TerminalVelocity.Sharp/SimpleHttpGetByRangeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
22 changes: 20 additions & 2 deletions src/TerminalVelocity.Sharp/TerminalVelocity.Sharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;XAMARIN</DefineConstants>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;XAMARIN</DefineConstants>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
Expand All @@ -39,6 +39,24 @@
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\..\..\SpaceElevator\src\SpaceElevator.Client\IlluminaStrongNameKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XamarinMacRelease|AnyCPU'">
<OutputPath>bin\XamarinMacRelease\</OutputPath>
<DefineConstants>TRACE;XAMARIN</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XamarinMacDebug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\XamarinMacDebug\</OutputPath>
<DefineConstants>TRACE;DEBUG;XAMARIN</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
3 changes: 3 additions & 0 deletions tests/TerminalVelocity.Tests/TerminalVelocity.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
<ItemGroup>
<Content Include="DownloadTests.SimpleGetClientGetsFirst100Bytes.approved.txt" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down