mirror of
https://github.com/curl/curl.git
synced 2026-08-25 11:13:32 +03:00
http: limit the initial send amount to used upload buffer size
Previously this logic would cap the send to CURL_MAX_WRITE_SIZE bytes, but for the situations where a larger upload buffer has been set, this function can benefit from sending more bytes. With default size used, this does the same as before. Also changed the storage of the size to an 'unsigned int' as it is not allowed to be set larger than 2M. Also added cautions to the man pages about changing buffer sizes in run-time. Closes #7022
This commit is contained in:
parent
817c01dacc
commit
1763aceb0c
7 changed files with 22 additions and 17 deletions
|
|
@ -627,9 +627,8 @@ static CURLcode smb_send_and_recv(struct Curl_easy *data, void **msg)
|
|||
|
||||
/* Check if there is data in the transfer buffer */
|
||||
if(!smbc->send_size && smbc->upload_size) {
|
||||
size_t nread = smbc->upload_size > data->set.upload_buffer_size ?
|
||||
data->set.upload_buffer_size :
|
||||
smbc->upload_size;
|
||||
size_t nread = smbc->upload_size > (size_t)data->set.upload_buffer_size ?
|
||||
(size_t)data->set.upload_buffer_size : smbc->upload_size;
|
||||
data->req.upload_fromhere = data->state.ulbuf;
|
||||
result = Curl_fillreadbuffer(data, nread, &nread);
|
||||
if(result && result != CURLE_AGAIN)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue