summaryrefslogtreecommitdiff
path: root/lib/formdata.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-10-24 22:31:40 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-10-24 22:31:40 +0000
commitbeb61ef4298a91422679fec79475b70422095d40 (patch)
tree82b0bec2df856ecfe6d4c5593826dcc26780846a /lib/formdata.c
parent72aff74798e1a3cb4bf038edf05cfb72c3111222 (diff)
downloadcurl-beb61ef4298a91422679fec79475b70422095d40.tar.gz
Mohun Biswas found out that formposting a zero-byte file didn't work very
good. I fixed.
Diffstat (limited to 'lib/formdata.c')
-rw-r--r--lib/formdata.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index 171113485..442c306f5 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -1307,9 +1307,13 @@ size_t Curl_FormReader(char *buffer,
if(!form->data)
return 0; /* nothing, error, empty */
- if(form->data->type == FORM_FILE)
- return readfromfile(form, buffer, wantedsize);
+ if(form->data->type == FORM_FILE) {
+ gotsize = readfromfile(form, buffer, wantedsize);
+ if(gotsize)
+ /* If positive or -1, return. If zero, continue! */
+ return gotsize;
+ }
do {
if( (form->data->length - form->sent ) > wantedsize - gotsize) {