From a2314225e02ea2f3bd49dc8557f2452846e49b19 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 31 Mar 2008 10:02:23 +0000 Subject: - 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. --- lib/formdata.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/formdata.h') diff --git a/lib/formdata.h b/lib/formdata.h index 4ca0f3c5c..04f139322 100644 --- a/lib/formdata.h +++ b/lib/formdata.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -27,8 +27,10 @@ enum formtype { FORM_DATA, /* form metadata (convert to network encoding if necessary) */ FORM_CONTENT, /* form content (never convert) */ - FORM_FILE /* 'line' points to a file name we should read from - to create the form data (never convert) */ + FORM_CALLBACK, /* 'line' points to the custom pointer we pass to the callback + */ + FORM_FILE /* 'line' points to a file name we should read from + to create the form data (never convert) */ }; /* plain and simple linked list with lines to send */ @@ -44,6 +46,7 @@ struct Form { size_t sent; /* number of bytes of the current line that has already been sent in a previous invoke */ FILE *fp; /* file to read from */ + curl_read_callback fread_func; /* fread callback pointer */ }; /* used by FormAdd for temporary storage */ @@ -62,6 +65,7 @@ typedef struct FormInfo { char *showfilename; /* The file name to show. If not set, the actual file name will be used */ bool showfilename_alloc; + char *userp; /* pointer for the read callback */ struct curl_slist* contentheader; struct FormInfo *more; } FormInfo; -- cgit v1.2.3