cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Use memory to ftp upload large image and got a bad performance

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 24 Apr 2009 13:16:56 +0200 (CEST)

On Fri, 24 Apr 2009, huafeng wu wrote:

> if (pRead->size)
> {
> *(char *)ptr = pRead->memory[0]; // copy one single byte
> pRead->memory++; // advance pointer
> pRead->size--; // less data left */
> return 1;
> }

This is the reason. It returns one byte at a time. You should rewrite it to
fill as much as possible of the buffer in each invoke.

-- 
  / daniel.haxx.se
Received on 2009-04-24