1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-12 12:35:04 -05:00

- shrunk the BUFSIZE define from 50K to 20K

- made a separate buffer for uploads (due to the non-blocking stuff)
- added two connectdata struct fields for non-blocking uploads
This commit is contained in:
Daniel Stenberg 2002-01-16 14:53:19 +00:00
parent 8d07c87be7
commit 8d97792dbc

View File

@ -83,7 +83,7 @@
#include "http_chunks.h" /* for the structs and enum stuff */ #include "http_chunks.h" /* for the structs and enum stuff */
/* Download buffer size, keep it fairly big for speed reasons */ /* Download buffer size, keep it fairly big for speed reasons */
#define BUFSIZE (1024*50) #define BUFSIZE (1024*20)
/* Defaul upload buffer size, keep it smallish to get faster progress meter /* Defaul upload buffer size, keep it smallish to get faster progress meter
updates. This is just default, it is dynamic and adjusts to the upload updates. This is just default, it is dynamic and adjusts to the upload
@ -251,6 +251,7 @@ struct Curl_transfer_keeper {
struct SessionHandle *data; struct SessionHandle *data;
struct connectdata *conn; struct connectdata *conn;
char *buf; char *buf;
char *uploadbuf;
int maxfd; int maxfd;
/* the file descriptors to play with */ /* the file descriptors to play with */
@ -409,6 +410,16 @@ struct connectdata {
/* This struct is inited when needed */ /* This struct is inited when needed */
struct Curl_transfer_keeper keep; struct Curl_transfer_keeper keep;
/* 'upload_present' is used to keep a byte counter of how much data there is
still left in the buffer, aimed for upload. */
int upload_present;
/* 'upload_fromhere' is used as a read-pointer when we uploaded parts of a
buffer, so the next read should read from where this pointer points to,
and the 'upload_present' contains the number of bytes available at this
position */
char *upload_fromhere;
}; };
/* /*
@ -495,8 +506,8 @@ struct UrlState {
char *headerbuff; /* allocated buffer to store headers in */ char *headerbuff; /* allocated buffer to store headers in */
int headersize; /* size of the allocation */ int headersize; /* size of the allocation */
char buffer[BUFSIZE+1]; /* buffer with size BUFSIZE */ char buffer[BUFSIZE+1]; /* download buffer */
char uploadbuffer[BUFSIZE+1]; /* upload buffer */
double current_speed; /* the ProgressShow() funcion sets this */ double current_speed; /* the ProgressShow() funcion sets this */
bool this_is_a_follow; /* this is a followed Location: request */ bool this_is_a_follow; /* this is a followed Location: request */