Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove the dependencies on ASIHTTPRequest and YAJL JSON.

  • Loading branch information...
commit 8ab22638aab4940b3886e1ef1c7c3b067757f4ea 1 parent 1413c0a
Luke Redpath authored
16  .gitignore
@@ -3,8 +3,22 @@ build/*
3 3
 *.pbxuser
4 4
 *.mode1v3
5 5
 *.mode*
  6
+*.perspectivev*
6 7
 
7 8
 # osx noise
8 9
 .DS_Store
9 10
 profile
10  
-*.perspectivev3
  11
+
  12
+Constants.h
  13
+*.xcodeproj/xcuserdata
  14
+*.xcodeproj/*.xcworkspace/xcuserdata
  15
+*.xcworkspace/xcuserdata
  16
+
  17
+log
  18
+Scripts/*.pid
  19
+Docs
  20
+Pods
  21
+xcodebuild
  22
+dist
  23
+.bundle
  24
+xcodebuild.log
5  Classes/LROAuth2Client.h
@@ -7,12 +7,11 @@
7 7
 //
8 8
 
9 9
 #import <UIKit/UIKit.h>
10  
-#import "ASIHTTPRequestDelegate.h"
11 10
 #import "LROAuth2ClientDelegate.h"
12 11
 
13 12
 @class LROAuth2AccessToken;
14 13
 
15  
-@interface LROAuth2Client : NSObject <ASIHTTPRequestDelegate> {
  14
+@interface LROAuth2Client : NSObject {
16 15
   NSString *clientID;
17 16
   NSString *clientSecret;
18 17
   NSURL *redirectURL;
@@ -25,7 +24,7 @@
25 24
   BOOL debug;
26 25
   
27 26
  @private
28  
-  BOOL isVerifying;   
  27
+  BOOL isVerifying;
29 28
 }
30 29
 @property (nonatomic, copy) NSString *clientID;
31 30
 @property (nonatomic, copy) NSString *clientSecret;
128  Classes/LROAuth2Client.m
@@ -8,14 +8,16 @@
8 8
 
9 9
 #import <YAJLIOS/NSObject+YAJL.h>
10 10
 #import "LROAuth2Client.h"
11  
-#import "ASIHTTPRequest.h"
12 11
 #import "NSURL+QueryInspector.h"
13 12
 #import "LROAuth2AccessToken.h"
  13
+#import "LRURLRequestOperation.h"
14 14
 #import "NSDictionary+QueryString.h"
15 15
 
16 16
 #pragma mark -
17 17
 
18  
-@implementation LROAuth2Client
  18
+@implementation LROAuth2Client {
  19
+  NSOperationQueue *_networkQueue;
  20
+}
19 21
 
20 22
 @synthesize clientID;
21 23
 @synthesize clientSecret;
@@ -37,17 +39,14 @@ - (id)initWithClientID:(NSString *)_clientID
37 39
     redirectURL = [url copy];
38 40
     requests = [[NSMutableArray alloc] init];
39 41
     debug = NO;
  42
+    _networkQueue = [[NSOperationQueue alloc] init];
40 43
   }
41 44
   return self;
42 45
 }
43 46
 
44 47
 - (void)dealloc;
45 48
 {
46  
-  for (ASIHTTPRequest *request in requests) {
47  
-    [request setDelegate:nil];
48  
-    [request cancel];
49  
-  }
50  
-  [requests release];
  49
+  [_networkQueue cancelAllOperations];
51 50
   [accessToken release];
52 51
   [clientID release];
53 52
   [clientSecret release];
@@ -94,13 +93,18 @@ - (void)verifyAuthorizationWithAccessCode:(NSString *)accessCode;
94 93
     [params setValue:clientSecret forKey:@"client_secret"];
95 94
     [params setValue:accessCode forKey:@"code"];
96 95
     
97  
-    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:self.tokenURL];
98  
-    [request setRequestMethod:@"POST"];
99  
-    [request addRequestHeader:@"Content-Type" value:@"application/x-www-form-urlencoded"];
100  
-    [request appendPostData:[[params stringWithFormEncodedComponents] dataUsingEncoding:NSUTF8StringEncoding]];
101  
-    [request setDelegate:self];
102  
-    [requests addObject:request];
103  
-    [request startAsynchronous];
  96
+    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:self.tokenURL];
  97
+    [request setHTTPMethod:@"POST"];
  98
+    [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
  99
+    [request setHTTPBody:[[params stringWithFormEncodedComponents] dataUsingEncoding:NSUTF8StringEncoding]];
  100
+    
  101
+    __block LRURLRequestOperation *operation = [[LRURLRequestOperation alloc] initWithURLRequest:request];
  102
+
  103
+    [operation setCompletionBlock:^{
  104
+      [self handleCompletionForAuthorizationRequestOperation:operation];
  105
+    }];
  106
+      
  107
+    [_networkQueue addOperation:operation];
104 108
   }
105 109
 }
106 110
 
@@ -115,71 +119,51 @@ - (void)refreshAccessToken:(LROAuth2AccessToken *)_accessToken;
115 119
   [params setValue:clientSecret forKey:@"client_secret"];
116 120
   [params setValue:_accessToken.refreshToken forKey:@"refresh_token"];
117 121
   
118  
-  ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:self.tokenURL];
119  
-  [request setRequestMethod:@"POST"];
120  
-  [request addRequestHeader:@"Content-Type" value:@"application/x-www-form-urlencoded"];
121  
-  [request appendPostData:[[params stringWithFormEncodedComponents] dataUsingEncoding:NSUTF8StringEncoding]];
122  
-  [request setDelegate:self];
123  
-  [requests addObject:request];
124  
-  [request startAsynchronous];
125  
-}
126  
-
127  
-#pragma mark -
128  
-#pragma mark ASIHTTPRequestDelegate methods
129  
-
130  
-- (void)requestStarted:(ASIHTTPRequest *)request
131  
-{
132  
-  if (self.debug) {
133  
-    NSLog(@"[oauth] starting verification request");
134  
-  }
135  
-}
136  
-
137  
-- (void)requestFinished:(ASIHTTPRequest *)request
138  
-{
139  
-  if (self.debug) {
140  
-    NSLog(@"[oauth] finished verification request, %@ (%d)", [request responseString], [request responseStatusCode]);
141  
-  }
142  
-  isVerifying = NO;
  122
+  NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:self.tokenURL];
  123
+  [request setHTTPMethod:@"POST"];
  124
+  [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
  125
+  [request setHTTPBody:[[params stringWithFormEncodedComponents] dataUsingEncoding:NSUTF8StringEncoding]];
143 126
   
144  
-  [requests removeObject:request];
145  
-}
146  
-
147  
-- (void)requestFailed:(ASIHTTPRequest *)request
148  
-{
149  
-  if (self.debug) {
150  
-    NSLog(@"[oauth] request failed with code %d, %@", [request responseStatusCode], [request responseString]);
151  
-  }
  127
+  __block LRURLRequestOperation *operation = [[LRURLRequestOperation alloc] initWithURLRequest:request];
  128
+  
  129
+  [operation setCompletionBlock:^{
  130
+    [self handleCompletionForAuthorizationRequestOperation:operation];
  131
+  }];
  132
+  
  133
+  [_networkQueue addOperation:operation];
152 134
 }
153 135
 
154  
-- (void)request:(ASIHTTPRequest *)request didReceiveData:(NSData *)rawData
  136
+- (void)handleCompletionForAuthorizationRequestOperation:(LRURLRequestOperation *)operation
155 137
 {
156  
-  NSData* data = rawData;
157  
-  if( [request isResponseCompressed]) {
158  
-    data = [ASIHTTPRequest uncompressZippedData:rawData];
159  
-  }
160  
-    
161  
-  NSError *parseError = nil;
162  
-  NSDictionary *authorizationData = [data yajl_JSON:&parseError];
  138
+  NSHTTPURLResponse *response = (NSHTTPURLResponse *)operation.URLResponse;
163 139
   
164  
-  if (parseError) {
165  
-    // try and decode the response body as a query string instead
166  
-    NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
167  
-    authorizationData = [NSDictionary dictionaryWithFormEncodedString:responseString];
168  
-    [responseString release];
169  
-    if ([authorizationData valueForKey:@"access_token"] == nil) { 
170  
-      // TODO handle complete parsing failure
  140
+  if (response.statusCode == 200) {
  141
+    NSError *parserError;
  142
+    NSDictionary *authData = [NSJSONSerialization JSONObjectWithData:operation.responseData options:0 error:&parserError];
  143
+    
  144
+    if (authData == nil) {
  145
+      // try and decode the response body as a query string instead
  146
+      NSString *responseString = [[NSString alloc] initWithData:operation.responseData encoding:NSUTF8StringEncoding];
  147
+      authData = [NSDictionary dictionaryWithFormEncodedString:responseString];
  148
+    }
  149
+    if ([authData objectForKey:@"access_token"] == nil) {
171 150
       NSAssert(NO, @"Unhandled parsing failure");
172 151
     }
173  
-  }  
174  
-  if (accessToken == nil) {
175  
-    accessToken = [[LROAuth2AccessToken alloc] initWithAuthorizationResponse:authorizationData];
176  
-    if ([self.delegate respondsToSelector:@selector(oauthClientDidReceiveAccessToken:)]) {
177  
-      [self.delegate oauthClientDidReceiveAccessToken:self];
178  
-    } 
179  
-  } else {
180  
-    [accessToken refreshFromAuthorizationResponse:authorizationData];
181  
-    if ([self.delegate respondsToSelector:@selector(oauthClientDidRefreshAccessToken:)]) {
182  
-      [self.delegate oauthClientDidRefreshAccessToken:self];
  152
+    if (accessToken == nil) {
  153
+      accessToken = [[LROAuth2AccessToken alloc] initWithAuthorizationResponse:authData];
  154
+      if ([self.delegate respondsToSelector:@selector(oauthClientDidReceiveAccessToken:)]) {
  155
+        [self.delegate oauthClientDidReceiveAccessToken:self];
  156
+      } 
  157
+    } else {
  158
+      [accessToken refreshFromAuthorizationResponse:authData];
  159
+      if ([self.delegate respondsToSelector:@selector(oauthClientDidRefreshAccessToken:)]) {
  160
+        [self.delegate oauthClientDidRefreshAccessToken:self];
  161
+      }
  162
+    }
  163
+  }
  164
+  else {
  165
+    if (operation.connectionError) {
  166
+      NSLog(@"Connection error: %@", operation.connectionError);
183 167
     }
184 168
   }
185 169
 }
36  Classes/LRURLRequestOperation.h
... ...
@@ -0,0 +1,36 @@
  1
+//
  2
+//  LRURLConnectionOperation.h
  3
+//  LRResty
  4
+//
  5
+//  Created by Luke Redpath on 04/10/2010.
  6
+//  Copyright 2010 LJR Software Limited. All rights reserved.
  7
+//
  8
+
  9
+#import <Foundation/Foundation.h>
  10
+
  11
+
  12
+@interface LRURLRequestOperation : NSOperation {
  13
+  BOOL _isExecuting;
  14
+  BOOL _isFinished;
  15
+  NSURLRequest *URLRequest;
  16
+  NSURLResponse *URLResponse;
  17
+  NSURLConnection *URLConnection;
  18
+  NSError *connectionError;
  19
+  NSMutableData *responseData;
  20
+}
  21
+@property (nonatomic, strong) NSURLRequest *URLRequest;
  22
+@property (nonatomic, strong, readonly) NSURLResponse *URLResponse;
  23
+@property (nonatomic, strong, readonly) NSError *connectionError;
  24
+@property (nonatomic, strong, readonly) NSData *responseData;
  25
+
  26
+- (id)initWithURLRequest:(NSURLRequest *)request;
  27
+- (void)finish;
  28
+- (void)cancelImmediately;
  29
+@end
  30
+
  31
+@interface LRURLRequestOperation (NSURLConnectionDelegate)
  32
+- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)theResponse;
  33
+- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
  34
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection;
  35
+- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error;
  36
+@end
142  Classes/LRURLRequestOperation.m
... ...
@@ -0,0 +1,142 @@
  1
+//
  2
+//  LRURLConnectionOperation.m
  3
+//  LRResty
  4
+//
  5
+//  Created by Luke Redpath on 04/10/2010.
  6
+//  Copyright 2010 LJR Software Limited. All rights reserved.
  7
+//
  8
+
  9
+#import "LRURLRequestOperation.h"
  10
+
  11
+@interface LRURLRequestOperation ()
  12
+@property (nonatomic, strong, readwrite) NSURLResponse *URLResponse;
  13
+@property (nonatomic, strong, readwrite) NSError *connectionError;
  14
+@property (nonatomic, strong, readwrite) NSData *responseData;
  15
+
  16
+- (void)setExecuting:(BOOL)isExecuting;
  17
+- (void)setFinished:(BOOL)isFinished;
  18
+@end
  19
+
  20
+#pragma mark -
  21
+
  22
+@implementation LRURLRequestOperation
  23
+
  24
+@synthesize URLRequest;
  25
+@synthesize URLResponse;
  26
+@synthesize connectionError;
  27
+@synthesize responseData;
  28
+
  29
+- (id)initWithURLRequest:(NSURLRequest *)request;
  30
+{
  31
+  if ((self = [super init])) {
  32
+    URLRequest = request;
  33
+  }
  34
+  return self;
  35
+}
  36
+
  37
+
  38
+- (void)start 
  39
+{
  40
+  NSAssert(URLRequest, @"Cannot start URLRequestOperation without a NSURLRequest.");
  41
+  
  42
+  if (![NSThread isMainThread]) {
  43
+    return [self performSelector:@selector(start) onThread:[NSThread mainThread] withObject:nil waitUntilDone:NO];
  44
+  }
  45
+  
  46
+  [self setExecuting:YES];
  47
+  
  48
+  URLConnection = [[NSURLConnection alloc] initWithRequest:URLRequest delegate:self startImmediately:NO];
  49
+  
  50
+  if (URLConnection == nil) {
  51
+    [self setFinished:YES]; 
  52
+  }
  53
+  
  54
+  // Common modes instead of default so it won't stall uiscrollview scrolling
  55
+  [URLConnection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
  56
+  [URLConnection start];
  57
+}
  58
+
  59
+- (void)finish;
  60
+{
  61
+  [self setFinished:YES];
  62
+}
  63
+
  64
+- (BOOL)isConcurrent
  65
+{
  66
+  return YES;
  67
+}
  68
+
  69
+- (BOOL)isExecuting
  70
+{
  71
+  return _isExecuting;
  72
+}
  73
+
  74
+- (BOOL)isFinished
  75
+{
  76
+  return _isFinished;
  77
+}
  78
+
  79
+#pragma mark -
  80
+#pragma mark NSURLConnection delegate methods
  81
+
  82
+- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)theResponse
  83
+{ 
  84
+  self.URLResponse = theResponse;
  85
+  self.responseData = [NSMutableData data];
  86
+  
  87
+  if ([self isCancelled]) {
  88
+    [connection cancel];
  89
+    [self finish];
  90
+  }
  91
+}
  92
+
  93
+- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
  94
+{
  95
+  if (self.responseData == nil) { // this might be called before didReceiveResponse
  96
+    self.responseData = [NSMutableData data];
  97
+  }
  98
+  
  99
+  [responseData appendData:data];
  100
+  
  101
+  if ([self isCancelled]) {
  102
+    [connection cancel];
  103
+    [self finish];
  104
+  }
  105
+}
  106
+
  107
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection
  108
+{
  109
+  [self finish];
  110
+}
  111
+
  112
+- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
  113
+{
  114
+  self.connectionError = error;
  115
+  [self finish];
  116
+}
  117
+
  118
+- (void)cancelImmediately
  119
+{
  120
+  [URLConnection cancel];
  121
+  [self finish];
  122
+}
  123
+
  124
+#pragma mark -
  125
+#pragma mark Private methods
  126
+
  127
+- (void)setExecuting:(BOOL)isExecuting;
  128
+{
  129
+  [self willChangeValueForKey:@"isExecuting"];
  130
+  _isExecuting = isExecuting;
  131
+  [self didChangeValueForKey:@"isExecuting"];
  132
+}
  133
+
  134
+- (void)setFinished:(BOOL)isFinished;
  135
+{
  136
+  [self willChangeValueForKey:@"isFinished"];
  137
+  [self setExecuting:NO];
  138
+  _isFinished = isFinished;
  139
+  [self didChangeValueForKey:@"isFinished"];
  140
+}
  141
+
  142
+@end
105  LROAuth2Client.xcodeproj/project.pbxproj
@@ -29,50 +29,23 @@
29 29
 		A3289FD9122D819800D89A88 /* LROAuth2Client.h in Headers */ = {isa = PBXBuildFile; fileRef = A3F8BFBA119DEE450035081C /* LROAuth2Client.h */; settings = {ATTRIBUTES = (Public, ); }; };
