cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

RE: Splitting header and body and reliably detecting the ole http return code...

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 15 Dec 2007 23:54:11 +0100 (CET)

On Sat, 15 Dec 2007, Drew Weaver wrote:

> If you know off hand, how does cURL separate the body/header after it pulls
> down the content? If it does not use \r\n\r\n to determine where the header
> and body are separated.

libcurl gets each header one by one (and each ends with CRLF/LF) and when
there's just a CRLF or just an LF after a header it knows it is the end of the
headers.

This method is actually what I would call fail-proof since curl has done
exactly the same thing (and the same code) since the start more or less and
this hasn't broken for at least the last 7-8 years.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-12-15