Re: how to use _CFHTTPMessageSetResponseURL
Re: how to use _CFHTTPMessageSetResponseURL
- Subject: Re: how to use _CFHTTPMessageSetResponseURL
- From: Frederick Cheung <email@hidden>
- Date: Sat, 17 Feb 2007 10:10:04 +0000
On 17 Feb 2007, at 01:44, d2kagw wrote:
Hi All...
I've been working with this bug for a while now, and finally came
across a previous post which discussed the flaw: http://
lists.apple.com/archives/macnetworkprog/2006/Oct/msg00028.html
You'll have to excuse me though, this is by far the most complex
thing i've ever done in cocoa and am a little stumped on how to
actually call _CFHTTPMessageSetResponseURL without having to call
CFHTTPMessageCopyRequestURL first?
The exception isn't being caught because none is being thrown. The
code you call through to is just regular C code which then deferences
a null pointer.
If you don't know where the CFHTTPMessageRef has come from, you
cannot know whether or not it is safe to use
CFHTTPMessageCopyRequestURL. It was ok for me - I was constructing
all of mine by hand, so I knew that I had to use
_CFHTTPMessageSetResponseURL (by the way, a CFURLRef is not a string:
it's the CF equivalent of NSURL)
Fred
this is the code im playing with:
@try {
CFURLRef url = CFHTTPMessageCopyRequestURL(message);
}
@catch (NSException * e) {
CFURLRef tUrl = @"http://zanoo.isnot.tv/";
_CFHTTPMessageSetResponseURL( message, tUrl );
CFRelease(tUrl);
CFURLRef url = CFHTTPMessageCopyRequestURL(message);
}
@finally {}
when I run the code it still crashes on line #2... I would have
expected it to catch the error and set the response URL....
Sorry for the n00b question..
- Az
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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