Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CURL.SetOptionBufferSize

Sets the buffer size.

Component Version macOS Windows Linux Server iOS SDK
CURL 2.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetOptionBufferSize"; curl; Value )   More

Parameters

Parameter Description Example
curl The CURL session handle. $curl
Value The buffer size. 50000

Result

Returns "OK" on success.

Description

Sets the buffer size.
Pass a number specifying your preferred size (in bytes) for the receive buffer in libcurl. The main point of this would be that the write callback gets called more often and with smaller chunks. This is just treated as a request, not an order. You cannot be guaranteed to actually get the given size.

This buffer size is by default CURL_MAX_WRITE_SIZE (16kB). The maximum buffer size allowed to be set is CURL_MAX_READ_SIZE (512kB). The minimum buffer size allowed to be set is 1024.

For slow upload/downloads, it may be better to set buffer size to 1 MB with CURL.SetOptionUploadBufferSize or CURL.SetOptionBufferSize properties to make transfers faster.

See also BUFFERSIZE option in CURL manual.

Examples

Sets buffer size:

MBS( "CURL.SetOptionBufferSize"; $curl; 1024*1024 )

See also

Example Databases

Created 18th August 2014, last changed 3th October 2019


CURL.SetOptionAutoReferer - CURL.SetOptionCACacheTimeout