cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Upload Buffer Patch - curl-7.9.7

From: Combes, Chris M. <ccombes_at_northropgrumman.com>
Date: Wed, 12 Jun 2002 09:30:05 -0400

Daniel,

I understand you wanted me to use the following options:

CURLFORM_FILENAME; set the filename
CURLFORM_PTRFILEBUFFER; set the pointer to a buffer
CURLFORM_FILEBUFFERLENGTH; set the buffer length

I used the following options in the patch:

CURLFORM_BUFFER; indicate we are using a buffer
CURLFORM_PTRBUFFER; set the pointer to a buffer
CURLFORM_BUFFERLENGTH; set the buffer length

Reasons for using CURLFORM_BUFFER instead of CURLFORM_FILENAME:

1. Case "CURLFORM_FILE" sets the flag HTTPPOST_FILENAME, while
case "CURLFORM_BUFFER" sets the flag HTTPPOST_BUFFER. Therefore,
I consider the two options an indicator for what the rest of the
parameters will be for curl_formadd().
2. By using "BUFFER" in each of the three options, it provides
a consistent interface to the user.
3. If we use CURLFORM_FILENAME to set the filename, then we would
need to set the HTTPPOST_BUFFER flag in the BUFFERPTR pointer
option. Doing so would change the consistency in how we set flags
for options.

Reason for using CURLFORM_PTRBUFFER and CURLFORM_BUFFERLENGTH:

Use of a buffer does not indicate that the original data is
from a file. The data could have existed only in memory (which is
why I needed this option to exist in the first place). Using
the "BUFFER" name indicates to the user that the data exists
in some memory location, regardless of how the data at this
memory location was placed there.

I hope this explains things well enough for acceptance.

Thanks,
Chris

Daniel Stenberg wrote:
>
> On Tue, 11 Jun 2002, Combes, Chris M. wrote:
>
> > Attached is a diff file containing changes to support the operation of
> > uploading data from a buffer, instead of from a file.
>
> What happened to the new names and not using CURLFORM_BUFFER to do the same
> as CURLFORM_FILENAME already does?
>
> --
> Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
>
> _______________________________________________________________
>
> Sponsored by:
> ThinkGeek at http://www.ThinkGeek.com/

_______________________________________________________________

Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
Received on 2002-06-12