]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Mohun Biswas found out that formposting a zero-byte file didn't work very
authorDaniel Stenberg <daniel@haxx.se>
Sun, 24 Oct 2004 22:31:40 +0000 (22:31 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 24 Oct 2004 22:31:40 +0000 (22:31 +0000)
good. I fixed.

CHANGES
lib/formdata.c

diff --git a/CHANGES b/CHANGES
index 9d441e1663aa291ea30380430015dbc5ba335a7e..1f3813fbe62a0bf0f9b70f4b4efb7d2d0bee4c16 100644 (file)
--- 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
index 1711134852d8e394b5390d50fd4c69f35dd96bb9..442c306f500095487f34db76571c0800a7cbb7ad 100644 (file)
@@ -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) {