mirror of
https://github.com/curl/curl.git
synced 2026-07-31 11:28:06 +03:00
- Added CURLFORM_STREAM as a supported option to curl_formadd() to allow an
application to provide data for a multipart with the read callback. Note that the size needs to be provided with CURLFORM_CONTENTSLENGTH when the stream option is used. This feature is verified by the new test case 554. This feature was sponsored by Xponaut.
This commit is contained in:
parent
1e482fe6a8
commit
a2314225e0
10 changed files with 340 additions and 78 deletions
|
|
@ -211,10 +211,16 @@ struct curl_httppost {
|
|||
do not free in formfree */
|
||||
#define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */
|
||||
#define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */
|
||||
#define HTTPPOST_CALLBACK (1<<6) /* upload fiel contents by using the
|
||||
regular read callback to get the data
|
||||
and pass the given pointer as custom
|
||||
pointer */
|
||||
|
||||
char *showfilename; /* The file name to show. If not set, the
|
||||
actual file name will be used (if this
|
||||
is a file part) */
|
||||
void *userp; /* custom pointer used for
|
||||
HTTPPOST_CALLBACK posts */
|
||||
};
|
||||
|
||||
typedef int (*curl_progress_callback)(void *clientp,
|
||||
|
|
@ -246,7 +252,7 @@ typedef size_t (*curl_write_callback)(char *buffer,
|
|||
#define CURL_READFUNC_PAUSE 0x10000001
|
||||
typedef int (*curl_seek_callback)(void *instream,
|
||||
curl_off_t offset,
|
||||
int origin); /* 'whence' */
|
||||
int origin); /* 'whence' */
|
||||
|
||||
typedef size_t (*curl_read_callback)(char *buffer,
|
||||
size_t size,
|
||||
|
|
@ -1313,6 +1319,8 @@ typedef enum {
|
|||
CFINIT(END),
|
||||
CFINIT(OBSOLETE2),
|
||||
|
||||
CFINIT(STREAM),
|
||||
|
||||
CURLFORM_LASTENTRY /* the last unusued */
|
||||
} CURLformoption;
|
||||
|
||||
|
|
@ -1796,7 +1804,7 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
|
|||
!defined(__cplusplus)
|
||||
#include "typecheck-gcc.h"
|
||||
#else
|
||||
#if defined(__STDC__) && (__STDC__ >= 1)
|
||||
#if defined(__STDC__) && (__STDC__ >= 1)
|
||||
/* This preprocessor magic that replaces a call with the exact same call is
|
||||
only done to make sure application authors pass exactly three arguments
|
||||
to these functions. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue