aboutsummaryrefslogtreecommitdiff
path: root/lib/formdata.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-06-14 08:51:43 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-06-14 08:51:43 +0000
commit24572dacccd331bcdfe5baca20c56d85d5d77359 (patch)
treed831cfbb1a20fa11baa132f7b0473e82c956b986 /lib/formdata.h
parent1770563fffde91688608bf1359af6170592df0a8 (diff)
Allow formposting of files larger than what fits in memory by not reading the
file until it is actually being uploaded. Make sure we build and still work with HTTP disabled - the SSL code might use the boundary string for some random seeding.
Diffstat (limited to 'lib/formdata.h')
-rw-r--r--lib/formdata.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/formdata.h b/lib/formdata.h
index eb5284caa..c6a78cdee 100644
--- a/lib/formdata.h
+++ b/lib/formdata.h
@@ -2,10 +2,10 @@
#define __FORMDATA_H
/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
@@ -13,7 +13,7 @@
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
- *
+ *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
@@ -23,17 +23,25 @@
*
* $Id$
***************************************************************************/
+
+enum formtype {
+ FORM_DATA, /* regular data */
+ FORM_FILE /* 'line' points to a file name we should read from */
+};
+
/* plain and simple linked list with lines to send */
struct FormData {
struct FormData *next;
+ enum formtype type;
char *line;
size_t length;
};
struct Form {
struct FormData *data; /* current form line to send */
- unsigned int sent; /* number of bytes of the current line that has already
- been sent in a previous invoke */
+ 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 */
};
/* used by FormAdd for temporary storage */