30 30
 		A3289FDA122D819800D89A88 /* LROAuth2ClientDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A3F8BFBC119DEE450035081C /* LROAuth2ClientDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
31 31
 		A3289FDB122D819800D89A88 /* LROAuth2AccessToken.h in Headers */ = {isa = PBXBuildFile; fileRef = A3F8BFBD119DEE450035081C /* LROAuth2AccessToken.h */; settings = {ATTRIBUTES = (Public, ); }; };
32  
-		A3AE5C19123403C30022C255 /* ASIHTTPRequestDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A3F8C0D4119DEF400035081C /* ASIHTTPRequestDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
33  
-		A3AE5C1A123403C90022C255 /* ASIHTTPRequestDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A3F8C0D4119DEF400035081C /* ASIHTTPRequestDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
34  
-		A3AE5CC71234107A0022C255 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0CF119DEF400035081C /* ASIAuthenticationDialog.m */; };
35  
-		A3AE5CC81234107A0022C255 /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0D1119DEF400035081C /* ASIFormDataRequest.m */; };
36  
-		A3AE5CC91234107A0022C255 /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0D3119DEF400035081C /* ASIHTTPRequest.m */; };
37  
-		A3AE5CCA1234107A0022C255 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0D6119DEF400035081C /* ASIInputStream.m */; };
38  
-		A3AE5CCB1234107A0022C255 /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0D8119DEF400035081C /* ASINetworkQueue.m */; };
39  
-		A3AE5CCC1234107A0022C255 /* ASINSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0DA119DEF400035081C /* ASINSStringAdditions.m */; };
40  
-		A3AE5CCD1234107A0022C255 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0F0119DEF770035081C /* Reachability.m */; };
41  
-		A3AE5CCE1234107B0022C255 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0CF119DEF400035081C /* ASIAuthenticationDialog.m */; };
42  
-		A3AE5CCF1234107B0022C255 /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0D1119DEF400035081C /* ASIFormDataRequest.m */; };
43  
-		A3AE5CD01234107B0022C255 /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0D3119DEF400035081C /* ASIHTTPRequest.m */; };
44  
-		A3AE5CD11234107B0022C255 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0D6119DEF400035081C /* ASIInputStream.m */; };
45  
-		A3AE5CD21234107B0022C255 /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0D8119DEF400035081C /* ASINetworkQueue.m */; };
46  
-		A3AE5CD31234107B0022C255 /* ASINSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0DA119DEF400035081C /* ASINSStringAdditions.m */; };
47  
-		A3AE5CD41234107B0022C255 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = A3F8C0F0119DEF770035081C /* Reachability.m */; };
  32
