Skip to content

Commit 343414e

Browse files
committed
remove useless code and missed file
1 parent 9f8922c commit 343414e

File tree

2 files changed

+37
-8
lines changed

2 files changed

+37
-8
lines changed

src/Qiniu/Storage/ResumableUploader.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,7 @@ public HttpResult UploadStream(Stream stream, string key, string upToken, PutExt
161161
{
162162
string context = resumeInfo.Contexts[blockIndex];
163163
if (string.IsNullOrEmpty(context))
164-
{
165-
int blockSize = BLOCK_SIZE;
166-
//calc the block size
167-
if (blockIndex == blockCount - 1)
168-
{
169-
blockSize = blockCount - blockIndex * BLOCK_SIZE;
170-
}
171-
164+
{
172165
//check upload controller action before each chunk
173166
while (true)
174167
{

src/Qiniu/Storage/ResumeBlocker.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using Qiniu.Http;
2+
using System.Collections.Generic;
3+
using System.Threading;
4+
5+
namespace Qiniu.Storage
6+
{
7+
class ResumeBlocker
8+
{
9+
public ManualResetEvent DoneEvent { set; get; }
10+
public byte[] BlockBuffer { set; get; }
11+
public int BlockIndex { set; get; }
12+
public string UploadToken { set; get; }
13+
public PutExtra PutExtra { set; get; }
14+
public ResumeInfo ResumeInfo { set; get; }
15+
public Dictionary<int, HttpResult> BlockMakeResults;
16+
public object ProgressLock { set; get; }
17+
public Dictionary<string, long> UploadedBytesDict { set; get; }
18+
public long FileSize { set; get; }
19+
20+
public ResumeBlocker(ManualResetEvent doneEvent, byte[] blockBuffer, int blockIndex, string uploadToken,
21+
PutExtra putExtra, ResumeInfo resumeInfo, Dictionary<int, HttpResult> blockMakeResults,
22+
object progressLock, Dictionary<string, long> uploadedBytesDict, long fileSize)
23+
{
24+
this.DoneEvent = doneEvent;
25+
this.BlockBuffer = blockBuffer;
26+
this.BlockIndex = blockIndex;
27+
this.UploadToken = uploadToken;
28+
this.PutExtra = putExtra;
29+
this.ResumeInfo = resumeInfo;
30+
this.BlockMakeResults = blockMakeResults;
31+
this.ProgressLock = progressLock;
32+
this.UploadedBytesDict = uploadedBytesDict;
33+
this.FileSize = fileSize;
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)