Skip to content

Commit

Permalink
Fix problem with copying requests without a clientCertificateIdentity
Browse files Browse the repository at this point in the history
Make clientCertificates work with NSCopying, headRequest, and release it in dealloc
  • Loading branch information
pokeb committed Aug 18, 2010
1 parent 68820ae commit 6251bf1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Classes/ASIHTTPRequest.m
Expand Up @@ -23,7 +23,7 @@


// Automatically set on build
NSString *ASIHTTPRequestVersion = @"v1.7-50 2010-08-18";
NSString *ASIHTTPRequestVersion = @"v1.7-51 2010-08-18";

NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain";

Expand Down Expand Up @@ -359,6 +359,7 @@ - (void)dealloc
[postBodyWriteStream release];
[postBodyReadStream release];
[PACurl release];
[clientCertificates release];
[responseStatusMessage release];
[connectionInfo release];
[requestID release];
Expand Down Expand Up @@ -1409,6 +1410,7 @@ - (ASIHTTPRequest *)HEADRequest
[headRequest setUseHTTPVersionOne:[self useHTTPVersionOne]];
[headRequest setValidatesSecureCertificate:[self validatesSecureCertificate]];
[headRequest setClientCertificateIdentity:clientCertificateIdentity];
[headRequest setClientCertificates:[[clientCertificates copy] autorelease]];
[headRequest setPACurl:[self PACurl]];
[headRequest setShouldPresentCredentialsBeforeChallenge:[self shouldPresentCredentialsBeforeChallenge]];
[headRequest setNumberOfTimesToRetryOnTimeout:[self numberOfTimesToRetryOnTimeout]];
Expand Down Expand Up @@ -3161,6 +3163,7 @@ - (id)copyWithZone:(NSZone *)zone
[newRequest setShouldRedirect:[self shouldRedirect]];
[newRequest setValidatesSecureCertificate:[self validatesSecureCertificate]];
[newRequest setClientCertificateIdentity:clientCertificateIdentity];
[newRequest setClientCertificates:[[clientCertificates copy] autorelease]];
[newRequest setPACurl:[self PACurl]];
[newRequest setShouldPresentCredentialsBeforeChallenge:[self shouldPresentCredentialsBeforeChallenge]];
[newRequest setNumberOfTimesToRetryOnTimeout:[self numberOfTimesToRetryOnTimeout]];
Expand Down Expand Up @@ -3192,7 +3195,9 @@ - (void)setClientCertificateIdentity:(SecIdentityRef)anIdentity {

clientCertificateIdentity = anIdentity;

CFRetain(clientCertificateIdentity);
if (clientCertificateIdentity) {
CFRetain(clientCertificateIdentity);
}
}


Expand Down

0 comments on commit 6251bf1

Please sign in to comment.