+		A3ABE4D61528797B006E9AC0 /* LRURLRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = A3ABE4D41528797B006E9AC0 /* LRURLRequestOperation.h */; };
  33
+		A3ABE4D71528797B006E9AC0 /* LRURLRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = A3ABE4D41528797B006E9AC0 /* LRURLRequestOperation.h */; };
  34
+		A3ABE4D81528797B006E9AC0 /* LRURLRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = A3ABE4D51528797B006E9AC0 /* LRURLRequestOperation.m */; };
  35
+		A3ABE4D91528797B006E9AC0 /* LRURLRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = A3ABE4D51528797B006E9AC0 /* LRURLRequestOperation.m */; };
48 36
 /* End PBXBuildFile section */
49 37
 
50 38
 /* Begin PBXFileReference section */
51 39
 		A3289D4B122D705500D89A88 /* libLROAuth2Client-Device.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libLROAuth2Client-Device.a"; sourceTree = BUILT_PRODUCTS_DIR; };
52 40
 		A3289EA1122D755D00D89A88 /* YAJLIOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = YAJLIOS.framework; path = Vendor/YAJLIOS.framework; sourceTree = "<group>"; };
53 41
 		A3289EC3122D758F00D89A88 /* libLROAuth2Client-Simulator.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libLROAuth2Client-Simulator.a"; sourceTree = BUILT_PRODUCTS_DIR; };
  42
+		A3ABE4D41528797B006E9AC0 /* LRURLRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LRURLRequestOperation.h; sourceTree = "<group>"; };
  43
+		A3ABE4D51528797B006E9AC0 /* LRURLRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LRURLRequestOperation.m; sourceTree = "<group>"; };
54 44
 		A3F8BFBA119DEE450035081C /* LROAuth2Client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LROAuth2Client.h; sourceTree = "<group>"; };
55 45
 		A3F8BFBB119DEE450035081C /* LROAuth2Client.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LROAuth2Client.m; sourceTree = "<group>"; };
56 46
 		A3F8BFBC119DEE450035081C /* LROAuth2ClientDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LROAuth2ClientDelegate.h; sourceTree = "<group>"; };
57 47
 		A3F8BFBD119DEE450035081C /* LROAuth2AccessToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LROAuth2AccessToken.h; sourceTree = "<group>"; };
58 48
 		A3F8BFBE119DEE450035081C /* LROAuth2AccessToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LROAuth2AccessToken.m; sourceTree = "<group>"; };
59  
-		A3F8C0CE119DEF400035081C /* ASIAuthenticationDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASIAuthenticationDialog.h; path = Classes/ASIAuthenticationDialog.h; sourceTree = "<group>"; };
60  
-		A3F8C0CF119DEF400035081C /* ASIAuthenticationDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASIAuthenticationDialog.m; path = Classes/ASIAuthenticationDialog.m; sourceTree = "<group>"; };
61  
-		A3F8C0D0119DEF400035081C /* ASIFormDataRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASIFormDataRequest.h; path = Classes/ASIFormDataRequest.h; sourceTree = "<group>"; };
62  
-		A3F8C0D1119DEF400035081C /* ASIFormDataRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASIFormDataRequest.m; path = Classes/ASIFormDataRequest.m; sourceTree = "<group>"; };
63  
-		A3F8C0D2119DEF400035081C /* ASIHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASIHTTPRequest.h; path = Classes/ASIHTTPRequest.h; sourceTree = "<group>"; };
64  
-		A3F8C0D3119DEF400035081C /* ASIHTTPRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASIHTTPRequest.m; path = Classes/ASIHTTPRequest.m; sourceTree = "<group>"; };
65  
-		A3F8C0D4119DEF400035081C /* ASIHTTPRequestDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASIHTTPRequestDelegate.h; path = Classes/ASIHTTPRequestDelegate.h; sourceTree = "<group>"; };
66  
-		A3F8C0D5119DEF400035081C /* ASIInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASIInputStream.h; path = Classes/ASIInputStream.h; sourceTree = "<group>"; };
67  
-		A3F8C0D6119DEF400035081C /* ASIInputStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASIInputStream.m; path = Classes/ASIInputStream.m; sourceTree = "<group>"; };
68  
-		A3F8C0D7119DEF400035081C /* ASINetworkQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASINetworkQueue.h; path = Classes/ASINetworkQueue.h; sourceTree = "<group>"; };
69  
-		A3F8C0D8119DEF400035081C /* ASINetworkQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASINetworkQueue.m; path = Classes/ASINetworkQueue.m; sourceTree = "<group>"; };
70  
-		A3F8C0D9119DEF400035081C /* ASINSStringAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASINSStringAdditions.h; path = Classes/ASINSStringAdditions.h; sourceTree = "<group>"; };
71  
-		A3F8C0DA119DEF400035081C /* ASINSStringAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASINSStringAdditions.m; path = Classes/ASINSStringAdditions.m; sourceTree = "<group>"; };
72  
-		A3F8C0DB119DEF400035081C /* ASIProgressDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASIProgressDelegate.h; path = Classes/ASIProgressDelegate.h; sourceTree = "<group>"; };
73  
-		A3F8C0EA119DEF480035081C /* ASIHTTPRequestConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASIHTTPRequestConfig.h; path = Vendor/ASIHTTPRequestConfig.h; sourceTree = SOURCE_ROOT; };
74  
-		A3F8C0EF119DEF770035081C /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Reachability.h; path = Vendor/ASIHTTPRequest/External/Reachability2.0/Reachability.h; sourceTree = "<group>"; };
75  
-		A3F8C0F0119DEF770035081C /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Reachability.m; path = Vendor/ASIHTTPRequest/External/Reachability2.0/Reachability.m; sourceTree = "<group>"; };
76 49
 		A3F8C124119DEFD50035081C /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
77 50
 		A3F8C126119DEFDE0035081C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
78 51
 		A3F8C12F119DF00C0035081C /* NSURL+QueryInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+QueryInspector.h"; sourceTree = "<group>"; };
@@ -125,7 +98,6 @@
125 98
 			isa = PBXGroup;
126 99
 			children = (
127 100
 				08FB77AEFE84172EC02AAC07 /* Classes */,
