Skip to content

Commit 6b250fe

Browse files
authored
fix uploading parts concurrently (#263)
1 parent 0dcc36b commit 6b250fe

File tree

7 files changed

+182
-166
lines changed

7 files changed

+182
-166
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
**2024-08-23**
2+
3+
v8.5.1
4+
5+
修复:对象存储,分片并发上传实现非预期
6+
17
**2023-12-11**
28

39
v8.5.0

src/Qiniu/Qiniu.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<PostBuildEvent>
2929
</PostBuildEvent>
3030
<ProjectId>Qiniu</ProjectId>
31-
<Version>8.5.0</Version>
31+
<Version>8.5.1</Version>
3232
<Authors>Rong Zhou, Qiniu SDK</Authors>
3333
<Company>Shanghai Qiniu Information Technology Co., Ltd.</Company>
3434
<Description>Qiniu Resource (Cloud) Storage SDK for C#</Description>

src/Qiniu/QiniuCSharpSDK.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ public class QiniuCSharpSDK
3737
/// <summary>
3838
/// SDK版本号
3939
/// </summary>
40-
public const string VERSION = "8.5.0";
40+
public const string VERSION = "8.5.1";
4141

4242
}

src/Qiniu/Storage/ResumableUploader.cs

Lines changed: 167 additions & 160 deletions
Large diffs are not rendered by default.

src/QiniuTests/Http/Middleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void SendWithMiddlewareTest()
4141
new RecorderMiddleware(orderRecorder, "B")
4242
};
4343

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

4646
Assert.AreEqual((int)HttpCode.OK, resp.Code, resp.ToString());
4747
CollectionAssert.AreEqual(
@@ -70,7 +70,7 @@ public void RetryDomainsMiddlewareTest()
7070
new List<string>
7171
{
7272
"unavailable.csharpsdk.qiniu.com",
73-
"qiniu.com"
73+
"example.com"
7474
},
7575
3
7676
),

src/QiniuTests/Storage/BucketManagerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public void ChangeTypeTest()
139139
string key = "qiniu.png";
140140

141141
string newKey = "qiniu-to-change-type.png";
142-
HttpResult copyRet = bucketManager.Copy(Bucket, "qiniu.png", Bucket, newKey, true);
142+
HttpResult copyRet = bucketManager.Copy(Bucket, key, Bucket, newKey, true);
143143
if (copyRet.Code != (int)HttpCode.OK)
144144
{
145145
Assert.Fail("copy error: " + copyRet.ToString());

src/QiniuTests/Storage/ResumableUploaderTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public void UploadFileTest()
5050
putExtra.Params["x:var_1"] = "val_1";
5151
putExtra.Params["x:var_2"] = "val_2";
5252

53+
putExtra.BlockUploadThreads = 2;
54+
5355
ResumableUploader target = new ResumableUploader(config);
5456
HttpResult result = target.UploadFile(filePath, key, token, putExtra);
5557
Console.WriteLine("chunk upload result: " + result.ToString());
@@ -115,6 +117,7 @@ public void UploadFileV2Test()
115117
extra.Params = new Dictionary<string, string>();
116118
extra.Params["x:var_1"] = "val_1";
117119
extra.Params["x:var_2"] = "val_2";
120+
extra.BlockUploadThreads = 2;
118121
ResumableUploader target = new ResumableUploader(config);
119122
HttpResult result = target.UploadFile(filePath, key, token, extra);
120123
Console.WriteLine("chunk upload result: " + result.ToString());
@@ -383,7 +386,7 @@ public void ResumeUploadFileV2WithoutKeyTest()
383386
}
384387
}
385388

386-
File.Delete(filePath);
389+
File.Delete(filePath);
387390
}
388391
}
389392

0 commit comments

Comments
 (0)