• 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 help read incoming server-side request?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using CFHTTPMessage to help read incoming server-side request?


  • Subject: Re: Using CFHTTPMessage to help read incoming server-side request?
  • From: Becky Willrich <email@hidden>
  • Date: Mon, 9 Dec 2002 10:01:27 -0800

Which in reality means that you have to parse everything (or at least snoop
for end of headers yourself in the datastream) because if you just start
passing bytes into CFHTTPMessageAppendBytes , you'll likely have gone past
the start of the chunked body by the time HTTPMessage
CFHTTPMessageIsHeaderComplete???

No. You can always recover the excess bytes by calling CFHTTPMessageCopyBody - all the bytes past the end of the header will be there. Just do something like this:

while (!CFHTTPMessageIsHeaderComplete(hdr)) {
int len = myGetBytes(buf);
if (!CFHTTPMessageAppendBytes(hdr, buf, len)) {
// parse error....
}
}
excessData = CFHTTPMessageCopyBody(hdr);
CFRetain(excessData);
CFHTTPMessageSetBody(hdr, NULL);
// Now hdr contains only the headers, and the first bytes of the body are in excessData....

REW
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Using CFHTTPMessage to help read incoming server-side request? (From: James Berry <email@hidden>)

  • Prev by Date: Re: Using CFHTTPMessage to help read incoming server-side request?
  • Next by Date: OpenTransport/TCP in Carbon runs slow?
  • Previous by thread: Re: Using CFHTTPMessage to help read incoming server-side request?
  • Next by thread: Re: socket debug
  • Index(es):
    • Date
    • Thread