128  
-				A3F8BFC7119DEE830035081C /* Vendor */,
129 101
 				32C88DFF0371C24200C91783 /* Other Sources */,
130 102
 				0867D69AFE84028FC02AAC07 /* Frameworks */,
131 103
 				034768DFFF38A50411DB9C8B /* Products */,
@@ -167,6 +139,8 @@
167 139
 		A3F8BFB9119DEE390035081C /* LROAuth2 */ = {
168 140
 			isa = PBXGroup;
169 141
 			children = (
  142
+				A3ABE4D41528797B006E9AC0 /* LRURLRequestOperation.h */,
  143
+				A3ABE4D51528797B006E9AC0 /* LRURLRequestOperation.m */,
170 144
 				A3F8BFBA119DEE450035081C /* LROAuth2Client.h */,
171 145
 				A3F8BFBB119DEE450035081C /* LROAuth2Client.m */,
172 146
 				A3F8BFBC119DEE450035081C /* LROAuth2ClientDelegate.h */,
@@ -176,49 +150,6 @@
176 150
 			name = LROAuth2;
177 151
 			sourceTree = "<group>";
178 152
 		};
179  
-		A3F8BFC7119DEE830035081C /* Vendor */ = {
180  
-			isa = PBXGroup;
181  
-			children = (
182  
-				A3F8BFCA119DEF260035081C /* ASIHTTPRequest */,
183  
-				A3F8C0EA119DEF480035081C /* ASIHTTPRequestConfig.h */,
184  
-				A3F8C0EC119DEF5A0035081C /* Reachability */,
185  
-			);
186  
-			name = Vendor;
187  
-			path = Classes;
188  
-			sourceTree = "<group>";
189  
-		};
190  
-		A3F8BFCA119DEF260035081C /* ASIHTTPRequest */ = {
191  
-			isa = PBXGroup;
192  
-			children = (
193  
-				A3F8C0CE119DEF400035081C /* ASIAuthenticationDialog.h */,
194  
-				A3F8C0CF119DEF400035081C /* ASIAuthenticationDialog.m */,
195  
-				A3F8C0D0119DEF400035081C /* ASIFormDataRequest.h */,
196  
-				A3F8C0D1119DEF400035081C /* ASIFormDataRequest.m */,
197  
-				A3F8C0D2119DEF400035081C /* ASIHTTPRequest.h */,
198  
-				A3F8C0D3119DEF400035081C /* ASIHTTPRequest.m */,
199  
-				A3F8C0D4119DEF400035081C /* ASIHTTPRequestDelegate.h */,
200  
-				A3F8C0D5119DEF400035081C /* ASIInputStream.h */,
201  
-				A3F8C0D6119DEF400035081C /* ASIInputStream.m */,
202  
-				A3F8C0D7119DEF400035081C /* ASINetworkQueue.h */,
203  
-				A3F8C0D8119DEF400035081C /* ASINetworkQueue.m */,
204  
-				A3F8C0D9119DEF400035081C /* ASINSStringAdditions.h */,
205  
-				A3F8C0DA119DEF400035081C /* ASINSStringAdditions.m */,
206  
-				A3F8C0DB119DEF400035081C /* ASIProgressDelegate.h */,
207  
-			);
208  
-			name = ASIHTTPRequest;
209  
-			path = Vendor/ASIHTTPRequest;
210  
-			sourceTree = SOURCE_ROOT;
211  
-		};
212  
-		A3F8C0EC119DEF5A0035081C /* Reachability */ = {
213  
-			isa = PBXGroup;
214  
-			children = (
215  
-				A3F8C0EF119DEF770035081C /* Reachability.h */,
216  
-				A3F8C0F0119DEF770035081C /* Reachability.m */,
217  
-			);
218  
-			name = Reachability;
219  
-			path = ..;
220  
-			sourceTree = "<group>";
221  
-		};
222 153
 		A3F8C12D119DEFF80035081C /* Categories */ = {
223 154
 			isa = PBXGroup;
224 155
 			children = (
@@ -240,10 +171,10 @@
240 171
 			isa = PBXHeadersBuildPhase;
241 172
 			buildActionMask = 2147483647;
242 173
 			files = (
243  
-				A3AE5C19123403C30022C255 /* ASIHTTPRequestDelegate.h in Headers */,
244 174
 				A3289FD6122D819500D89A88 /* LROAuth2Client.h in Headers */,
245 175
 				A3289FD7122D819500D89A88 /* LROAuth2ClientDelegate.h in Headers */,
246 176
 				A3289FD8122D819500D89A88 /* LROAuth2AccessToken.h in Headers */,
  177
+				A3ABE4D61528797B006E9AC0 /* LRURLRequestOperation.h in Headers */,
247 178
 			);
248 179
 			runOnlyForDeploymentPostprocessing = 0;
249 180
 		};
@@ -251,10 +182,10 @@
251 182
 			isa = PBXHeadersBuildPhase;
252 183
 			buildActionMask = 2147483647;
253 184
 			files = (
254  
-				A3AE5C1A123403C90022C255 /* ASIHTTPRequestDelegate.h in Headers */,
255 185
 				A3289FD9122D819800D89A88 /* LROAuth2Client.h in Headers */,
256 186
 				A3289FDA122D819800D89A88 /* LROAuth2ClientDelegate.h in Headers */,
257 187
 				A3289FDB122D819800D89A88 /* LROAuth2AccessToken.h in Headers */,
  188
+				A3ABE4D71528797B006E9AC0 /* LRURLRequestOperation.h in Headers */,
258 189
 			);
259 190
 			runOnlyForDeploymentPostprocessing = 0;
260 191
 		};
@@ -331,13 +262,7 @@
331 262
 				A3289DB1122D708700D89A88 /* NSURL+QueryInspector.m in Sources */,
332 263
 				A3289DB2122D708700D89A88 /* LROAuth2Client.m in Sources */,
333 264
 				A3289DB3122D708700D89A88 /* LROAuth2AccessToken.m in Sources */,
334  
-				A3AE5CC71234107A0022C255 /* ASIAuthenticationDialog.m in Sources */,
335  
-				A3AE5CC81234107A0022C255 /* ASIFormDataRequest.m in Sources */,
336  
-				A3AE5CC91234107A0022C255 /* ASIHTTPRequest.m in Sources */,
337  
-				A3AE5CCA1234107A0022C255 /* ASIInputStream.m in Sources */,
338  
-				A3AE5CCB1234107A0022C255 /* ASINetworkQueue.m in Sources */,
339  
-				A3AE5CCC1234107A0022C255 /* ASINSStringAdditions.m in Sources */,
340  
-				A3AE5CCD1234107A0022C255 /* Reachability.m in Sources */,
  265
+				A3ABE4D81528797B006E9AC0 /* LRURLRequestOperation.m in Sources */,
341 266
 			);
