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

Added Target for creating a static library #365

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
af00020
Merged with latest ASIHTTPRequest version from pokeb
adib Jul 3, 2012
3fb0755
Added library targets:
adib Jul 3, 2012
a5ff222
make it use correct ssl settings for ios 5.0 and 5.0.1
ralphshao Apr 1, 2013
55b00e2
revised ssl settings -- last commit didn't work unless validation was…
ralphshao Apr 29, 2013
cd87060
Add target to create a static library (iOS). Fixed conflicts with Rea…
May 22, 2013
c2acc22
Merge remote-tracking branch 'adib/master' into upstream-master
May 22, 2013
46d4219
Ignore orig files
May 22, 2013
d4ffb7a
Merge remote-tracking branch 'ralphshao/master' into upstream-master
May 22, 2013
5590066
ASIInputStream Support ARC
whlsxl Oct 10, 2013
0513a29
ASIDataDecompressor ARC
whlsxl Oct 12, 2013
dbdd651
ASIDataCompressor ARC
whlsxl Oct 12, 2013
1eb4f43
ASIHTTPRequest.h .m partial support ARC
whlsxl Oct 18, 2013
f4d7903
change + (void)updateProgressIndicator:(id*)indicator withProgress:(u…
whlsxl Oct 18, 2013
02a2bb3
Solve some ARC problem
whlsxl Oct 18, 2013
1e63d75
Solve PerformSelectorLeakWarning
whlsxl Oct 18, 2013
bfb37ac
Modify 2 properties
whlsxl Oct 18, 2013
87ce272
change + (void)performSelector:(SEL)selector onTarget:(id *)target wi…
whlsxl Oct 19, 2013
e0ed765
fix a memery leak
whlsxl Oct 20, 2013
1c606ed
fix a memery leak
whlsxl Oct 20, 2013
7d707ac
fix a warning
whlsxl Oct 20, 2013
a0c1383
update README
whlsxl Oct 20, 2013
21e579c
ASIFormDataRequest support ARC
whlsxl Oct 20, 2013
ac9e7ca
ASINetwrokQueue support ARC
whlsxl Oct 20, 2013
a882165
ASIAuthenticationDialog support ARC
whlsxl Oct 20, 2013
66c7291
change README
whlsxl Oct 20, 2013
8232e38
update Reachability to v3.1.1
whlsxl Oct 20, 2013
083f2ba
ASIDownloadCache and ASIWebPageRequest support ARC
whlsxl Oct 20, 2013
3fbad09
Fix test file warning
whlsxl Oct 20, 2013
94d2a03
Fix fake memery leak on test files
whlsxl Oct 20, 2013
94a7e16
Add some __bridge
whlsxl Oct 21, 2013
ea1d87d
ASIInputStream request change to weak
whlsxl Oct 21, 2013
882bef6
Fix some warning
whlsxl Oct 21, 2013
a0e88c8
1.Adjust format 2.add releaseBlocksOnMainThread when dealloc
whlsxl Oct 21, 2013
9d79fc9
Do not copy the library into the IPA. Otherwise we will not be able t…
eilers May 13, 2014
4c0e599
Disable building for active target until 64Bit is supported.
eilers May 13, 2014
fac8f7a
Fixed warnings.
eilers May 15, 2014
bce4cdb
Fixed incorrect error test.
eilers May 15, 2014
246ddc9
Merge branch 'master' of github.com:whlsxl/asi-http-request
eilers May 15, 2014
cd4cc9f
Fixed again Reachability after merge: Reachability is widely used in …
eilers May 15, 2014
f58b817
Add translation of errors.
eilers Jun 5, 2014
b9937af
Add a notification into control center if the upload was stopped by iOS
eilers Jun 13, 2014
a30b342
stupid idea to set the badge here.
eilers Jun 17, 2014
77a8cb8
Make sure that background tasks for uploading will overlapping a litt…
eilers Jun 23, 2014
0d98e60
Enabled 64-Bit architectures
TuongNM Jun 14, 2017
55a0dbf
Merge pull request #1 from TuongNM/master
eilers Jun 14, 2017
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ profile
*.pbxuser
*.mode1v3
External/GHUnit/*
.svn
.svn
*.orig
7 changes: 7 additions & 0 deletions ASIHTTPRequest-OSX/ASIHTTPRequestOSX-Prefix.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'ASIHTTPRequest' target in the 'ASIHTTPRequest' project
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
7 changes: 7 additions & 0 deletions ASIHTTPRequest-iOS/ASIHTTPRequestIOS-Prefix.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'ASIHTTPRequestMobile' target in the 'ASIHTTPRequestMobile' project
//

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif
44 changes: 44 additions & 0 deletions ASIHTTPResourceBundle/ASIHTTPResourceBundle-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.intelligentmobiles.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>CFPlugInDynamicRegisterFunction</key>
<string></string>
<key>CFPlugInDynamicRegistration</key>
<string>NO</string>
<key>CFPlugInFactories</key>
<dict>
<key>00000000-0000-0000-0000-000000000000</key>
<string>MyFactoryFunction</string>
</dict>
<key>CFPlugInTypes</key>
<dict>
<key>00000000-0000-0000-0000-000000000000</key>
<array>
<string>00000000-0000-0000-0000-000000000000</string>
</array>
</dict>
<key>CFPlugInUnloadFunction</key>
<string></string>
</dict>
</plist>
9 changes: 9 additions & 0 deletions ASIHTTPResourceBundle/ASIHTTPResourceBundle-Prefix.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
2 changes: 2 additions & 0 deletions ASIHTTPResourceBundle/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

36 changes: 14 additions & 22 deletions Classes/ASIAuthenticationDialog.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ @implementation ASIAuthenticationDialog
+ (void)initialize
{
if (self == [ASIAuthenticationDialog class]) {
requestsNeedingAuthentication = [[NSMutableArray array] retain];
requestsNeedingAuthentication = [NSMutableArray array];
}
}

Expand Down Expand Up @@ -98,12 +98,7 @@ - (void)dealloc
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
}
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];

[request release];
[tableView release];
[presentingController.view removeFromSuperview];
[presentingController release];
[super dealloc];
}

#pragma mark keyboard notifications
Expand Down Expand Up @@ -217,18 +212,15 @@ - (UITextField *)domainField
+ (void)dismiss
{
if ([sharedDialog respondsToSelector:@selector(presentingViewController)])
[[sharedDialog presentingViewController] dismissModalViewControllerAnimated:YES];
[[sharedDialog presentingViewController] dismissViewControllerAnimated:YES completion:nil];
else
[[sharedDialog parentViewController] dismissModalViewControllerAnimated:YES];
[[sharedDialog parentViewController] dismissViewControllerAnimated:YES completion:nil];
}

- (void)viewDidDisappear:(BOOL)animated
{
[self retain];
[sharedDialog release];
sharedDialog = nil;
[self performSelector:@selector(presentNextDialog) withObject:nil afterDelay:0];
[self release];
sharedDialog = nil;
}

- (void)dismiss
Expand All @@ -237,9 +229,9 @@ - (void)dismiss
[[self class] dismiss];
} else {
if ([self respondsToSelector:@selector(presentingViewController)])
[[self presentingViewController] dismissModalViewControllerAnimated:YES];
[[self presentingViewController] dismissViewControllerAnimated:YES completion:nil];
else
[[self parentViewController] dismissModalViewControllerAnimated:YES];
[[self parentViewController] dismissViewControllerAnimated:YES completion:nil];
}
}

Expand Down Expand Up @@ -273,10 +265,10 @@ - (void)show
}

// Setup toolbar
UINavigationBar *bar = [[[UINavigationBar alloc] init] autorelease];
UINavigationBar *bar = [[UINavigationBar alloc] init];
[bar setAutoresizingMask:UIViewAutoresizingFlexibleWidth];

UINavigationItem *navItem = [[[UINavigationItem alloc] init] autorelease];
UINavigationItem *navItem = [[UINavigationItem alloc] init];
bar.items = [NSArray arrayWithObject:navItem];

[[self view] addSubview:bar];
Expand All @@ -290,16 +282,16 @@ - (void)show
[navItem setTitle:[[[self request] url] host]];
}

[navItem setLeftBarButtonItem:[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelAuthenticationFromDialog:)] autorelease]];
[navItem setRightBarButtonItem:[[[UIBarButtonItem alloc] initWithTitle:@"Login" style:UIBarButtonItemStyleDone target:self action:@selector(loginWithCredentialsFromDialog:)] autorelease]];
[navItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelAuthenticationFromDialog:)]];
[navItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithTitle:@"Login" style:UIBarButtonItemStyleDone target:self action:@selector(loginWithCredentialsFromDialog:)]];

// We show the login form in a table view, similar to Safari's authentication dialog
[bar sizeToFit];
CGRect f = [[self view] bounds];
f.origin.y = [bar frame].size.height;
f.size.height -= f.origin.y;

[self setTableView:[[[UITableView alloc] initWithFrame:f style:UITableViewStyleGrouped] autorelease]];
[self setTableView:[[UITableView alloc] initWithFrame:f style:UITableViewStyleGrouped]];
[[self tableView] setDelegate:self];
[[self tableView] setDataSource:self];
[[self tableView] setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
Expand All @@ -315,7 +307,7 @@ - (void)show
}
#endif

[[self presentingController] presentModalViewController:self animated:YES];
[[self presentingController] presentViewController:self animated:YES completion:nil];
}

#pragma mark button callbacks
Expand Down Expand Up @@ -431,15 +423,15 @@ - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInte
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_0
UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease];
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
#else
UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:CGRectMake(0,0,0,0) reuseIdentifier:nil] autorelease];
#endif

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];

CGRect f = CGRectInset([cell bounds], 10, 10);
UITextField *textField = [[[UITextField alloc] initWithFrame:f] autorelease];
UITextField *textField = [[UITextField alloc] initWithFrame:f];
[textField setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[textField setAutocapitalizationType:UITextAutocapitalizationTypeNone];
[textField setAutocorrectionType:UITextAutocorrectionTypeNo];
Expand Down
38 changes: 19 additions & 19 deletions Classes/ASICacheDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,37 @@
// Note that some of the behaviours below are mutally exclusive - you cannot combine ASIAskServerIfModifiedWhenStaleCachePolicy and ASIAskServerIfModifiedCachePolicy, for example.
typedef enum _ASICachePolicy {

// The default cache policy. When you set a request to use this, it will use the cache's defaultCachePolicy
// ASIDownloadCache's default cache policy is 'ASIAskServerIfModifiedWhenStaleCachePolicy'
ASIUseDefaultCachePolicy = 0,
// The default cache policy. When you set a request to use this, it will use the cache's defaultCachePolicy
// ASIDownloadCache's default cache policy is 'ASIAskServerIfModifiedWhenStaleCachePolicy'
ASIUseDefaultCachePolicy = 0,

// Tell the request not to read from the cache
ASIDoNotReadFromCacheCachePolicy = 1,
// Tell the request not to read from the cache
ASIDoNotReadFromCacheCachePolicy = 1,

// The the request not to write to the cache
ASIDoNotWriteToCacheCachePolicy = 2,
// The the request not to write to the cache
ASIDoNotWriteToCacheCachePolicy = 2,

// Ask the server if there is an updated version of this resource (using a conditional GET) ONLY when the cached data is stale
ASIAskServerIfModifiedWhenStaleCachePolicy = 4,
// Ask the server if there is an updated version of this resource (using a conditional GET) ONLY when the cached data is stale
ASIAskServerIfModifiedWhenStaleCachePolicy = 4,

// Always ask the server if there is an updated version of this resource (using a conditional GET)
ASIAskServerIfModifiedCachePolicy = 8,
// Always ask the server if there is an updated version of this resource (using a conditional GET)
ASIAskServerIfModifiedCachePolicy = 8,

// If cached data exists, use it even if it is stale. This means requests will not talk to the server unless the resource they are requesting is not in the cache
ASIOnlyLoadIfNotCachedCachePolicy = 16,
// If cached data exists, use it even if it is stale. This means requests will not talk to the server unless the resource they are requesting is not in the cache
ASIOnlyLoadIfNotCachedCachePolicy = 16,

// If cached data exists, use it even if it is stale. If cached data does not exist, stop (will not set an error on the request)
ASIDontLoadCachePolicy = 32,
// If cached data exists, use it even if it is stale. If cached data does not exist, stop (will not set an error on the request)
ASIDontLoadCachePolicy = 32,

// Specifies that cached data may be used if the request fails. If cached data is used, the request will succeed without error. Usually used in combination with other options above.
ASIFallbackToCacheIfLoadFailsCachePolicy = 64
// Specifies that cached data may be used if the request fails. If cached data is used, the request will succeed without error. Usually used in combination with other options above.
ASIFallbackToCacheIfLoadFailsCachePolicy = 64
} ASICachePolicy;

// Cache storage policies control whether cached data persists between application launches (ASICachePermanentlyCacheStoragePolicy) or not (ASICacheForSessionDurationCacheStoragePolicy)
// Calling [ASIHTTPRequest clearSession] will remove any data stored using ASICacheForSessionDurationCacheStoragePolicy
typedef enum _ASICacheStoragePolicy {
ASICacheForSessionDurationCacheStoragePolicy = 0,
ASICachePermanentlyCacheStoragePolicy = 1
ASICacheForSessionDurationCacheStoragePolicy = 0,
ASICachePermanentlyCacheStoragePolicy = 1
} ASICacheStoragePolicy;


Expand Down
5 changes: 2 additions & 3 deletions Classes/ASIDataCompressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
#import <zlib.h>

@interface ASIDataCompressor : NSObject {
BOOL streamReady;
z_stream zStream;
z_stream zStream;
}

// Convenience constructor will call setupStream for you
+ (id)compressor;
+ (instancetype)compressor;

// Compress the passed chunk of data
// Passing YES for shouldFinish will finalize the deflated data - you must pass YES when you are on the last chunk of data
Expand Down
18 changes: 8 additions & 10 deletions Classes/ASIDataCompressor.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,23 @@ + (NSError *)deflateErrorWithCode:(int)code;

@implementation ASIDataCompressor

+ (id)compressor
+ (instancetype)compressor
{
ASIDataCompressor *compressor = [[[self alloc] init] autorelease];
ASIDataCompressor *compressor = [[self alloc] init];
[compressor setupStream];
return compressor;
}

- (void)dealloc
{
if (streamReady) {
if (_streamReady) {
[self closeStream];
}
[super dealloc];
}

- (NSError *)setupStream
{
if (streamReady) {
if (_streamReady) {
return nil;
}
// Setup the inflate stream
Expand All @@ -48,17 +47,17 @@ - (NSError *)setupStream
if (status != Z_OK) {
return [[self class] deflateErrorWithCode:status];
}
streamReady = YES;
_streamReady = YES;
return nil;
}

- (NSError *)closeStream
{
if (!streamReady) {
if (!_streamReady) {
return nil;
}
// Close the deflate stream
streamReady = NO;
_streamReady = NO;
int status = deflateEnd(&zStream);
if (status != Z_OK) {
return [[self class] deflateErrorWithCode:status];
Expand Down Expand Up @@ -125,7 +124,7 @@ + (NSData *)compressData:(NSData*)uncompressedData error:(NSError **)err

+ (BOOL)compressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destinationPath error:(NSError **)err
{
NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease];
NSFileManager *fileManager = [[NSFileManager alloc] init];

// Create an empty file at the destination path
if (![fileManager createFileAtPath:destinationPath contents:[NSData data] attributes:nil]) {
Expand Down Expand Up @@ -215,5 +214,4 @@ + (NSError *)deflateErrorWithCode:(int)code
return [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of data failed with code %d",code],NSLocalizedDescriptionKey,nil]];
}

@synthesize streamReady;
@end
3 changes: 1 addition & 2 deletions Classes/ASIDataDecompressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
#import <zlib.h>

@interface ASIDataDecompressor : NSObject {
BOOL streamReady;
z_stream zStream;
}

// Convenience constructor will call setupStream for you
+ (id)decompressor;
+ (instancetype)decompressor;

// Uncompress the passed chunk of data
- (NSData *)uncompressBytes:(Bytef *)bytes length:(NSUInteger)length error:(NSError **)err;
Expand Down
Loading