Skip to content

Commit e4eb862

Browse files
committed
Merge pull request #37 from longbai/upload-config
upload config
2 parents 8575fa1 + b610c2d commit e4eb862

29 files changed

+584
-285
lines changed

QiniuSDK.xcodeproj/project.pbxproj

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
DF2CDE5C19DAC6A400CE01FB /* QNUrlSafeBase64.h in Headers */ = {isa = PBXBuildFile; fileRef = DF2CDE4F19DAC6A400CE01FB /* QNUrlSafeBase64.h */; };
4040
DF2CDE5D19DAC6A400CE01FB /* QNUrlSafeBase64.m in Sources */ = {isa = PBXBuildFile; fileRef = DF2CDE5019DAC6A400CE01FB /* QNUrlSafeBase64.m */; };
4141
DF2CDE5E19DAC6A400CE01FB /* QNUrlSafeBase64.m in Sources */ = {isa = PBXBuildFile; fileRef = DF2CDE5019DAC6A400CE01FB /* QNUrlSafeBase64.m */; };
42-
DF2CDE5F19DAC6A400CE01FB /* QNConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = DF2CDE5119DAC6A400CE01FB /* QNConfig.h */; };
4342
DF2CDE6019DAC6A400CE01FB /* QNCrc32.h in Headers */ = {isa = PBXBuildFile; fileRef = DF2CDE5219DAC6A400CE01FB /* QNCrc32.h */; };
4443
DF2CDE6119DAC6A400CE01FB /* QNCrc32.m in Sources */ = {isa = PBXBuildFile; fileRef = DF2CDE5319DAC6A400CE01FB /* QNCrc32.m */; };
4544
DF2CDE6219DAC6A400CE01FB /* QNCrc32.m in Sources */ = {isa = PBXBuildFile; fileRef = DF2CDE5319DAC6A400CE01FB /* QNCrc32.m */; };
@@ -60,6 +59,11 @@
6059
DF3C504819DD7BA6000F548F /* QNFormUploadTest.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3C504619DD7BA6000F548F /* QNFormUploadTest.m */; };
6160
DF3C504A19DD7D9F000F548F /* QNResumeUploadTest.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3C504919DD7D9F000F548F /* QNResumeUploadTest.m */; };
6261
DF3C504B19DD7D9F000F548F /* QNResumeUploadTest.m in Sources */ = {isa = PBXBuildFile; fileRef = DF3C504919DD7D9F000F548F /* QNResumeUploadTest.m */; };
62+
DF482FD81B0DA8A2000DAD98 /* QNConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = DF482FD61B0DA8A2000DAD98 /* QNConfiguration.h */; };
63+
DF482FD91B0DA8A2000DAD98 /* QNConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = DF482FD71B0DA8A2000DAD98 /* QNConfiguration.m */; };
64+
DF482FDA1B0DA8A2000DAD98 /* QNConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = DF482FD71B0DA8A2000DAD98 /* QNConfiguration.m */; };
65+
DF4830011B0E3654000DAD98 /* QNConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = DF482FD71B0DA8A2000DAD98 /* QNConfiguration.m */; };
66+
DF4830021B0E365F000DAD98 /* QNConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = DF482FD71B0DA8A2000DAD98 /* QNConfiguration.m */; };
6367
DF6099FA1A5676AA00AC7297 /* QNDns.h in Headers */ = {isa = PBXBuildFile; fileRef = DF6099F91A5676AA00AC7297 /* QNDns.h */; };
6468
DF6099FC1A5676CA00AC7297 /* QNDns.m in Sources */ = {isa = PBXBuildFile; fileRef = DF6099FB1A5676CA00AC7297 /* QNDns.m */; };
6569
DF6099FD1A5676CA00AC7297 /* QNDns.m in Sources */ = {isa = PBXBuildFile; fileRef = DF6099FB1A5676CA00AC7297 /* QNDns.m */; };
@@ -99,10 +103,6 @@
99103
DFA9B66219E3A4F600A15FD1 /* QNUploadOption.m in Sources */ = {isa = PBXBuildFile; fileRef = DFA9B64819E0018800A15FD1 /* QNUploadOption.m */; };
100104
DFBC622519DE459800458C4B /* QNHttpTest.m in Sources */ = {isa = PBXBuildFile; fileRef = DFBC622419DE459800458C4B /* QNHttpTest.m */; };
101105
DFBC622619DE459800458C4B /* QNHttpTest.m in Sources */ = {isa = PBXBuildFile; fileRef = DFBC622419DE459800458C4B /* QNHttpTest.m */; };
102-
DFBC622819DE578600458C4B /* QNConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = DFBC622719DE578600458C4B /* QNConfig.m */; };
103-
DFBC622919DE578600458C4B /* QNConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = DFBC622719DE578600458C4B /* QNConfig.m */; };
104-
DFBC622A19DE5E2500458C4B /* QNConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = DFBC622719DE578600458C4B /* QNConfig.m */; };
105-
DFBC622B19DE5E3200458C4B /* QNConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = DFBC622719DE578600458C4B /* QNConfig.m */; };
106106
DFF525311A6235D100D02BA1 /* QNSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = DFF5252F1A6235D100D02BA1 /* QNSessionManager.h */; };
107107
DFF525321A6235D100D02BA1 /* QNSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DFF525301A6235D100D02BA1 /* QNSessionManager.m */; };
108108
DFF525331A6235D100D02BA1 /* QNSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DFF525301A6235D100D02BA1 /* QNSessionManager.m */; };
@@ -158,7 +158,6 @@
158158
DF2CDE2419DAC08400CE01FB /* QiniuSDK iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "QiniuSDK iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
159159
DF2CDE4F19DAC6A400CE01FB /* QNUrlSafeBase64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNUrlSafeBase64.h; sourceTree = "<group>"; };
160160
DF2CDE5019DAC6A400CE01FB /* QNUrlSafeBase64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNUrlSafeBase64.m; sourceTree = "<group>"; };
161-
DF2CDE5119DAC6A400CE01FB /* QNConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNConfig.h; sourceTree = "<group>"; };
162161
DF2CDE5219DAC6A400CE01FB /* QNCrc32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNCrc32.h; sourceTree = "<group>"; };
163162
DF2CDE5319DAC6A400CE01FB /* QNCrc32.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNCrc32.m; sourceTree = "<group>"; };
164163
DF2CDE5719DAC6A400CE01FB /* QNVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNVersion.h; sourceTree = "<group>"; };
@@ -168,6 +167,8 @@
168167
DF2CDE7019DAE90300CE01FB /* QNBase64Test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNBase64Test.m; sourceTree = "<group>"; };
169168
DF3C504619DD7BA6000F548F /* QNFormUploadTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNFormUploadTest.m; sourceTree = "<group>"; };
170169
DF3C504919DD7D9F000F548F /* QNResumeUploadTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNResumeUploadTest.m; sourceTree = "<group>"; };
170+
DF482FD61B0DA8A2000DAD98 /* QNConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNConfiguration.h; sourceTree = "<group>"; };
171+
DF482FD71B0DA8A2000DAD98 /* QNConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNConfiguration.m; sourceTree = "<group>"; };
171172
DF6099F91A5676AA00AC7297 /* QNDns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNDns.h; sourceTree = "<group>"; };
172173
DF6099FB1A5676CA00AC7297 /* QNDns.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNDns.m; sourceTree = "<group>"; };
173174
DF609A001A5839B400AC7297 /* QNDnsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNDnsTest.m; sourceTree = "<group>"; };
@@ -188,7 +189,6 @@
188189
DFA9B65D19E0EDF100A15FD1 /* QNUploadOption+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "QNUploadOption+Private.h"; sourceTree = "<group>"; };
189190
DFA9B65E19E391A100A15FD1 /* QNTestConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNTestConfig.h; sourceTree = "<group>"; };
190191
DFBC622419DE459800458C4B /* QNHttpTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNHttpTest.m; sourceTree = "<group>"; };
191-
DFBC622719DE578600458C4B /* QNConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNConfig.m; sourceTree = "<group>"; };
192192
DFF5252F1A6235D100D02BA1 /* QNSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNSessionManager.h; sourceTree = "<group>"; };
193193
DFF525301A6235D100D02BA1 /* QNSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNSessionManager.m; sourceTree = "<group>"; };
194194
DFF525361A626A3700D02BA1 /* QNhttpDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNhttpDelegate.h; sourceTree = "<group>"; };
@@ -323,11 +323,9 @@
323323
DFA39AA319F1272800A1A158 /* QNAsyncRun.m */,
324324
DF2CDE4F19DAC6A400CE01FB /* QNUrlSafeBase64.h */,
325325
DF2CDE5019DAC6A400CE01FB /* QNUrlSafeBase64.m */,
326-
DF2CDE5119DAC6A400CE01FB /* QNConfig.h */,
327326
DF2CDE5219DAC6A400CE01FB /* QNCrc32.h */,
328327
DF2CDE5319DAC6A400CE01FB /* QNCrc32.m */,
329328
DF2CDE5719DAC6A400CE01FB /* QNVersion.h */,
330-
DFBC622719DE578600458C4B /* QNConfig.m */,
331329
DFA9B63919DF904000A15FD1 /* QNEtag.h */,
332330
DFA9B63A19DF904000A15FD1 /* QNEtag.m */,
333331
);
@@ -346,6 +344,8 @@
346344
DFA9B65D19E0EDF100A15FD1 /* QNUploadOption+Private.h */,
347345
DF609A031A58E39D00AC7297 /* QNFormUpload.h */,
348346
DF609A041A58E39D00AC7297 /* QNFormUpload.m */,
347+
DF482FD61B0DA8A2000DAD98 /* QNConfiguration.h */,
348+
DF482FD71B0DA8A2000DAD98 /* QNConfiguration.m */,
349349
);
350350
path = Storage;
351351
sourceTree = "<group>";
@@ -392,6 +392,7 @@
392392
DF2CDE6719DAC6A400CE01FB /* QNVersion.h in Headers */,
393393
DF293CA419DC04C200799011 /* QNHttpManager.h in Headers */,
394394
DFA9B65819E0B53700A15FD1 /* QNFileRecorder.h in Headers */,
395+
DF482FD81B0DA8A2000DAD98 /* QNConfiguration.h in Headers */,
395396
DF609A051A58E39D00AC7297 /* QNFormUpload.h in Headers */,
396397
DFF525371A626A3700D02BA1 /* QNhttpDelegate.h in Headers */,
397398
DF2CDE6019DAC6A400CE01FB /* QNCrc32.h in Headers */,
@@ -402,7 +403,6 @@
402403
DFF525311A6235D100D02BA1 /* QNSessionManager.h in Headers */,
403404
DF2CDE6819DAC6A400CE01FB /* QiniuSDK.h in Headers */,
404405
DF2CDE6919DAC6A400CE01FB /* QNUploadManager.h in Headers */,
405-
DF2CDE5F19DAC6A400CE01FB /* QNConfig.h in Headers */,
406406
DF293CA919DC0AF000799011 /* QNResumeUpload.h in Headers */,
407407
DFA39AA419F1272800A1A158 /* QNAsyncRun.h in Headers */,
408408
);
@@ -678,8 +678,8 @@
678678
DF2CDE5D19DAC6A400CE01FB /* QNUrlSafeBase64.m in Sources */,
679679
DF0D23CF19DCE6E500D6B68F /* QNResponseInfo.m in Sources */,
680680
DFA9B63C19DF904000A15FD1 /* QNEtag.m in Sources */,
681+
DF482FD91B0DA8A2000DAD98 /* QNConfiguration.m in Sources */,
681682
DF609A061A58E39D00AC7297 /* QNFormUpload.m in Sources */,
682-
DFBC622819DE578600458C4B /* QNConfig.m in Sources */,
683683
DF293C9F19DBC2AE00799011 /* QNUserAgent.m in Sources */,
684684
DFA9B65919E0B53700A15FD1 /* QNFileRecorder.m in Sources */,
685685
DF2CDE6119DAC6A400CE01FB /* QNCrc32.m in Sources */,
@@ -697,11 +697,11 @@
697697
isa = PBXSourcesBuildPhase;
698698
buildActionMask = 2147483647;
699699
files = (
700+
DF4830011B0E3654000DAD98 /* QNConfiguration.m in Sources */,
700701
DFA9B66019E3A4E400A15FD1 /* QNUploadOption.m in Sources */,
701702
DFFE0E6019E6575600D7A0FC /* QNFileRecorderTest.m in Sources */,
702703
DFA9B65F19E3A4DD00A15FD1 /* QNFileRecorder.m in Sources */,
703704
DFA9B64219DFDA6800A15FD1 /* QNEtag.m in Sources */,
704-
DFBC622A19DE5E2500458C4B /* QNConfig.m in Sources */,
705705
DF3C504719DD7BA6000F548F /* QNFormUploadTest.m in Sources */,
706706
DF609A011A5839B400AC7297 /* QNDnsTest.m in Sources */,
707707
DF0D23D219DCF02C00D6B68F /* QNResponseInfo.m in Sources */,
@@ -732,8 +732,8 @@
732732
DF2CDE5E19DAC6A400CE01FB /* QNUrlSafeBase64.m in Sources */,
733733
DF0D23D019DCE6E500D6B68F /* QNResponseInfo.m in Sources */,
734734
DFA9B63D19DF904000A15FD1 /* QNEtag.m in Sources */,
735+
DF482FDA1B0DA8A2000DAD98 /* QNConfiguration.m in Sources */,
735736
DF609A081A58E39D00AC7297 /* QNFormUpload.m in Sources */,
736-
DFBC622919DE578600458C4B /* QNConfig.m in Sources */,
737737
DF293CA019DBC2AE00799011 /* QNUserAgent.m in Sources */,
738738
DFA9B65A19E0B53700A15FD1 /* QNFileRecorder.m in Sources */,
739739
DF2CDE6219DAC6A400CE01FB /* QNCrc32.m in Sources */,
@@ -751,11 +751,11 @@
751751
isa = PBXSourcesBuildPhase;
752752
buildActionMask = 2147483647;
753753
files = (
754+
DF4830021B0E365F000DAD98 /* QNConfiguration.m in Sources */,
754755
DFA9B66219E3A4F600A15FD1 /* QNUploadOption.m in Sources */,
755756
DFFE0E6119E6575600D7A0FC /* QNFileRecorderTest.m in Sources */,
756757
DFA9B66119E3A4EE00A15FD1 /* QNFileRecorder.m in Sources */,
757758
DFA9B64119DFDA5F00A15FD1 /* QNEtag.m in Sources */,
758-
DFBC622B19DE5E3200458C4B /* QNConfig.m in Sources */,
759759
DF3C504819DD7BA6000F548F /* QNFormUploadTest.m in Sources */,
760760
DF609A021A5839B400AC7297 /* QNDnsTest.m in Sources */,
761761
DF0D23D119DCF02400D6B68F /* QNResponseInfo.m in Sources */,

QiniuSDK.xcodeproj/xcshareddata/xcschemes/QiniuSDK Mac.xcscheme

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@
4949
ignoresPersistentStateOnLaunch = "NO"
5050
debugDocumentVersioning = "YES"
5151
allowLocationSimulation = "YES">
52+
<MacroExpansion>
53+
<BuildableReference
54+
BuildableIdentifier = "primary"
55+
BlueprintIdentifier = "DF2CDDFE19DAC05500CE01FB"
56+
BuildableName = "libQiniuSDK Mac.dylib"
57+
BlueprintName = "QiniuSDK Mac"
58+
ReferencedContainer = "container:QiniuSDK.xcodeproj">
59+
</BuildableReference>
60+
</MacroExpansion>
5261
<AdditionalOptions>
5362
</AdditionalOptions>
5463
</LaunchAction>

QiniuSDK/Common/QNConfig.h

Lines changed: 0 additions & 44 deletions
This file was deleted.

QiniuSDK/Common/QNConfig.m

Lines changed: 0 additions & 28 deletions
This file was deleted.

QiniuSDK/Common/QNCrc32.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#import <zlib.h>
1010

1111
#import "QNCrc32.h"
12-
#import "QNConfig.h"
12+
#import "QNConfiguration.h"
1313

1414
@implementation QNCrc32
1515

QiniuSDK/Common/QNEtag.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <CommonCrypto/CommonCrypto.h>
1010

1111
#import "QNEtag.h"
12-
#import "QNConfig.h"
12+
#import "QNConfiguration.h"
1313
#import "QNUrlSafeBase64.h"
1414

1515
@implementation QNEtag

QiniuSDK/Http/QNHttpManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
@interface QNHttpManager : NSObject <QNHttpDelegate>
1313

14+
- (instancetype)initWithTimeout:(UInt32)timeout;
15+
1416
- (void)multipartPost:(NSString *)url
1517
withData:(NSData *)data
1618
withParams:(NSDictionary *)params

QiniuSDK/Http/QNHttpManager.m

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,32 @@
88

99
#import <AFNetworking/AFNetworking.h>
1010

11-
#import "QNConfig.h"
11+
#import "QNConfiguration.h"
1212
#import "QNHttpManager.h"
1313
#import "QNUserAgent.h"
1414
#import "QNResponseInfo.h"
1515

1616
@interface QNHttpManager ()
1717
@property (nonatomic) AFHTTPRequestOperationManager *httpManager;
18+
@property UInt32 timeout;
1819
@end
1920

2021
@implementation QNHttpManager
2122

22-
- (instancetype)init {
23+
- (instancetype)initWithTimeout:(UInt32)timeout {
2324
if (self = [super init]) {
2425
_httpManager = [[AFHTTPRequestOperationManager alloc] init];
2526
_httpManager.responseSerializer = [AFJSONResponseSerializer serializer];
27+
_timeout = timeout;
2628
}
2729

2830
return self;
2931
}
3032

33+
- (instancetype)init {
34+
return [self initWithTimeout:60];
35+
}
36+
3137
+ (QNResponseInfo *)buildResponseInfo:(AFHTTPRequestOperation *)operation
3238
withError:(NSError *)error
3339
withDuration:(double)duration
@@ -81,7 +87,7 @@ - (void) sendRequest:(NSMutableURLRequest *)request
8187
progressBlock(totalBytesWritten, totalBytesExpectedToWrite);
8288
}];
8389
}
84-
[request setTimeoutInterval:kQNTimeoutInterval];
90+
[request setTimeoutInterval:_timeout];
8591

8692
[request setValue:QNUserAgent() forHTTPHeaderField:@"User-Agent"];
8793
[request setValue:nil forHTTPHeaderField:@"Accept-Language"];

0 commit comments

Comments
 (0)