diff --git a/AFNetworking/AFHTTPRequestOperation.h b/AFNetworking/AFHTTPRequestOperation.h index 55c7a26..4e08bec 100644 --- a/AFNetworking/AFHTTPRequestOperation.h +++ b/AFNetworking/AFHTTPRequestOperation.h @@ -30,25 +30,26 @@ extern NSString * const AFHTTPOperationDidFinishNotification; @interface AFHTTPRequestOperation : NSOperation { @private - NSURLConnection *_connection; NSSet *_runLoopModes; + NSURLConnection *_connection; NSURLRequest *_request; NSHTTPURLResponse *_response; + NSError *_error; NSData *_responseBody; + NSUInteger _totalBytesRead; NSMutableData *_dataAccumulator; NSOutputStream *_outputStream; } -@property (nonatomic, retain) NSURLConnection *connection; @property (nonatomic, retain) NSSet *runLoopModes; -@property (nonatomic, retain) NSURLRequest *request; -@property (nonatomic, retain) NSHTTPURLResponse *response; -@property (nonatomic, retain) NSError *error; +@property (readonly, nonatomic, retain) NSURLRequest *request; +@property (readonly, nonatomic, retain) NSHTTPURLResponse *response; +@property (readonly, nonatomic, retain) NSError *error; -@property (nonatomic, retain) NSData *responseBody; +@property (readonly, nonatomic, retain) NSData *responseBody; @property (readonly) NSString *responseString; + (id)operationWithRequest:(NSURLRequest *)urlRequest diff --git a/AFNetworking/AFHTTPRequestOperation.m b/AFNetworking/AFHTTPRequestOperation.m index 6ee3686..f81acda 100644 --- a/AFNetworking/AFHTTPRequestOperation.m +++ b/AFNetworking/AFHTTPRequestOperation.m @@ -78,8 +78,13 @@ static inline BOOL AFHTTPOperationStateTransitionIsValid(AFHTTPOperationState fr } @interface AFHTTPRequestOperation () -@property (nonatomic, assign) AFHTTPOperationState state; -@property (nonatomic, assign, getter = isCancelled) BOOL cancelled; +@property (readwrite, nonatomic, assign) AFHTTPOperationState state; +@property (readwrite, nonatomic, assign, getter = isCancelled) BOOL cancelled; +@property (readwrite, nonatomic, retain) NSURLConnection *connection; +@property (readwrite, nonatomic, retain) NSURLRequest *request; +@property (readwrite, nonatomic, retain) NSHTTPURLResponse *response; +@property (readwrite, nonatomic, retain) NSError *error; +@property (readwrite, nonatomic, retain) NSData *responseBody; @property (readwrite, nonatomic, assign) NSUInteger totalBytesRead; @property (readwrite, nonatomic, retain) NSMutableData *dataAccumulator; @property (readwrite, nonatomic, retain) NSOutputStream *outputStream; @@ -200,7 +205,6 @@ static NSThread *_networkRequestThread = nil; self.downloadProgress = block; } - - (void)setState:(AFHTTPOperationState)state { if (self.state == state) { return;