Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix uploading parts concurrently #263

Merged
merged 3 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
**2024-08-23**

v8.5.1

修复:对象存储,分片并发上传实现非预期

**2023-12-11**

v8.5.0
Expand Down
2 changes: 1 addition & 1 deletion src/Qiniu/Qiniu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<PostBuildEvent>
</PostBuildEvent>
<ProjectId>Qiniu</ProjectId>
<Version>8.5.0</Version>
<Version>8.5.1</Version>
<Authors>Rong Zhou, Qiniu SDK</Authors>
<Company>Shanghai Qiniu Information Technology Co., Ltd.</Company>
<Description>Qiniu Resource (Cloud) Storage SDK for C#</Description>
Expand Down
2 changes: 1 addition & 1 deletion src/Qiniu/QiniuCSharpSDK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ public class QiniuCSharpSDK
/// <summary>
/// SDK版本号
/// </summary>
public const string VERSION = "8.5.0";
public const string VERSION = "8.5.1";

}
327 changes: 167 additions & 160 deletions src/Qiniu/Storage/ResumableUploader.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/QiniuTests/Http/Middleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void SendWithMiddlewareTest()
new RecorderMiddleware(orderRecorder, "B")
};

HttpResult resp = httpManager.Get("https://qiniu.com/index.html", null, null, middlewares);
HttpResult resp = httpManager.Get("https://example.com/index.html", null, null, middlewares);

Assert.AreEqual((int)HttpCode.OK, resp.Code, resp.ToString());
CollectionAssert.AreEqual(
Expand Down Expand Up @@ -70,7 +70,7 @@ public void RetryDomainsMiddlewareTest()
new List<string>
{
"unavailable.csharpsdk.qiniu.com",
"qiniu.com"
"example.com"
},
3
),
Expand Down
2 changes: 1 addition & 1 deletion src/QiniuTests/Storage/BucketManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void ChangeTypeTest()
string key = "qiniu.png";

string newKey = "qiniu-to-change-type.png";
HttpResult copyRet = bucketManager.Copy(Bucket, "qiniu.png", Bucket, newKey, true);
HttpResult copyRet = bucketManager.Copy(Bucket, key, Bucket, newKey, true);
if (copyRet.Code != (int)HttpCode.OK)
{
Assert.Fail("copy error: " + copyRet.ToString());
Expand Down
5 changes: 4 additions & 1 deletion src/QiniuTests/Storage/ResumableUploaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public void UploadFileTest()
putExtra.Params["x:var_1"] = "val_1";
putExtra.Params["x:var_2"] = "val_2";

putExtra.BlockUploadThreads = 2;

ResumableUploader target = new ResumableUploader(config);
HttpResult result = target.UploadFile(filePath, key, token, putExtra);
Console.WriteLine("chunk upload result: " + result.ToString());
Expand Down Expand Up @@ -115,6 +117,7 @@ public void UploadFileV2Test()
extra.Params = new Dictionary<string, string>();
extra.Params["x:var_1"] = "val_1";
extra.Params["x:var_2"] = "val_2";
extra.BlockUploadThreads = 2;
ResumableUploader target = new ResumableUploader(config);
HttpResult result = target.UploadFile(filePath, key, token, extra);
Console.WriteLine("chunk upload result: " + result.ToString());
Expand Down Expand Up @@ -383,7 +386,7 @@ public void ResumeUploadFileV2WithoutKeyTest()
}
}

File.Delete(filePath);
File.Delete(filePath);
}
}

Expand Down
Loading