moved the bools in the connectdata struct into the substruct named
ConnectBits where the other bools already are
This commit is contained in:
Родитель
ca6e770837
Коммит
42acb00c81
|
@ -2089,7 +2089,7 @@ CURLcode Curl_ftp(struct connectdata *conn)
|
|||
retcode = Curl_ftp_nextconnect(conn);
|
||||
else
|
||||
/* since we didn't connect now, we want do_more to get called */
|
||||
conn->do_more = TRUE;
|
||||
conn->bits.do_more = TRUE;
|
||||
}
|
||||
|
||||
return retcode;
|
||||
|
|
|
@ -547,7 +547,7 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||
conn->allocptr.cookie = aprintf("Cookie: %s\015\012", data->set.cookie);
|
||||
}
|
||||
|
||||
if(conn->upload_chunky) {
|
||||
if(conn->bits.upload_chunky) {
|
||||
if(!checkheaders(data, "Transfer-Encoding:")) {
|
||||
te = "Transfer-Encoding: chunked\r\n";
|
||||
}
|
||||
|
|
|
@ -360,7 +360,7 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
|
|||
if(CURLE_OK == easy->result) {
|
||||
|
||||
/* after do, go PERFORM... or DO_MORE */
|
||||
if(easy->easy_conn->do_more) {
|
||||
if(easy->easy_conn->bits.do_more) {
|
||||
/* we're supposed to do more, but we need to sit down, relax
|
||||
and wait a little while first */
|
||||
easy->state = CURLM_STATE_DO_MORE;
|
||||
|
|
|
@ -905,7 +905,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||
|
||||
if(!k->upload_done) {
|
||||
|
||||
if(conn->upload_chunky) {
|
||||
if(conn->bits.upload_chunky) {
|
||||
/* if chunked Transfer-Encoding */
|
||||
buffersize -= (8 + 2 + 2); /* 32bit hex + CRLF + CRLF */
|
||||
conn->upload_fromhere += 10; /* 32bit hex + CRLF */
|
||||
|
@ -914,7 +914,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||
nread = data->set.fread(conn->upload_fromhere, 1,
|
||||
buffersize, data->set.in);
|
||||
|
||||
if(conn->upload_chunky) {
|
||||
if(conn->bits.upload_chunky) {
|
||||
/* if chunked Transfer-Encoding */
|
||||
char hexbuffer[9];
|
||||
int hexlen = snprintf(hexbuffer, sizeof(hexbuffer),
|
||||
|
@ -1112,13 +1112,13 @@ CURLcode Curl_readwrite_init(struct connectdata *conn)
|
|||
Curl_pgrsSetUploadCounter(data, 0);
|
||||
Curl_pgrsSetDownloadCounter(data, 0);
|
||||
|
||||
if (!conn->getheader) {
|
||||
if (!conn->bits.getheader) {
|
||||
k->header = FALSE;
|
||||
if(conn->size > 0)
|
||||
Curl_pgrsSetDownloadSize(data, conn->size);
|
||||
}
|
||||
/* we want header and/or body, if neither then don't do this! */
|
||||
if(conn->getheader || !data->set.no_body) {
|
||||
if(conn->bits.getheader || !data->set.no_body) {
|
||||
|
||||
FD_ZERO (&k->readfd); /* clear it */
|
||||
if(conn->sockfd != -1) {
|
||||
|
@ -1200,7 +1200,7 @@ Transfer(struct connectdata *conn)
|
|||
return CURLE_OK;
|
||||
|
||||
/* we want header and/or body, if neither then don't do this! */
|
||||
if(!conn->getheader && data->set.no_body)
|
||||
if(!conn->bits.getheader && data->set.no_body)
|
||||
return CURLE_OK;
|
||||
|
||||
k->writefdp = &k->writefd; /* store the address of the set */
|
||||
|
@ -1649,7 +1649,7 @@ Curl_Transfer(struct connectdata *c_conn, /* connection data */
|
|||
/* now copy all input parameters */
|
||||
conn->sockfd = sockfd;
|
||||
conn->size = size;
|
||||
conn->getheader = getheader;
|
||||
conn->bits.getheader = getheader;
|
||||
conn->bytecountp = bytecountp;
|
||||
conn->writesockfd = writesockfd;
|
||||
conn->writebytecountp = writebytecountp;
|
||||
|
|
|
@ -1769,7 +1769,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||
is later set "for real" using Curl_pgrsStartNow(). */
|
||||
conn->data->progress.start = conn->created;
|
||||
|
||||
conn->upload_chunky =
|
||||
conn->bits.upload_chunky =
|
||||
((conn->protocol&PROT_HTTP) &&
|
||||
data->set.upload &&
|
||||
(data->set.infilesize == -1) &&
|
||||
|
@ -2889,7 +2889,7 @@ CURLcode Curl_do(struct connectdata **connp)
|
|||
struct connectdata *conn = *connp;
|
||||
struct SessionHandle *data=conn->data;
|
||||
|
||||
conn->do_more = FALSE; /* by default there's no curl_do_more() to use */
|
||||
conn->bits.do_more = FALSE; /* by default there's no curl_do_more() to use */
|
||||
|
||||
if(conn->curl_do) {
|
||||
/* generic protocol-specific function pointer set in curl_connect() */
|
||||
|
|
|
@ -214,6 +214,14 @@ struct ConnectBits {
|
|||
IP address */
|
||||
bool use_range;
|
||||
bool rangestringalloc; /* the range string is malloc()'ed */
|
||||
|
||||
bool do_more; /* this is set TRUE if the ->curl_do_more() function is
|
||||
supposed to be called, after ->curl_do() */
|
||||
|
||||
bool upload_chunky; /* set TRUE if we are doing chunked transfer-encoding
|
||||
on upload */
|
||||
|
||||
bool getheader; /* TRUE if header parsing is wanted */
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -381,7 +389,6 @@ struct connectdata {
|
|||
/* READ stuff */
|
||||
int sockfd; /* socket to read from or -1 */
|
||||
int size; /* -1 if unknown at this point */
|
||||
bool getheader; /* TRUE if header parsing is wanted */
|
||||
long *bytecountp; /* return number of bytes read or NULL */
|
||||
|
||||
/* WRITE stuff */
|
||||
|
@ -449,12 +456,6 @@ struct connectdata {
|
|||
and the 'upload_present' contains the number of bytes available at this
|
||||
position */
|
||||
char *upload_fromhere;
|
||||
|
||||
bool do_more; /* this is set TRUE if the ->curl_do_more() function is
|
||||
supposed to be called, after ->curl_do() */
|
||||
|
||||
bool upload_chunky; /* set TRUE if we are doing chunked transfer-encoding
|
||||
on upload */
|
||||
};
|
||||
|
||||
/* The end of connectdata. 08/27/02 jhrg */
|
||||
|
|
Загрузка…
Ссылка в новой задаче