Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
gpailler committed Nov 7, 2016
2 parents 99a7c38 + bbdf278 commit 62c6a6d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 46 deletions.
37 changes: 2 additions & 35 deletions MegaApiClient-4.0/MegaApiClient-4.0.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,34 +57,6 @@
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.IO, Version=2.6.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.IO.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.Extensions, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.Primitives.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime, Version=2.6.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Threading.Tasks, Version=2.6.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Threading.Tasks.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -134,17 +106,12 @@
<Compile Include="..\MegaApiClient\Properties\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\MegaApiClient\WebClient_HttpClient.cs">
<Link>WebClient_HttpClient.cs</Link>
<Compile Include="..\MegaApiClient\WebClient_HttpWebRequest.cs">
<Link>WebClient_HttpWebRequest.cs</Link>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
3 changes: 0 additions & 3 deletions MegaApiClient-4.0/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net40" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net40" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net40" />
</packages>
1 change: 1 addition & 0 deletions MegaApiClient.Tests/DownloadUpload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public void UploadStream_DifferentParent_Succeeds(NodeType parentType)
[TestCase(20000, 1024 * 1024, 1)]
[TestCase(200000, 1024 * 1024, 1)]
[TestCase(2000000, 1024 * 1024, 2)]
[TestCase(2000000, -1, 1)]
public void UploadStream_ValidateContent_Succeeds(int dataSize, int chunksPackSize, int expectedUploadCalls)
{
byte[] uploadedData = new byte[dataSize];
Expand Down
7 changes: 2 additions & 5 deletions MegaApiClient.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>MegaApiClient</id>
<version>1.3.0</version>
<version>1.3.1</version>
<title>Mega.co.nz client library</title>
<authors>Grégoire Pailler</authors>
<owners>Grégoire Pailler</owners>
Expand All @@ -17,9 +17,6 @@
<group>
<dependency id="Newtonsoft.Json" version="9.0.1" />
</group>
<group targetFramework=".NETFramework4.0">
<dependency id="Microsoft.Net.Http" version="2.2.29" />
</group>
</dependencies>
</metadata>
<files>
Expand All @@ -31,4 +28,4 @@
<file src="MegaApiClient-4.5\bin\Release\MegaApiClient.xml" target="lib\net45\MegaApiClient.xml" />
<file src="LICENSE" target="lib\LICENSE" />
</files>
</package>
</package>
3 changes: 2 additions & 1 deletion MegaApiClient/MegaApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public int BufferSize
/// 0 / 128K / 384K / 768K / 1280K / 1920K / 2688K / 3584K / 4608K / ... (every 1024 KB) / EOF
/// The upload method tries to upload multiple fragments at once.
/// Fragments are merged until the total size reaches this value.
/// The special value -1 merges all chunks in a single fragment and a single upload
/// </summary>
public int ChunksPackSize { get; set; }

Expand Down Expand Up @@ -944,7 +945,7 @@ private IEnumerable<int> ComputeChunksSizesToUpload(long[] chunksPositions, long
: chunksPositions[i + 1];

// Pack multiple chunks in a single upload
while ((int)(nextChunkPosition - currentChunkPosition) < this.ChunksPackSize && i < chunksPositions.Length - 1)
while (((int)(nextChunkPosition - currentChunkPosition) < this.ChunksPackSize || this.ChunksPackSize == -1) && i < chunksPositions.Length - 1)
{
i++;
nextChunkPosition = i == chunksPositions.Length - 1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Customization
---
- MegaApiClient constructor can use a optional IWebClient implementation to customize network layer (retry, timeout, transfer cancellation...).
- The default download/upload buffer size is set to 8192 bytes and can be changed by editing `MegaApiClient.BufferSize` instance variable. This can improve transfers if you have high bandwidth (but you have less progression reports).
- Files are splitted in chunks and uploaded chunk by chunk (to support large uploads). MegaApiClient tries to pack chunks in 1MB uploads fragments by default. You can edit `MegaApiClient.ChunksPackSize` to specify a custom value to pack more or less chunks in a single upload.
- Files are splitted in chunks and uploaded chunk by chunk (to support large uploads). MegaApiClient tries to pack chunks in 1MB uploads fragments by default. You can edit `MegaApiClient.ChunksPackSize` to specify a custom value to pack more or less chunks in a single upload. The special value -1 packs all chunks in a single upload fragment.
- For .Net 4.5 and higher, the progression in Download/Upload methods is reported on each 50KB downloaded or uploaded block. This can be changed by editing `MegaApiClient.ReportProgressChunkSize` instance variable. This value should be higher or equals to `MegaApiClient.BufferSize` or you will have a less smooth progression report.

Donations :gift:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.3.0.{build}
version: 1.3.1.{build}
branches:
only:
- develop
Expand Down

0 comments on commit 62c6a6d

Please sign in to comment.