Ben Copsey

Cleanup:

* Move certain properties that the user really shouldn't access to private
* Rename outputStream to fileDownloadOutputStream
* Use getters in more places
@@ -37,7 +37,7 @@ typedef enum _ASINetworkErrorType { @@ -37,7 +37,7 @@ typedef enum _ASINetworkErrorType {
37 // The delegate, you need to manage setting and talking to your delegate in your subclasses 37 // The delegate, you need to manage setting and talking to your delegate in your subclasses
38 id delegate; 38 id delegate;
39 39
40 - // A queue delegate that should *ALSO* be notified of delegate message 40 + // A queue delegate that should *ALSO* be notified of delegate message (used by ASINetworkQueue)
41 id queue; 41 id queue;
42 42
43 // HTTP method to use (GET / POST / PUT / DELETE). Defaults to GET 43 // HTTP method to use (GET / POST / PUT / DELETE). Defaults to GET
@@ -95,7 +95,7 @@ typedef enum _ASINetworkErrorType { @@ -95,7 +95,7 @@ typedef enum _ASINetworkErrorType {
95 NSString *temporaryFileDownloadPath; 95 NSString *temporaryFileDownloadPath;
96 96
97 // Used for writing data to a file when downloadDestinationPath is set 97 // Used for writing data to a file when downloadDestinationPath is set
98 - NSOutputStream *outputStream; 98 + NSOutputStream *fileDownloadOutputStream;
99 99
100 // When the request fails or completes successfully, complete will be true 100 // When the request fails or completes successfully, complete will be true
101 BOOL complete; 101 BOOL complete;
@@ -104,9 +104,6 @@ typedef enum _ASINetworkErrorType { @@ -104,9 +104,6 @@ typedef enum _ASINetworkErrorType {
104 // If error code is = ASIConnectionFailureErrorType (1, Connection failure occurred) - inspect [[error userInfo] objectForKey:NSUnderlyingErrorKey] for more information 104 // If error code is = ASIConnectionFailureErrorType (1, Connection failure occurred) - inspect [[error userInfo] objectForKey:NSUnderlyingErrorKey] for more information
105 NSError *error; 105 NSError *error;
106 106
107 - // If an authentication error occurs, we give the delegate a chance to handle it, ignoreError will be set to true  
108 - BOOL ignoreError;  
109 -  
110 // Username and password used for authentication 107 // Username and password used for authentication
111 NSString *username; 108 NSString *username;
112 NSString *password; 109 NSString *password;
@@ -366,37 +363,33 @@ typedef enum _ASINetworkErrorType { @@ -366,37 +363,33 @@ typedef enum _ASINetworkErrorType {
366 @property (retain,readonly) NSString *authenticationRealm; 363 @property (retain,readonly) NSString *authenticationRealm;
367 @property (retain) NSError *error; 364 @property (retain) NSError *error;
368 @property (assign,readonly) BOOL complete; 365 @property (assign,readonly) BOOL complete;
369 -@property (retain) NSDictionary *responseHeaders; 366 +@property (retain,readonly) NSDictionary *responseHeaders;
370 @property (retain) NSMutableDictionary *requestHeaders; 367 @property (retain) NSMutableDictionary *requestHeaders;
371 @property (retain) NSMutableArray *requestCookies; 368 @property (retain) NSMutableArray *requestCookies;
372 -@property (retain) NSArray *responseCookies; 369 +@property (retain,readonly) NSArray *responseCookies;
373 @property (assign) BOOL useCookiePersistance; 370 @property (assign) BOOL useCookiePersistance;
374 @property (retain) NSDictionary *requestCredentials; 371 @property (retain) NSDictionary *requestCredentials;
375 -@property (assign) int responseStatusCode; 372 +@property (assign,readonly) int responseStatusCode;
376 -@property (retain) NSMutableData *rawResponseData; 373 +@property (retain,readonly) NSMutableData *rawResponseData;
377 -@property (retain) NSDate *lastActivityTime;  
378 @property (assign) NSTimeInterval timeOutSeconds; 374 @property (assign) NSTimeInterval timeOutSeconds;
379 @property (retain) NSString *requestMethod; 375 @property (retain) NSString *requestMethod;
380 @property (retain) NSMutableData *postBody; 376 @property (retain) NSMutableData *postBody;
381 -@property (assign) unsigned long long contentLength; 377 +@property (assign,readonly) unsigned long long contentLength;
382 -@property (assign) unsigned long long partialDownloadSize;  
383 @property (assign) unsigned long long postLength; 378 @property (assign) unsigned long long postLength;
384 @property (assign) BOOL shouldResetProgressIndicators; 379 @property (assign) BOOL shouldResetProgressIndicators;
385 @property (retain) ASIHTTPRequest *mainRequest; 380 @property (retain) ASIHTTPRequest *mainRequest;
386 @property (assign) BOOL showAccurateProgress; 381 @property (assign) BOOL showAccurateProgress;
387 @property (assign,readonly) unsigned long long totalBytesRead; 382 @property (assign,readonly) unsigned long long totalBytesRead;
388 @property (assign,readonly) unsigned long long totalBytesSent; 383 @property (assign,readonly) unsigned long long totalBytesSent;
389 -@property (assign) unsigned long long uploadBufferSize;  
390 @property (assign) NSStringEncoding defaultResponseEncoding; 384 @property (assign) NSStringEncoding defaultResponseEncoding;
391 -@property (assign) NSStringEncoding responseEncoding; 385 +@property (assign,readonly) NSStringEncoding responseEncoding;
392 @property (assign) BOOL allowCompressedResponse; 386 @property (assign) BOOL allowCompressedResponse;
393 @property (assign) BOOL allowResumeForFileDownloads; 387 @property (assign) BOOL allowResumeForFileDownloads;
394 @property (retain) NSDictionary *userInfo; 388 @property (retain) NSDictionary *userInfo;
395 @property (retain) NSString *postBodyFilePath; 389 @property (retain) NSString *postBodyFilePath;
396 -@property (retain) NSOutputStream *postBodyWriteStream;  
397 -@property (retain) NSInputStream *postBodyReadStream;  
398 @property (assign) BOOL shouldStreamPostDataFromDisk; 390 @property (assign) BOOL shouldStreamPostDataFromDisk;
399 @property (assign) BOOL didCreateTemporaryPostDataFile; 391 @property (assign) BOOL didCreateTemporaryPostDataFile;
400 @property (assign) BOOL useHTTPVersionOne; 392 @property (assign) BOOL useHTTPVersionOne;
  393 +@property (assign, readonly) unsigned long long partialDownloadSize;
401 394
402 @end 395 @end
This diff is collapsed. Click to expand it.