curl-library
Re: How to detect the end of a http request/response
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 14 Jun 2013 16:35:42 +0200 (CEST)
Date: Fri, 14 Jun 2013 16:35:42 +0200 (CEST)
On Fri, 14 Jun 2013, garygaowork wrote:
> I'm reading the source code of it recently,searching for how to detect the
> end of a http request/response received by http client or server.
The headers are terminated with a single CRLF and then the body follows. And
as each header also is terminated with CRLF it makes a 4-bytes CRLFCRLF
sequence between them. See
http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-22#page-19
> I thought it was in Curl_http_readwrite_headers of http.c. My question is is
> this function enough to detect the end?
Yes I believe that function does the end of header detection. But I can't
answer if it is "enough" as it of course works together with the other
functions...
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2013-06-14