Added CURLOPT_POSTFIELDSIZE_LARGE to offer a large file version of the
authorDaniel Stenberg <daniel@haxx.se>
Fri, 12 Mar 2004 08:55:47 +0000 (08:55 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 12 Mar 2004 08:55:47 +0000 (08:55 +0000)
CURLOPT_POSTFIELDSIZE option to allow really big HTTP POSTs.

CHANGES
RELEASE-NOTES
docs/libcurl/curl_easy_setopt.3
include/curl/curl.h
lib/url.c
lib/urldata.h

diff --git a/CHANGES b/CHANGES
index 0d825af..f178949 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,12 @@
 
                                   Changelog
 
+Daniel (12 March 2004)
+- Added CURLOPT_POSTFIELDSIZE_LARGE, the large file version of
+  CURLOPT_POSTFIELDSIZE to allow POSTs larger than 2GB.
+
+- David Byron fixed an uninitialized variable case/crash.
+
 Daniel (10 March 2004)
 - Jeff Lawson fixed the SSL connection to deal with received signals during the
   connect.
index 524b74d..3b3041d 100644 (file)
@@ -3,10 +3,11 @@ Curl and libcurl 7.11.1. A bugfix release.
  Public curl release number:               79
  Releases counted from the very beginning: 106
  Available command line options:           94
- Available curl_easy_setopt() options:     111
+ Available curl_easy_setopt() options:     112
 
 This release includes the following changes:
 
+ o CURLOPT_POSTFIELDSIZE_LARGE added to offer POSTs larger than 2GB
  o CURL_VERSION_LARGEFILE is a feature bit returned by libcurls that feature
    large file support
  o libcurl only requires winsock 1.1 on windows now
index afe04b2..7feb1eb 100644 (file)
@@ -21,7 +21,7 @@
 .\" * $Id$
 .\" **************************************************************************
 .\"
-.TH curl_easy_setopt 3 "27 Feb 2004" "libcurl 7.11.1" "libcurl Manual"
+.TH curl_easy_setopt 3 "12 Mar 2004" "libcurl 7.11.1" "libcurl Manual"
 .SH NAME
 curl_easy_setopt - set options for a curl easy handle
 .SH SYNOPSIS
@@ -464,6 +464,11 @@ If you want to post data to the server without letting libcurl do a strlen()
 to measure the data size, this option must be used. When this option is used
 you can post fully binary data, which otherwise is likely to fail. If this
 size is set to zero, the library will use strlen() to get the size.
+.IP CURLOPT_POSTFIELDSIZE_LARGE
+Pass a curl_off_t as parameter. Use this to set the size of the
+\fICURLOPT_POSTFIELDS\fP data to prevent libcurl from doing strlen() on the
+data to figure out the size. This is the large file version of the
+\fICURLOPT_POSTFIELDSIZE\fP option.
 .IP CURLOPT_HTTPPOST
 Tells libcurl you want a multipart/formdata HTTP POST to be made and you
 instruct what data to pass on to the server.  Pass a pointer to a linked list
index 5ba8192..0a3b327 100644 (file)
@@ -783,6 +783,9 @@ typedef enum {
   */
   CINIT(FTP_SSL, LONG, 119),
 
+  /* The _LARGE version of the standard POSTFIELDSIZE option */
+  CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
+
   CURLOPT_LASTENTRY /* the last unused */
 } CURLoption;
 
index 2b215bd..f7b7cc3 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -782,11 +782,18 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
     break;
   case CURLOPT_POSTFIELDSIZE:
     /*
-     * The size of the POSTFIELD data, if curl should now do a strlen
-     * to find out. Enables binary posts.
+     * The size of the POSTFIELD data to prevent libcurl to do strlen() to
+     * figure it out. Enables binary posts.
      */
     data->set.postfieldsize = va_arg(param, long);
     break;
+  case CURLOPT_POSTFIELDSIZE_LARGE:
+    /*
+     * The size of the POSTFIELD data to prevent libcurl to do strlen() to
+     * figure it out. Enables binary posts.
+     */
+    data->set.postfieldsize = va_arg(param, curl_off_t);
+    break;
   case CURLOPT_REFERER:
     /*
      * String to set in the HTTP Referer: field.
index 4e7b14e..1338c66 100644 (file)
@@ -780,9 +780,9 @@ struct UserDefined {
   char *useragent;   /* User-Agent string */
   char *encoding;    /* Accept-Encoding string */
   char *postfields;  /* if POST, set the fields' values here */
-  size_t postfieldsize; /* if POST, this might have a size to use instead of
-                           strlen(), and then the data *may* be binary (contain
-                           zero bytes) */
+  curl_off_t postfieldsize; /* if POST, this might have a size to use instead
+                               of strlen(), and then the data *may* be binary
+                               (contain zero bytes) */
   char *ftpport;     /* port to send with the FTP PORT command */
   char *device;      /* network interface to use */
   curl_write_callback fwrite;        /* function that stores the output */