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
2011-08-06 04:25:19 -0700
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
011cb6da88622e95f8ea5991a3ba859c36177d3a
011cb6da
2 parents
b1e50ccf
43b9d125
Merge pull request #225 from dominic/master
Make CF allocated objects collectable
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
Classes/ASIHTTPRequest.m
Classes/ASIHTTPRequest.m
View file @
011cb6d
...
...
@@ -1169,7 +1169,7 @@ static NSOperationQueue *sharedQueue = nil;
}
else
{
[
self
setPostBodyReadStream
:[
ASIInputStream
inputStreamWithFileAtPath
:[
self
postBodyFilePath
]
request
:
self
]];
}
[
self
setReadStream
:[(
NSInputStream
*
)
CF
ReadStreamCreateForStreamedHTTPRequest
(
kCFAllocatorDefault
,
request
,(
CFReadStreamRef
)[
self
postBodyReadStream
])
autorelease
]];
[
self
setReadStream
:[(
NSInputStream
*
)
CF
MakeCollectable
(
CFReadStreamCreateForStreamedHTTPRequest
(
kCFAllocatorDefault
,
request
,(
CFReadStreamRef
)[
self
postBodyReadStream
]))
autorelease
]];
}
else
{
// If we have a request body, we'll stream it from memory using our custom stream, so that we can measure bandwidth use and it can be bandwidth-throttled if necessary
...
...
@@ -1179,10 +1179,10 @@ static NSOperationQueue *sharedQueue = nil;
}
else
if
([
self
postBody
])
{
[
self
setPostBodyReadStream
:[
ASIInputStream
inputStreamWithData
:[
self
postBody
]
request
:
self
]];
}
[
self
setReadStream
:[(
NSInputStream
*
)
CF
ReadStreamCreateForStreamedHTTPRequest
(
kCFAllocatorDefault
,
request
,(
CFReadStreamRef
)[
self
postBodyReadStream
]
)
autorelease
]];
[
self
setReadStream
:[(
NSInputStream
*
)
CF
MakeCollectable
(
CFReadStreamCreateForStreamedHTTPRequest
(
kCFAllocatorDefault
,
request
,(
CFReadStreamRef
)[
self
postBodyReadStream
])
)
autorelease
]];
}
else
{
[
self
setReadStream
:[(
NSInputStream
*
)
CF
ReadStreamCreateForHTTPRequest
(
kCFAllocatorDefault
,
request
)
autorelease
]];
[
self
setReadStream
:[(
NSInputStream
*
)
CF
MakeCollectable
(
CFReadStreamCreateForHTTPRequest
(
kCFAllocatorDefault
,
request
)
)
autorelease
]];
}
}
...
...
@@ -2132,9 +2132,9 @@ static NSOperationQueue *sharedQueue = nil;
}
#endif
[
self
setResponseHeaders
:[(
NSDictionary
*
)
CF
HTTPMessageCopyAllHeaderFields
(
message
)
autorelease
]];
[
self
setResponseHeaders
:[(
NSDictionary
*
)
CF
MakeCollectable
(
CFHTTPMessageCopyAllHeaderFields
(
message
)
)
autorelease
]];
[
self
setResponseStatusCode
:(
int
)
CFHTTPMessageGetResponseStatusCode
(
message
)];
[
self
setResponseStatusMessage
:[(
NSString
*
)
CF
HTTPMessageCopyResponseStatusLine
(
message
)
autorelease
]];
[
self
setResponseStatusMessage
:[(
NSString
*
)
CF
MakeCollectable
(
CFHTTPMessageCopyResponseStatusLine
(
message
)
)
autorelease
]];
if
([
self
downloadCache
]
&&
([[
self
downloadCache
]
canUseCachedDataForRequest
:
self
]))
{
...
...
@@ -2749,7 +2749,7 @@ static NSOperationQueue *sharedQueue = nil;
CFHTTPMessageRef
responseHeader
=
(
CFHTTPMessageRef
)
CFReadStreamCopyProperty
((
CFReadStreamRef
)[
self
readStream
],
kCFStreamPropertyHTTPResponseHeader
);
proxyAuthentication
=
CFHTTPAuthenticationCreateFromResponse
(
NULL
,
responseHeader
);
CFRelease
(
responseHeader
);
[
self
setProxyAuthenticationScheme
:[(
NSString
*
)
CF
HTTPAuthenticationCopyMethod
(
proxyAuthentication
)
autorelease
]];
[
self
setProxyAuthenticationScheme
:[(
NSString
*
)
CF
MakeCollectable
(
CFHTTPAuthenticationCopyMethod
(
proxyAuthentication
)
)
autorelease
]];
}
// If we haven't got a CFHTTPAuthenticationRef by now, something is badly wrong, so we'll have to give up
...
...
@@ -2762,7 +2762,7 @@ static NSOperationQueue *sharedQueue = nil;
// Get the authentication realm
[
self
setProxyAuthenticationRealm
:
nil
];
if
(
!
CFHTTPAuthenticationRequiresAccountDomain
(
proxyAuthentication
))
{
[
self
setProxyAuthenticationRealm
:[(
NSString
*
)
CF
HTTPAuthenticationCopyRealm
(
proxyAuthentication
)
autorelease
]];
[
self
setProxyAuthenticationRealm
:[(
NSString
*
)
CF
MakeCollectable
(
CFHTTPAuthenticationCopyRealm
(
proxyAuthentication
)
)
autorelease
]];
}
// See if authentication is valid
...
...
@@ -2926,7 +2926,7 @@ static NSOperationQueue *sharedQueue = nil;
CFHTTPMessageRef
responseHeader
=
(
CFHTTPMessageRef
)
CFReadStreamCopyProperty
((
CFReadStreamRef
)[
self
readStream
],
kCFStreamPropertyHTTPResponseHeader
);
requestAuthentication
=
CFHTTPAuthenticationCreateFromResponse
(
NULL
,
responseHeader
);
CFRelease
(
responseHeader
);
[
self
setAuthenticationScheme
:[(
NSString
*
)
CF
HTTPAuthenticationCopyMethod
(
requestAuthentication
)
autorelease
]];
[
self
setAuthenticationScheme
:[(
NSString
*
)
CF
MakeCollectable
(
CFHTTPAuthenticationCopyMethod
(
requestAuthentication
)
)
autorelease
]];
}
if
(
!
requestAuthentication
)
{
...
...
@@ -2942,7 +2942,7 @@ static NSOperationQueue *sharedQueue = nil;
// Get the authentication realm
[
self
setAuthenticationRealm
:
nil
];
if
(
!
CFHTTPAuthenticationRequiresAccountDomain
(
requestAuthentication
))
{
[
self
setAuthenticationRealm
:[(
NSString
*
)
CF
HTTPAuthenticationCopyRealm
(
requestAuthentication
)
autorelease
]];
[
self
setAuthenticationRealm
:[(
NSString
*
)
CF
MakeCollectable
(
CFHTTPAuthenticationCopyRealm
(
requestAuthentication
)
)
autorelease
]];
}
#if DEBUG_HTTP_AUTHENTICATION
...
...
Please
register
or
login
to post a comment