cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: out of memory error while posting form data

From: deva seetharam <tagsense_at_yahoo.com>
Date: Wed, 30 Jul 2008 04:44:22 -0700 (PDT)

yep, that was the problem. thank you!

--- On Tue, 7/29/08, Dan Fandrich <dan_at_coneharvesters.com> wrote:

> From: Dan Fandrich <dan_at_coneharvesters.com>
> Subject: Re: out of memory error while posting form data
> To: curl-library_at_cool.haxx.se
> Date: Tuesday, July 29, 2008, 11:45 PM
> On Tue, Jul 29, 2008 at 08:21:08PM -0700, deva seetharam
> wrote:
> > here is the code (with the error checking removed, for
> brevity). it is arelatively simple code that posts a form
> with 3 text fields and 1 data file.
>
> > int curlUploadData(char* data, unsigned int dataSize)
> {
> [...]
> > /* Add the transmit buffer as a file upload as
> multipart form data,
> > with form item name "datafile" */
> > curl_formadd(&post, &last,
> > CURLFORM_COPYNAME, "datafile",
> > CURLFORM_BUFFER, "filename",
> > CURLFORM_BUFFERPTR, data,
> > CURLFORM_BUFFERLENGTH, dataSize,
> > CURLFORM_END);
>
> CURLFORM_BUFFERLENGTH
> is used in combination with
> CURLFORM_BUFFER. The
> parameter is a long which gives the length
> of the
> buffer.
>
> dataSize is an unsigned int, not a long like it should be.
> On 32-bit x86
> Linux they're the same length, but on x86-64,
> they're not. That's probably
> the problem right there.
>
> >>> Dan
> --
> http://www.MoveAnnouncer.com The web change of
> address service
> Let webmasters know that your web site has moved

      
Received on 2008-07-30