• 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 CFHTTPMessage to parse response header but not body?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using CFHTTPMessage to parse response header but not body?


  • Subject: Re: Using CFHTTPMessage to parse response header but not body?
  • From: Mark Pauley <email@hidden>
  • Date: Mon, 14 May 2012 17:40:51 -0700

I'm not sure whether the chunked encoding is handled at the Message layer or the Stream layer, but I have a suspicion that the stream handles this, and the message itself doesn't do any chunk parsing for you.  Have you tried it?


On May 14, 2012, at 1:35 PM, Jens Alfke wrote:


On May 14, 2012, at 12:50 PM, Jeff Johnson wrote:

Won't CFHTTPMessageCopyBody() give you the partial message body, after CFHTTPMessageIsHeaderComplete() returns true? I'm looking at some HTTP parsing code I wrote a while ago, and it seems to indicate that it should. I'd have to run it through the debugger to confirm, but I'm pretty sure it will.

So you’re saying to call that and parse what’s in it as body, then continue parsing data from the stream myself as the rest of the body?

I don’t think this is going to work correctly if the body is encoded, as it is in my case. What’s going to come out of CopyBody is, presumably, decoded; and it’s not going to be possible in the general case to take decoded partial output and seamlessly continue parsing encoded data. 

(For example, in the case of chunk encoding, if the current body data stops halfway through a chunk, I now have no way of knowing how many bytes remain in the chunk because the chunk byte-count was parsed by CFHTTPMessage.)

—Jens

 _______________________________________________
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 CFHTTPMessage to parse response header but not body?
      • From: Jens Alfke <email@hidden>
References: 
 >Using CFHTTPMessage to parse response header but not body? (From: Jens Alfke <email@hidden>)
 >Re: Using CFHTTPMessage to parse response header but not body? (From: Jeff Johnson <email@hidden>)
 >Re: Using CFHTTPMessage to parse response header but not body? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Using CFHTTPMessage to parse response header but not body?
  • Next by Date: Re: Using CFHTTPMessage to parse response header but not body?
  • Previous by thread: Re: Using CFHTTPMessage to parse response header but not body?
  • Next by thread: Re: Using CFHTTPMessage to parse response header but not body?
  • Index(es):
    • Date
    • Thread