mirror of
https://github.com/moparisthebest/curl
synced 2025-03-11 07:39:50 -04:00
moved the bools in the connectdata struct into the substruct named
ConnectBits where the other bools already are
This commit is contained in:
parent
ca6e770837
commit
42acb00c81
@ -2089,7 +2089,7 @@ CURLcode Curl_ftp(struct connectdata *conn)
|
|||||||
retcode = Curl_ftp_nextconnect(conn);
|
retcode = Curl_ftp_nextconnect(conn);
|
||||||
else
|
else
|
||||||
/* since we didn't connect now, we want do_more to get called */
|
/* since we didn't connect now, we want do_more to get called */
|
||||||
conn->do_more = TRUE;
|
conn->bits.do_more = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return retcode;
|
return retcode;
|
||||||
|
@ -547,7 +547,7 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
conn->allocptr.cookie = aprintf("Cookie: %s\015\012", data->set.cookie);
|
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:")) {
|
if(!checkheaders(data, "Transfer-Encoding:")) {
|
||||||
te = "Transfer-Encoding: chunked\r\n";
|
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) {
|
if(CURLE_OK == easy->result) {
|
||||||
|
|
||||||
/* after do, go PERFORM... or DO_MORE */
|
/* 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
|
/* we're supposed to do more, but we need to sit down, relax
|
||||||
and wait a little while first */
|
and wait a little while first */
|
||||||
easy->state = CURLM_STATE_DO_MORE;
|
easy->state = CURLM_STATE_DO_MORE;
|
||||||
|
@ -905,7 +905,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
|
|
||||||
if(!k->upload_done) {
|
if(!k->upload_done) {
|
||||||
|
|
||||||
if(conn->upload_chunky) {
|
if(conn->bits.upload_chunky) {
|
||||||
/* if chunked Transfer-Encoding */
|
/* if chunked Transfer-Encoding */
|
||||||
buffersize -= (8 + 2 + 2); /* 32bit hex + CRLF + CRLF */
|
buffersize -= (8 + 2 + 2); /* 32bit hex + CRLF + CRLF */
|
||||||
conn->upload_fromhere += 10; /* 32bit hex + 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,
|
nread = data->set.fread(conn->upload_fromhere, 1,
|
||||||
buffersize, data->set.in);
|
buffersize, data->set.in);
|
||||||
|
|
||||||
if(conn->upload_chunky) {
|
if(conn->bits.upload_chunky) {
|
||||||
/* if chunked Transfer-Encoding */
|
/* if chunked Transfer-Encoding */
|
||||||
char hexbuffer[9];
|
char hexbuffer[9];
|
||||||
int hexlen = snprintf(hexbuffer, sizeof(hexbuffer),
|
int hexlen = snprintf(hexbuffer, sizeof(hexbuffer),
|
||||||
@ -1112,13 +1112,13 @@ CURLcode Curl_readwrite_init(struct connectdata *conn)
|
|||||||
Curl_pgrsSetUploadCounter(data, 0);
|
Curl_pgrsSetUploadCounter(data, 0);
|
||||||
Curl_pgrsSetDownloadCounter(data, 0);
|
Curl_pgrsSetDownloadCounter(data, 0);
|
||||||
|
|
||||||
if (!conn->getheader) {
|
if (!conn->bits.getheader) {
|
||||||
k->header = FALSE;
|
k->header = FALSE;
|
||||||
if(conn->size > 0)
|
if(conn->size > 0)
|
||||||
Curl_pgrsSetDownloadSize(data, conn->size);
|
Curl_pgrsSetDownloadSize(data, conn->size);
|
||||||
}
|
}
|
||||||
/* we want header and/or body, if neither then don't do this! */
|
/* 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 */
|
FD_ZERO (&k->readfd); /* clear it */
|
||||||
if(conn->sockfd != -1) {
|
if(conn->sockfd != -1) {
|
||||||
@ -1200,7 +1200,7 @@ Transfer(struct connectdata *conn)
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
|
|
||||||
/* we want header and/or body, if neither then don't do this! */
|
/* 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;
|
return CURLE_OK;
|
||||||
|
|
||||||
k->writefdp = &k->writefd; /* store the address of the set */
|
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 */
|
/* now copy all input parameters */
|
||||||
conn->sockfd = sockfd;
|
conn->sockfd = sockfd;
|
||||||
conn->size = size;
|
conn->size = size;
|
||||||
conn->getheader = getheader;
|
conn->bits.getheader = getheader;
|
||||||
conn->bytecountp = bytecountp;
|
conn->bytecountp = bytecountp;
|
||||||
conn->writesockfd = writesockfd;
|
conn->writesockfd = writesockfd;
|
||||||
conn->writebytecountp = writebytecountp;
|
conn->writebytecountp = writebytecountp;
|
||||||
|
@ -1769,7 +1769,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
is later set "for real" using Curl_pgrsStartNow(). */
|
is later set "for real" using Curl_pgrsStartNow(). */
|
||||||
conn->data->progress.start = conn->created;
|
conn->data->progress.start = conn->created;
|
||||||
|
|
||||||
conn->upload_chunky =
|
conn->bits.upload_chunky =
|
||||||
((conn->protocol&PROT_HTTP) &&
|
((conn->protocol&PROT_HTTP) &&
|
||||||
data->set.upload &&
|
data->set.upload &&
|
||||||
(data->set.infilesize == -1) &&
|
(data->set.infilesize == -1) &&
|
||||||
@ -2889,7 +2889,7 @@ CURLcode Curl_do(struct connectdata **connp)
|
|||||||
struct connectdata *conn = *connp;
|
struct connectdata *conn = *connp;
|
||||||
struct SessionHandle *data=conn->data;
|
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) {
|
if(conn->curl_do) {
|
||||||
/* generic protocol-specific function pointer set in curl_connect() */
|
/* generic protocol-specific function pointer set in curl_connect() */
|
||||||
|
@ -214,6 +214,14 @@ struct ConnectBits {
|
|||||||
IP address */
|
IP address */
|
||||||
bool use_range;
|
bool use_range;
|
||||||
bool rangestringalloc; /* the range string is malloc()'ed */
|
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 */
|
/* READ stuff */
|
||||||
int sockfd; /* socket to read from or -1 */
|
int sockfd; /* socket to read from or -1 */
|
||||||
int size; /* -1 if unknown at this point */
|
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 */
|
long *bytecountp; /* return number of bytes read or NULL */
|
||||||
|
|
||||||
/* WRITE stuff */
|
/* WRITE stuff */
|
||||||
@ -449,12 +456,6 @@ struct connectdata {
|
|||||||
and the 'upload_present' contains the number of bytes available at this
|
and the 'upload_present' contains the number of bytes available at this
|
||||||
position */
|
position */
|
||||||
char *upload_fromhere;
|
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 */
|
/* The end of connectdata. 08/27/02 jhrg */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user