Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes



I've got a situation where I'm using CFHTTPMessage, but i'm sending the request and receiving the response myself (mainly because I am streaming the data in a way that doesn't let me use CFNetwork directly). I build up the response using CFHTTPMessageCreateEmpty & CFHTTPMessageAppendBytes

However passing this response to CFHTTPAuthenticationCreateFromResponse or using it as the second parameter to CFHTTPMessageAddAuthentication causes a crash inside CFHTTPMessageCopyRequestURL, because the url for my CFHTTPMessageRef is NULL (and that's fair enough, there's no way CFHTTP could have guessed it)
It's rather naughty that CFHTTPMessageCopyRequestURL crashes rather than just returning NULL (and in the more general case it would be a real pain if you had to track which CFHTTPMessages it was safe to call CFHTTPMessageCopyRequestURL), looking at the source it doesn't check that the CFHTTPMessage's is not null before calling CFRetain on it.


As far as I can tell, the only way that I can use CFHTTPAuthenticationCreateFromResponse is to be exceedingly naughty and call _CFHTTPMessageSetResponseURL so that subsequent calls to CFHTTPMessageCopyRequestURL don't crash. Any other ideas ?

Sadly, no - your analysis is correct. Please file a bug. Thanks - REW _______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macnetworkprog/email@hidden

This email sent to email@hidden
References: 
 >Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes (From: Frederick Cheung <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.