From: Daniel Stenberg Date: Sun, 24 Oct 2004 22:31:40 +0000 (+0000) Subject: Mohun Biswas found out that formposting a zero-byte file didn't work very X-Git-Tag: curl-7_12_3~272 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=beb61ef4298a91422679fec79475b70422095d40;p=thirdparty%2Fcurl.git Mohun Biswas found out that formposting a zero-byte file didn't work very good. I fixed. --- diff --git a/CHANGES b/CHANGES index 9d441e1663..1f3813fbe6 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,10 @@ Changelog +Daniel (25 October 2004) +- Mohun Biswas found out that formposting a zero-byte file didn't work very + good. I fixed. + Daniel (19 October 2004) - Alexander Krasnostavsky made it possible to make FTP 3rd party transfers with both source and destination being the same host. It can be useful if diff --git a/lib/formdata.c b/lib/formdata.c index 1711134852..442c306f50 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) {