Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
James Thrasher
2010-03-08 14:38:35 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
62628e894a85f3e4e536b0851c21548f37879a22
62628e89
1 parent
764d90df
Make persistent connection timeout configurable and default to 60s
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
Classes/ASIHTTPRequest.h
Classes/ASIHTTPRequest.m
Classes/ASIHTTPRequest.h
View file @
62628e8
...
...
@@ -342,6 +342,10 @@ extern unsigned long const ASIWWANBandwidthThrottleAmount;
// Persistent connections only work when the server sends a 'Keep-Alive' header
// Default is YES
BOOL
shouldAttemptPersistentConnection
;
// Number of seconds to keep an inactive persistent connection open on the client side
// Default is 60
NSTimeInterval
persistentConnectionTimeout
;
// Set to yes when an appropriate keep-alive header is found
BOOL
connectionCanBeReused
;
...
...
@@ -716,6 +720,7 @@ extern unsigned long const ASIWWANBandwidthThrottleAmount;
@property
(
assign
)
int
numberOfTimesToRetryOnTimeout
;
@property
(
assign
,
readonly
)
int
retryCount
;
@property
(
assign
)
BOOL
shouldAttemptPersistentConnection
;
@property
(
assign
)
NSTimeInterval
persistentConnectionTimeout
;
@property
(
assign
)
BOOL
shouldUseRFC2616RedirectBehaviour
;
@property
(
assign
,
readonly
)
BOOL
connectionCanBeReused
;
@end
...
...
Classes/ASIHTTPRequest.m
View file @
62628e8
...
...
@@ -223,6 +223,7 @@ static BOOL isiPhoneOS2;
[
self
setRequestMethod
:
@"GET"
];
[
self
setShouldAttemptPersistentConnection
:
YES
];
[
self
setPersistentConnectionTimeout
:
60
.
0
];
[
self
setShouldPresentCredentialsBeforeChallenge
:
YES
];
[
self
setShouldRedirect
:
YES
];
[
self
setShowAccurateProgress
:
YES
];
...
...
@@ -1805,7 +1806,10 @@ static BOOL isiPhoneOS2;
// Otherwise, we'll assume we can keep this connection open
}
else
{
[
self
setConnectionCanBeReused
:
YES
];
closeStreamTime
=
60
;
closeStreamTime
=
[
self
persistentConnectionTimeout
];
#if DEBUG_PERSISTENT_CONNECTIONS
NSLog
(
@"Set connection to close after %f seconds"
,
closeStreamTime
);
#endif
}
}
}
...
...
@@ -3748,6 +3752,7 @@ static BOOL isiPhoneOS2;
@synthesize
numberOfTimesToRetryOnTimeout
;
@synthesize
retryCount
;
@synthesize
shouldAttemptPersistentConnection
;
@synthesize
persistentConnectionTimeout
;
@synthesize
connectionCanBeReused
;
@synthesize
connectionInfo
;
@synthesize
readStream
;
...
...
Please
register
or
login
to post a comment