cURL / Mailing Lists / curl-library / Single Mail

curl-library

copying everything downloaded

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 11 Nov 2006 22:52:01 +0100 (CET)

Hey Ravi,

I'm a bit curious on the copying between buf and conn->master_buffer at the
end of the lib/sendf.c:Curl_read() function!

It clearly unconditionally always duplicate the data it just downloaded to a
second buffer. Why is that needed?

AFAIU, the extra copy is made to allow the code to rewind when too much has
been read off a pipeline for one transfer when a part was actually indended
for the next transfer/handle? If so, can't we fix that code to only keep the
extra buffer when the connection is in fact pipelined?

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-11-11