• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes (From: Frederick Cheung <email@hidden>)

  • Prev by Date: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
  • Next by Date: Re: how to enumerate TCP and UDP listeners
  • Previous by thread: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
  • Next by thread: crash in CFReadStreamOpen when called from secondary thread
  • Index(es):
    • Date
    • Thread