mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
upload: UPLOAD_BUFSIZE is now for the upload buffer
This commit is contained in:
parent
8ed81f67c2
commit
89cf6f38d2
@ -360,7 +360,7 @@ static CURLcode file_upload(struct connectdata *conn)
|
|||||||
|
|
||||||
while(!result) {
|
while(!result) {
|
||||||
int readcount;
|
int readcount;
|
||||||
result = Curl_fillreadbuffer(conn, BUFSIZE, &readcount);
|
result = Curl_fillreadbuffer(conn, (int)data->set.buffer_size, &readcount);
|
||||||
if(result)
|
if(result)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -607,7 +607,7 @@ static CURLcode smb_send_and_recv(struct connectdata *conn, void **msg)
|
|||||||
|
|
||||||
/* Check if there is data in the transfer buffer */
|
/* Check if there is data in the transfer buffer */
|
||||||
if(!smbc->send_size && smbc->upload_size) {
|
if(!smbc->send_size && smbc->upload_size) {
|
||||||
int nread = smbc->upload_size > BUFSIZE ? BUFSIZE :
|
int nread = smbc->upload_size > UPLOAD_BUFSIZE ? UPLOAD_BUFSIZE :
|
||||||
(int) smbc->upload_size;
|
(int) smbc->upload_size;
|
||||||
conn->data->req.upload_fromhere = conn->data->state.uploadbuffer;
|
conn->data->req.upload_fromhere = conn->data->state.uploadbuffer;
|
||||||
result = Curl_fillreadbuffer(conn, nread, &nread);
|
result = Curl_fillreadbuffer(conn, nread, &nread);
|
||||||
|
@ -904,7 +904,7 @@ static CURLcode readwrite_upload(struct Curl_easy *data,
|
|||||||
sending_http_headers = FALSE;
|
sending_http_headers = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = Curl_fillreadbuffer(conn, BUFSIZE, &fillcount);
|
result = Curl_fillreadbuffer(conn, UPLOAD_BUFSIZE, &fillcount);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
@ -207,6 +207,10 @@
|
|||||||
#define MAX_BUFSIZE CURL_MAX_READ_SIZE
|
#define MAX_BUFSIZE CURL_MAX_READ_SIZE
|
||||||
#define MIN_BUFSIZE 1024
|
#define MIN_BUFSIZE 1024
|
||||||
|
|
||||||
|
/* The upload buffer size, should not be smaller than CURL_MAX_WRITE_SIZE, as
|
||||||
|
it needs to hold a full buffer as could be sent in a write callback */
|
||||||
|
#define UPLOAD_BUFSIZE CURL_MAX_WRITE_SIZE
|
||||||
|
|
||||||
/* Initial size of the buffer to store headers in, it'll be enlarged in case
|
/* Initial size of the buffer to store headers in, it'll be enlarged in case
|
||||||
of need. */
|
of need. */
|
||||||
#define HEADERSIZE 256
|
#define HEADERSIZE 256
|
||||||
@ -1333,7 +1337,7 @@ struct UrlState {
|
|||||||
size_t headersize; /* size of the allocation */
|
size_t headersize; /* size of the allocation */
|
||||||
|
|
||||||
char *buffer; /* download buffer */
|
char *buffer; /* download buffer */
|
||||||
char uploadbuffer[BUFSIZE+1]; /* upload buffer */
|
char uploadbuffer[UPLOAD_BUFSIZE+1]; /* upload buffer */
|
||||||
curl_off_t current_speed; /* the ProgressShow() function sets this,
|
curl_off_t current_speed; /* the ProgressShow() function sets this,
|
||||||
bytes / second */
|
bytes / second */
|
||||||
bool this_is_a_follow; /* this is a followed Location: request */
|
bool this_is_a_follow; /* this is a followed Location: request */
|
||||||
|
Loading…
Reference in New Issue
Block a user