342 267
 			runOnlyForDeploymentPostprocessing = 0;
343 268
 		};
@@ -350,13 +275,7 @@
350 275
 				A3289EB8122D758F00D89A88 /* NSURL+QueryInspector.m in Sources */,
351 276
 				A3289EB9122D758F00D89A88 /* LROAuth2Client.m in Sources */,
352 277
 				A3289EBA122D758F00D89A88 /* LROAuth2AccessToken.m in Sources */,
353  
-				A3AE5CCE1234107B0022C255 /* ASIAuthenticationDialog.m in Sources */,
354  
-				A3AE5CCF1234107B0022C255 /* ASIFormDataRequest.m in Sources */,
355  
-				A3AE5CD01234107B0022C255 /* ASIHTTPRequest.m in Sources */,
356  
-				A3AE5CD11234107B0022C255 /* ASIInputStream.m in Sources */,
357  
-				A3AE5CD21234107B0022C255 /* ASINetworkQueue.m in Sources */,
358  
-				A3AE5CD31234107B0022C255 /* ASINSStringAdditions.m in Sources */,
359  
-				A3AE5CD41234107B0022C255 /* Reachability.m in Sources */,
  278
+				A3ABE4D91528797B006E9AC0 /* LRURLRequestOperation.m in Sources */,
360 279
 			);
