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
Ben Copsey
2010-03-23 10:40:25 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ca7178eb2a5e2142f4581fb2fd62fc188d9bb06e
ca7178eb
1 parent
1e87370a
Auto-retry on 'broken pipe' error
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
Classes/ASIHTTPRequest.m
Classes/ASIHTTPRequest.m
View file @
ca7178e
...
...
@@ -23,7 +23,7 @@
// Automatically set on build
NSString
*
ASIHTTPRequestVersion
=
@"v1.6-1
8
2010-03-22"
;
NSString
*
ASIHTTPRequestVersion
=
@"v1.6-1
9
2010-03-22"
;
NSString
*
const
NetworkRequestErrorDomain
=
@"ASIHTTPRequestErrorDomain"
;
...
...
@@ -2689,12 +2689,13 @@ static BOOL isiPhoneOS2;
if
(
!
[
self
error
])
{
// We may already have handled this error
// First, check for a 'socket not connected' or 'connection lost' error
// First, check for a 'socket not connected'
, 'broken pipe'
or 'connection lost' error
// This may occur when we've attempted to reuse a connection that should have been closed
// If we get this, we need to retry the request
// We'll only do this once - if it happens again on retry, we'll give up
// -1005 = kCFURLErrorNetworkConnectionLost - this doesn't seem to be declared on Mac OS 10.5
if
(([[
underlyingError
domain
]
isEqualToString
:
NSPOSIXErrorDomain
]
&&
[
underlyingError
code
]
==
ENOTCONN
)
||
([[
underlyingError
domain
]
isEqualToString
:(
NSString
*
)
kCFErrorDomainCFNetwork
]
&&
[
underlyingError
code
]
==
-
1005
))
{
if
(([[
underlyingError
domain
]
isEqualToString
:
NSPOSIXErrorDomain
]
&&
([
underlyingError
code
]
==
ENOTCONN
||
[
underlyingError
code
]
==
EPIPE
))
||
([[
underlyingError
domain
]
isEqualToString
:(
NSString
*
)
kCFErrorDomainCFNetwork
]
&&
[
underlyingError
code
]
==
-
1005
))
{
if
([
self
retryUsingNewConnection
])
{
return
;
}
...
...
Please
register
or
login
to post a comment