Re: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
Re: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
- Subject: Re: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
- From: Becky Willrich <email@hidden>
- Date: Fri, 20 Oct 2006 13:02:33 -0700
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:
This email sent to email@hidden