361 280
 			runOnlyForDeploymentPostprocessing = 0;
362 281
 		};
7  LROAuth2Client.xcodeproj/project.xcworkspace/contents.xcworkspacedata
... ...
@@ -0,0 +1,7 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<Workspace
  3
+   version = "1.0">
  4
+   <FileRef
  5
+      location = "self:LROAuth2Client.xcodeproj">
  6
+   </FileRef>
  7
+</Workspace>
1  LROAuth2Client_Prefix.pch
@@ -10,5 +10,4 @@
10 10
     #import <Foundation/Foundation.h>
11 11
     #import <UIKit/UIKit.h>
12 12
     #import "Availability.h"
13  
-    #import "ASIHTTPRequestConfig.h"
14 13
 #endif
55  Vendor/ASIHTTPRequestConfig.h
... ...
@@ -1,55 +0,0 @@
1  
-//
2  
-//  ASIHTTPRequestConfig.h
3  
-//  Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest
4  
-//
5  
-//  Created by Ben Copsey on 14/12/2009.
6  
-//  Copyright 2009 All-Seeing Interactive. All rights reserved.
7  
-//
8  
-
9  
-
10  
-// ======
11  
-// Debug output configuration options
12  
-// ======
13  
-
14  
-// When set to 1 ASIHTTPRequests will print information about what a request is doing
15  
-#ifndef DEBUG_REQUEST_STATUS
16  
-	#define DEBUG_REQUEST_STATUS 0
17  
-#endif
18  
-
19  
-// When set to 1, ASIFormDataRequests will print information about the request body to the console
20  
-#ifndef DEBUG_FORM_DATA_REQUEST
21  
-	#define DEBUG_FORM_DATA_REQUEST 0
22  
-#endif
23  
-
24  
-// When set to 1, ASIHTTPRequests will print information about bandwidth throttling to the console
25  
-#ifndef DEBUG_THROTTLING
26  
-	#define DEBUG_THROTTLING 0
27  
-#endif
28  
-
29  
-// When set to 1, ASIHTTPRequests will print information about persistent connections to the console
30  
-#ifndef DEBUG_PERSISTENT_CONNECTIONS
31  
-	#define DEBUG_PERSISTENT_CONNECTIONS 0
32  
-#endif
33  
-
34  
-// ======
35  
-// Reachability API (iPhone only)
36  
-// ======
37  
-
38  
-/*
39  
-ASIHTTPRequest uses Apple's Reachability class (http://developer.apple.com/iphone/library/samplecode/Reachability/) to turn bandwidth throttling on and off automatically when shouldThrottleBandwidthForWWAN is set to YES  on iPhone OS
40  
-
41  
-There are two versions of Apple's Reachability class, both of which are included in the source distribution of ASIHTTPRequest in the External/Reachability folder.
42  
-
43  
- *    Version 2.0 is the latest version. You should use this if you are targeting iPhone OS 3.x and later
44  
-      To use Version 2.0, set this to 1, and include Reachability.h + Reachability.m from the Reachability 2.0 folder in your project
45  
- 
46  
- *    Version 1.5 is the old version, but it is compatible with both iPhone OS 2.2.1 and iPhone OS 3.0 and later. You should use this if your application needs to work on iPhone OS 2.2.1.
47  
-      To use Version 1.5, set this to 0, and include Reachability.h + Reachability.m from the Reachability 1.5 folder in your project
48  
-
49  
-This config option is not used for apps targeting Mac OS X 
50  
-*/
51  
-
52  
-#ifndef REACHABILITY_20_API
53  
-	#define REACHABILITY_20_API 1
54  
-#endif
55  
-

0 notes on commit 8ab2263

Please sign in to comment.
Something went wrong with that request. Please try again.