• 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: CFNetwork?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFNetwork?


  • Subject: Re: CFNetwork?
  • From: Béla Kiss <email@hidden>
  • Date: Thu, 27 Dec 2001 23:46:46 -0800

You're right. Constructing the CFHTTPMessageRef your way seems to make
CFHTTPMessageIsHeaderComplete() happy. However (and there is always a
however), if one uses that constructed CFHTTPMessageRef for calling

readStream = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, request);
openReadStreamSucceeded = CFReadStreamOpen(readStream);

causes CFReadStreamOpen() to crash inside _CFStreamGetCallbackPtr.

If one constructs the CFHTTPMessageRef the long way, this crash doesn't
happen (but nothing much seems to happen - maybe because
CFHTTPMessageIsHeaderComplete() isn't happy).

Grrr...

bk

on 2001.12.27 13.31, Dustin Mierau at email@hidden wrote:

> Well alrighty then. Yea I just looked at the rfc, you're right...
>
> So this works:
>
> CFHTTPMessageRef request;
> NSString* requestString;
>
> request = CFHTTPMessageCreateEmpty( kCFAllocatorDefault, TRUE );
> requestString = [NSString stringWithString:@"GET / HTTP/1.1\nHost:
> www.apple.com\nUser-Agent: Mozilla/4.0\n\n"];
>
> CFHTTPMessageAppendBytes( request, [requestString cString],
> [requestString cStringLength] );
>
> if( CFHTTPMessageIsHeaderComplete( request ) )
> NSLog( @"Header is complete" );
> else
> NSLog( @"Header is NOT complete" );
>
> CFRelease( request );
>
> Output is:
>
> "Header is complete"
>
> I tried it the other way, and sure enough, I get "Header is NOT
> complete"..odd.

--
Bila Kiss telno. 604.264.6113
Arborealis Research email. email@hidden
3322 W 36th Avenue
Vancouver, BC, CANADA V6N 2R9


  • Follow-Ups:
    • Re: CFNetwork?
      • From: Dustin Mierau <email@hidden>
References: 
 >Re: CFNetwork? (From: Dustin Mierau <email@hidden>)

  • Prev by Date: Re: MySQL and Cocoa
  • Next by Date: setIgnoresAlpha (Newbye)
  • Previous by thread: Re: CFNetwork?
  • Next by thread: Re: CFNetwork?
  • Index(es):
    • Date
    • Thread