cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: huafeng wu <wuhuafeng_at_gmail.com>
Date: Mon, 27 Apr 2009 10:37:41 +0800

Hello,

After I modifid the following line, the bad performance has been improved.

Modify from
*(char *)ptr = pRead->memory[0];
To
memcpy((char *)ptr, &pRead->memory[0], BUFFER_SIZE);

Thanks for your help.

Best Regards,
Steven Wu

2009/4/24 Lars Nilsson <chamaeleon_at_gmail.com>

> On Fri, Apr 24, 2009 at 9:01 AM, huafeng wu <wuhuafeng_at_gmail.com> wrote:
> > Hello,
> > I try to modify the callback function. but at this time the ftp server
> get
> > this file with wrong format and can not open it.
> > So I open this upload file with hex and if the BUFFER_SIZE is 100, I find
> > the first byte is right. the other 99 bytes are wrong.
> > Can you tell me how to modify this function. And how to set the third
> > parameter - nmemb
> > Thanks
> [...]
> > *(char *)ptr = pRead->memory[0];
> [...]
>
> You'll need to work out what's wrong or insufficient with this, if you
> want to send up to BUFFER_SIZE (or size*nmemb, whichever is smaller)
> bytes in one go.
>
> Lars Nilsson
>
Received on 2009-04-27