aboutsummaryrefslogtreecommitdiff
path: root/lib/setopt.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-08-18 16:17:05 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-09-06 10:53:39 +0200
commit2825f46d950ca9b0e269ed8dc6a97c5238a17c30 (patch)
tree1869f93855474b2fe4469351b0dd5ef890bb1fb1 /lib/setopt.c
parent87fefe5ebfa152386396b8e232c7b5b0609f6f35 (diff)
CURLOPT_UPLOAD_BUFFERSIZE: set upload buffer size
This is step 3 of #2888. Fixes #2888 Closes #2896
Diffstat (limited to 'lib/setopt.c')
-rw-r--r--lib/setopt.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/setopt.c b/lib/setopt.c
index 475a33798..4a71f9ae4 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -1940,6 +1940,22 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
break;
+ case CURLOPT_UPLOAD_BUFFERSIZE:
+ /*
+ * The application kindly asks for a differently sized upload buffer.
+ * Cap it to sensible.
+ */
+ arg = va_arg(param, long);
+
+ if(arg > UPLOADBUFFER_MAX)
+ arg = UPLOADBUFFER_MAX;
+ else if(arg < UPLOADBUFFER_MIN)
+ arg = UPLOADBUFFER_MIN;
+
+ data->set.upload_buffer_size = arg;
+ Curl_safefree(data->state.ulbuf); /* force a realloc next opportunity */
+ break;
+
case CURLOPT_NOSIGNAL:
/*
* The application asks not to set any signal() or alarm() handlers,