PAC files can now be downloaded asynchronously, and the download now respects the request's timeout
This should help in situations where the PAC File is unavailable or the connection is very slow
Showing
2 changed files
with
16 additions
and
6 deletions
@@ -478,7 +478,22 @@ typedef void (^ASIDataBlock)(NSData *data); | @@ -478,7 +478,22 @@ typedef void (^ASIDataBlock)(NSData *data); | ||
478 | // | 478 | // |
479 | // Setting this to NO may be especially useful for users using ASIHTTPRequest in conjunction with a streaming parser, as it will allow partial gzipped responses to be inflated and passed on to the parser while the request is still running | 479 | // Setting this to NO may be especially useful for users using ASIHTTPRequest in conjunction with a streaming parser, as it will allow partial gzipped responses to be inflated and passed on to the parser while the request is still running |
480 | BOOL shouldWaitToInflateCompressedResponses; | 480 | BOOL shouldWaitToInflateCompressedResponses; |
481 | - | 481 | + |
482 | + // Will be YES if this is a request created behind the scenes to download a PAC file - these requests do not attempt to configure their own proxies | ||
483 | + BOOL isPACFileRequest; | ||
484 | + | ||
485 | + // Used for downloading PAC files from http / https webservers | ||
486 | + ASIHTTPRequest *PACFileRequest; | ||
487 | + | ||
488 | + // Used for asynchronously reading PAC files from file:// URLs | ||
489 | + NSInputStream *PACFileReadStream; | ||
490 | + | ||
491 | + // Used for storing PAC data from file URLs as it is downloaded | ||
492 | + NSMutableData *PACFileData; | ||
493 | + | ||
494 | + // Set to YES in startSynchronous. Currently used by proxy detection to download PAC files synchronously when appropriate | ||
495 | + BOOL isSynchronous; | ||
496 | + | ||
482 | #if NS_BLOCKS_AVAILABLE | 497 | #if NS_BLOCKS_AVAILABLE |
483 | //block to execute when request starts | 498 | //block to execute when request starts |
484 | ASIBasicBlock startedBlock; | 499 | ASIBasicBlock startedBlock; |
@@ -780,11 +795,6 @@ typedef void (^ASIDataBlock)(NSData *data); | @@ -780,11 +795,6 @@ typedef void (^ASIDataBlock)(NSData *data); | ||
780 | // Is only used when you have specified a Bundle Display Name (CFDisplayBundleName) or Bundle Name (CFBundleName) in your plist | 795 | // Is only used when you have specified a Bundle Display Name (CFDisplayBundleName) or Bundle Name (CFBundleName) in your plist |
781 | + (NSString *)defaultUserAgentString; | 796 | + (NSString *)defaultUserAgentString; |
782 | 797 | ||
783 | -#pragma mark proxy autoconfiguration | ||
784 | - | ||
785 | -// Returns an array of proxies to use for a particular url, given the url of a PAC script | ||
786 | -+ (NSArray *)proxiesForURL:(NSURL *)theURL fromPAC:(NSURL *)pacScriptURL; | ||
787 | - | ||
788 | #pragma mark mime-type detection | 798 | #pragma mark mime-type detection |
789 | 799 | ||
790 | // Return the mime type for a file | 800 | // Return the mime type for a file |
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment