• 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
Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes


  • Subject: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
  • From: Frederick Cheung <email@hidden>
  • Date: Fri, 20 Oct 2006 20:34:22 +0100

Hi,

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 ?

Fred
_______________________________________________
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


  • Follow-Ups:
    • Re: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
      • From: Becky Willrich <email@hidden>
  • Prev by Date: Re: how to enumerate TCP and UDP listeners
  • Next by Date: Re: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
  • Previous by thread: Re: how to enumerate TCP and UDP listeners
  • Next by thread: Re: Using cfhttp authentication functions when the response was constructed with CFHTTPMessageAppendBytes
  • Index(es):
    • Date
    • Thread