indent and comment cleanup (no code change)
This commit is contained in:
223
lib/url.c
223
lib/url.c
@@ -787,16 +787,16 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
data->set.dns_cache_timeout = va_arg(param, long);
|
data->set.dns_cache_timeout = va_arg(param, long);
|
||||||
break;
|
break;
|
||||||
case CURLOPT_DNS_USE_GLOBAL_CACHE:
|
case CURLOPT_DNS_USE_GLOBAL_CACHE:
|
||||||
{
|
{
|
||||||
/* remember we want this enabled */
|
/* remember we want this enabled */
|
||||||
long use_cache = va_arg(param, long);
|
long use_cache = va_arg(param, long);
|
||||||
data->set.global_dns_cache = (bool)(0 != use_cache);
|
data->set.global_dns_cache = (bool)(0 != use_cache);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CURLOPT_SSL_CIPHER_LIST:
|
case CURLOPT_SSL_CIPHER_LIST:
|
||||||
/* set a list of cipher we want to use in the SSL connection */
|
/* set a list of cipher we want to use in the SSL connection */
|
||||||
result = setstropt(&data->set.str[STRING_SSL_CIPHER_LIST],
|
result = setstropt(&data->set.str[STRING_SSL_CIPHER_LIST],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_RANDOM_FILE:
|
case CURLOPT_RANDOM_FILE:
|
||||||
@@ -805,14 +805,14 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* the random SSL stuff with. The file is only used for reading.
|
* the random SSL stuff with. The file is only used for reading.
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_SSL_RANDOM_FILE],
|
result = setstropt(&data->set.str[STRING_SSL_RANDOM_FILE],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_EGDSOCKET:
|
case CURLOPT_EGDSOCKET:
|
||||||
/*
|
/*
|
||||||
* The Entropy Gathering Daemon socket pathname
|
* The Entropy Gathering Daemon socket pathname
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_SSL_EGDSOCKET],
|
result = setstropt(&data->set.str[STRING_SSL_EGDSOCKET],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_MAXCONNECTS:
|
case CURLOPT_MAXCONNECTS:
|
||||||
/*
|
/*
|
||||||
@@ -940,7 +940,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* Use this file instead of the $HOME/.netrc file
|
* Use this file instead of the $HOME/.netrc file
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_NETRC_FILE],
|
result = setstropt(&data->set.str[STRING_NETRC_FILE],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_TRANSFERTEXT:
|
case CURLOPT_TRANSFERTEXT:
|
||||||
/*
|
/*
|
||||||
@@ -993,8 +993,8 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
*/
|
*/
|
||||||
argptr = va_arg(param, char *);
|
argptr = va_arg(param, char *);
|
||||||
result = setstropt(&data->set.str[STRING_ENCODING],
|
result = setstropt(&data->set.str[STRING_ENCODING],
|
||||||
(argptr && !*argptr)?
|
(argptr && !*argptr)?
|
||||||
(char *) ALL_CONTENT_ENCODINGS: argptr);
|
(char *) ALL_CONTENT_ENCODINGS: argptr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_FOLLOWLOCATION:
|
case CURLOPT_FOLLOWLOCATION:
|
||||||
@@ -1056,8 +1056,8 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if((data->set.postfieldsize < 0) ||
|
if((data->set.postfieldsize < 0) ||
|
||||||
((sizeof(curl_off_t) != sizeof(size_t)) &&
|
((sizeof(curl_off_t) != sizeof(size_t)) &&
|
||||||
(data->set.postfieldsize > (curl_off_t)((size_t)-1))))
|
(data->set.postfieldsize > (curl_off_t)((size_t)-1))))
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
result = CURLE_OUT_OF_MEMORY;
|
||||||
else {
|
else {
|
||||||
char * p;
|
char * p;
|
||||||
@@ -1068,7 +1068,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
later address compare to detect the COPYPOSTFIELDS mode, and
|
later address compare to detect the COPYPOSTFIELDS mode, and
|
||||||
to mark that postfields is used rather than read function or
|
to mark that postfields is used rather than read function or
|
||||||
form data.
|
form data.
|
||||||
*/
|
*/
|
||||||
p = malloc((size_t)(data->set.postfieldsize?data->set.postfieldsize:1));
|
p = malloc((size_t)(data->set.postfieldsize?data->set.postfieldsize:1));
|
||||||
|
|
||||||
if(!p)
|
if(!p)
|
||||||
@@ -1104,11 +1104,11 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
bigsize = va_arg(param, long);
|
bigsize = va_arg(param, long);
|
||||||
|
|
||||||
if(data->set.postfieldsize < bigsize &&
|
if(data->set.postfieldsize < bigsize &&
|
||||||
data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) {
|
data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) {
|
||||||
/* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */
|
/* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */
|
||||||
(void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
|
(void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
|
||||||
data->set.postfields = NULL;
|
data->set.postfields = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
data->set.postfieldsize = bigsize;
|
data->set.postfieldsize = bigsize;
|
||||||
break;
|
break;
|
||||||
@@ -1121,11 +1121,11 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
bigsize = va_arg(param, curl_off_t);
|
bigsize = va_arg(param, curl_off_t);
|
||||||
|
|
||||||
if(data->set.postfieldsize < bigsize &&
|
if(data->set.postfieldsize < bigsize &&
|
||||||
data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) {
|
data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) {
|
||||||
/* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */
|
/* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */
|
||||||
(void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
|
(void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
|
||||||
data->set.postfields = NULL;
|
data->set.postfields = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
data->set.postfieldsize = bigsize;
|
data->set.postfieldsize = bigsize;
|
||||||
break;
|
break;
|
||||||
@@ -1148,7 +1148,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
data->change.referer_alloc = FALSE;
|
data->change.referer_alloc = FALSE;
|
||||||
}
|
}
|
||||||
result = setstropt(&data->set.str[STRING_SET_REFERER],
|
result = setstropt(&data->set.str[STRING_SET_REFERER],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
data->change.referer = data->set.str[STRING_SET_REFERER];
|
data->change.referer = data->set.str[STRING_SET_REFERER];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1157,7 +1157,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* String to use in the HTTP User-Agent field
|
* String to use in the HTTP User-Agent field
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_USERAGENT],
|
result = setstropt(&data->set.str[STRING_USERAGENT],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_HTTPHEADER:
|
case CURLOPT_HTTPHEADER:
|
||||||
@@ -1180,7 +1180,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* Cookie string to send to the remote server in the request.
|
* Cookie string to send to the remote server in the request.
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_COOKIE],
|
result = setstropt(&data->set.str[STRING_COOKIE],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_COOKIEFILE:
|
case CURLOPT_COOKIEFILE:
|
||||||
@@ -1206,7 +1206,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* Set cookie file name to dump all cookies to when we're done.
|
* Set cookie file name to dump all cookies to when we're done.
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_COOKIEJAR],
|
result = setstropt(&data->set.str[STRING_COOKIEJAR],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Activate the cookie parser. This may or may not already
|
* Activate the cookie parser. This may or may not already
|
||||||
@@ -1310,7 +1310,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* Set a custom string to use as request
|
* Set a custom string to use as request
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_CUSTOMREQUEST],
|
result = setstropt(&data->set.str[STRING_CUSTOMREQUEST],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
|
|
||||||
/* we don't set
|
/* we don't set
|
||||||
data->set.httpreq = HTTPREQ_CUSTOM;
|
data->set.httpreq = HTTPREQ_CUSTOM;
|
||||||
@@ -1377,7 +1377,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* to decide for us.
|
* to decide for us.
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_PROXY],
|
result = setstropt(&data->set.str[STRING_PROXY],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_WRITEHEADER:
|
case CURLOPT_WRITEHEADER:
|
||||||
@@ -1404,7 +1404,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* Use FTP PORT, this also specifies which IP address to use
|
* Use FTP PORT, this also specifies which IP address to use
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_FTPPORT],
|
result = setstropt(&data->set.str[STRING_FTPPORT],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
data->set.ftp_use_port = (bool)(NULL != data->set.str[STRING_FTPPORT]);
|
data->set.ftp_use_port = (bool)(NULL != data->set.str[STRING_FTPPORT]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1489,7 +1489,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
data->change.url_alloc=FALSE;
|
data->change.url_alloc=FALSE;
|
||||||
}
|
}
|
||||||
result = setstropt(&data->set.str[STRING_SET_URL],
|
result = setstropt(&data->set.str[STRING_SET_URL],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
data->change.url = data->set.str[STRING_SET_URL];
|
data->change.url = data->set.str[STRING_SET_URL];
|
||||||
break;
|
break;
|
||||||
case CURLOPT_PORT:
|
case CURLOPT_PORT:
|
||||||
@@ -1526,7 +1526,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* user:password to use in the operation
|
* user:password to use in the operation
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_USERPWD],
|
result = setstropt(&data->set.str[STRING_USERPWD],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_POSTQUOTE:
|
case CURLOPT_POSTQUOTE:
|
||||||
/*
|
/*
|
||||||
@@ -1568,14 +1568,14 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* user:password needed to use the proxy
|
* user:password needed to use the proxy
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_PROXYUSERPWD],
|
result = setstropt(&data->set.str[STRING_PROXYUSERPWD],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_RANGE:
|
case CURLOPT_RANGE:
|
||||||
/*
|
/*
|
||||||
* What range of the file you want to transfer
|
* What range of the file you want to transfer
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_SET_RANGE],
|
result = setstropt(&data->set.str[STRING_SET_RANGE],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_RESUME_FROM:
|
case CURLOPT_RESUME_FROM:
|
||||||
/*
|
/*
|
||||||
@@ -1685,35 +1685,35 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* String that holds file name of the SSL certificate to use
|
* String that holds file name of the SSL certificate to use
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_CERT],
|
result = setstropt(&data->set.str[STRING_CERT],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_SSLCERTTYPE:
|
case CURLOPT_SSLCERTTYPE:
|
||||||
/*
|
/*
|
||||||
* String that holds file type of the SSL certificate to use
|
* String that holds file type of the SSL certificate to use
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_CERT_TYPE],
|
result = setstropt(&data->set.str[STRING_CERT_TYPE],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_SSLKEY:
|
case CURLOPT_SSLKEY:
|
||||||
/*
|
/*
|
||||||
* String that holds file name of the SSL certificate to use
|
* String that holds file name of the SSL certificate to use
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_KEY],
|
result = setstropt(&data->set.str[STRING_KEY],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_SSLKEYTYPE:
|
case CURLOPT_SSLKEYTYPE:
|
||||||
/*
|
/*
|
||||||
* String that holds file type of the SSL certificate to use
|
* String that holds file type of the SSL certificate to use
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_KEY_TYPE],
|
result = setstropt(&data->set.str[STRING_KEY_TYPE],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_KEYPASSWD:
|
case CURLOPT_KEYPASSWD:
|
||||||
/*
|
/*
|
||||||
* String that holds the SSL or SSH private key password.
|
* String that holds the SSL or SSH private key password.
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_KEY_PASSWD],
|
result = setstropt(&data->set.str[STRING_KEY_PASSWD],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_SSLENGINE:
|
case CURLOPT_SSLENGINE:
|
||||||
/*
|
/*
|
||||||
@@ -1721,7 +1721,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
*/
|
*/
|
||||||
argptr = va_arg(param, char *);
|
argptr = va_arg(param, char *);
|
||||||
if(argptr && argptr[0])
|
if(argptr && argptr[0])
|
||||||
result = Curl_ssl_set_engine(data, argptr);
|
result = Curl_ssl_set_engine(data, argptr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_SSLENGINE_DEFAULT:
|
case CURLOPT_SSLENGINE_DEFAULT:
|
||||||
@@ -1743,7 +1743,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* performing an operation and thus what from-IP your connection will use.
|
* performing an operation and thus what from-IP your connection will use.
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_DEVICE],
|
result = setstropt(&data->set.str[STRING_DEVICE],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_LOCALPORT:
|
case CURLOPT_LOCALPORT:
|
||||||
/*
|
/*
|
||||||
@@ -1762,7 +1762,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* A string that defines the kerberos security level.
|
* A string that defines the kerberos security level.
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_KRB_LEVEL],
|
result = setstropt(&data->set.str[STRING_KRB_LEVEL],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
data->set.krb = (bool)(NULL != data->set.str[STRING_KRB_LEVEL]);
|
data->set.krb = (bool)(NULL != data->set.str[STRING_KRB_LEVEL]);
|
||||||
break;
|
break;
|
||||||
case CURLOPT_SSL_VERIFYPEER:
|
case CURLOPT_SSL_VERIFYPEER:
|
||||||
@@ -1800,7 +1800,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* Set CA info for SSL connection. Specify file name of the CA certificate
|
* Set CA info for SSL connection. Specify file name of the CA certificate
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_SSL_CAFILE],
|
result = setstropt(&data->set.str[STRING_SSL_CAFILE],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_CAPATH:
|
case CURLOPT_CAPATH:
|
||||||
/*
|
/*
|
||||||
@@ -1809,7 +1809,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
*/
|
*/
|
||||||
/* This does not work on windows. */
|
/* This does not work on windows. */
|
||||||
result = setstropt(&data->set.str[STRING_SSL_CAPATH],
|
result = setstropt(&data->set.str[STRING_SSL_CAPATH],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_CRLFILE:
|
case CURLOPT_CRLFILE:
|
||||||
/*
|
/*
|
||||||
@@ -1856,60 +1856,60 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_SHARE:
|
case CURLOPT_SHARE:
|
||||||
{
|
{
|
||||||
struct Curl_share *set;
|
struct Curl_share *set;
|
||||||
set = va_arg(param, struct Curl_share *);
|
set = va_arg(param, struct Curl_share *);
|
||||||
|
|
||||||
/* disconnect from old share, if any */
|
/* disconnect from old share, if any */
|
||||||
if(data->share) {
|
if(data->share) {
|
||||||
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
||||||
|
|
||||||
if(data->dns.hostcachetype == HCACHE_SHARED) {
|
if(data->dns.hostcachetype == HCACHE_SHARED) {
|
||||||
data->dns.hostcache = NULL;
|
data->dns.hostcache = NULL;
|
||||||
data->dns.hostcachetype = HCACHE_NONE;
|
data->dns.hostcachetype = HCACHE_NONE;
|
||||||
}
|
|
||||||
|
|
||||||
if(data->share->cookies == data->cookies)
|
|
||||||
data->cookies = NULL;
|
|
||||||
|
|
||||||
data->share->dirty--;
|
|
||||||
|
|
||||||
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
|
|
||||||
data->share = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* use new share if it set */
|
if(data->share->cookies == data->cookies)
|
||||||
data->share = set;
|
data->cookies = NULL;
|
||||||
if(data->share) {
|
|
||||||
|
|
||||||
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
data->share->dirty--;
|
||||||
|
|
||||||
data->share->dirty++;
|
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
|
||||||
|
data->share = NULL;
|
||||||
if(data->share->hostcache) {
|
|
||||||
/* use shared host cache, first free the private one if any */
|
|
||||||
if(data->dns.hostcachetype == HCACHE_PRIVATE)
|
|
||||||
Curl_hash_destroy(data->dns.hostcache);
|
|
||||||
|
|
||||||
data->dns.hostcache = data->share->hostcache;
|
|
||||||
data->dns.hostcachetype = HCACHE_SHARED;
|
|
||||||
}
|
|
||||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
|
||||||
if(data->share->cookies) {
|
|
||||||
/* use shared cookie list, first free own one if any */
|
|
||||||
if(data->cookies)
|
|
||||||
Curl_cookie_cleanup(data->cookies);
|
|
||||||
/* enable cookies since we now use a share that uses cookies! */
|
|
||||||
data->cookies = data->share->cookies;
|
|
||||||
}
|
|
||||||
#endif /* CURL_DISABLE_HTTP */
|
|
||||||
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
|
|
||||||
|
|
||||||
}
|
|
||||||
/* check for host cache not needed,
|
|
||||||
* it will be done by curl_easy_perform */
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
/* use new share if it set */
|
||||||
|
data->share = set;
|
||||||
|
if(data->share) {
|
||||||
|
|
||||||
|
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
||||||
|
|
||||||
|
data->share->dirty++;
|
||||||
|
|
||||||
|
if(data->share->hostcache) {
|
||||||
|
/* use shared host cache, first free the private one if any */
|
||||||
|
if(data->dns.hostcachetype == HCACHE_PRIVATE)
|
||||||
|
Curl_hash_destroy(data->dns.hostcache);
|
||||||
|
|
||||||
|
data->dns.hostcache = data->share->hostcache;
|
||||||
|
data->dns.hostcachetype = HCACHE_SHARED;
|
||||||
|
}
|
||||||
|
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
||||||
|
if(data->share->cookies) {
|
||||||
|
/* use shared cookie list, first free own one if any */
|
||||||
|
if(data->cookies)
|
||||||
|
Curl_cookie_cleanup(data->cookies);
|
||||||
|
/* enable cookies since we now use a share that uses cookies! */
|
||||||
|
data->cookies = data->share->cookies;
|
||||||
|
}
|
||||||
|
#endif /* CURL_DISABLE_HTTP */
|
||||||
|
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
|
||||||
|
|
||||||
|
}
|
||||||
|
/* check for host cache not needed,
|
||||||
|
* it will be done by curl_easy_perform */
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case CURLOPT_PROXYTYPE:
|
case CURLOPT_PROXYTYPE:
|
||||||
/*
|
/*
|
||||||
@@ -1965,17 +1965,9 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
data->set.tcp_nodelay = (bool)(0 != va_arg(param, long));
|
data->set.tcp_nodelay = (bool)(0 != va_arg(param, long));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
|
||||||
case CURLOPT_SOURCE_URL:
|
|
||||||
case CURLOPT_SOURCE_USERPWD:
|
|
||||||
case CURLOPT_SOURCE_QUOTE:
|
|
||||||
case CURLOPT_SOURCE_PREQUOTE:
|
|
||||||
case CURLOPT_SOURCE_POSTQUOTE:
|
|
||||||
These former 3rd party transfer options are deprecated */
|
|
||||||
|
|
||||||
case CURLOPT_FTP_ACCOUNT:
|
case CURLOPT_FTP_ACCOUNT:
|
||||||
result = setstropt(&data->set.str[STRING_FTP_ACCOUNT],
|
result = setstropt(&data->set.str[STRING_FTP_ACCOUNT],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_IGNORE_CONTENT_LENGTH:
|
case CURLOPT_IGNORE_CONTENT_LENGTH:
|
||||||
@@ -1991,7 +1983,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
|
|
||||||
case CURLOPT_FTP_ALTERNATIVE_TO_USER:
|
case CURLOPT_FTP_ALTERNATIVE_TO_USER:
|
||||||
result = setstropt(&data->set.str[STRING_FTP_ALTERNATIVE_TO_USER],
|
result = setstropt(&data->set.str[STRING_FTP_ALTERNATIVE_TO_USER],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_SOCKOPTFUNCTION:
|
case CURLOPT_SOCKOPTFUNCTION:
|
||||||
@@ -2036,7 +2028,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* Use this file instead of the $HOME/.ssh/id_dsa.pub file
|
* Use this file instead of the $HOME/.ssh/id_dsa.pub file
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_SSH_PUBLIC_KEY],
|
result = setstropt(&data->set.str[STRING_SSH_PUBLIC_KEY],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_SSH_PRIVATE_KEYFILE:
|
case CURLOPT_SSH_PRIVATE_KEYFILE:
|
||||||
@@ -2044,7 +2036,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* Use this file instead of the $HOME/.ssh/id_dsa file
|
* Use this file instead of the $HOME/.ssh/id_dsa file
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_SSH_PRIVATE_KEY],
|
result = setstropt(&data->set.str[STRING_SSH_PRIVATE_KEY],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
|
case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
|
||||||
/*
|
/*
|
||||||
@@ -2052,7 +2044,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* for validation purposes.
|
* for validation purposes.
|
||||||
*/
|
*/
|
||||||
result = setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5],
|
result = setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5],
|
||||||
va_arg(param, char *));
|
va_arg(param, char *));
|
||||||
break;
|
break;
|
||||||
case CURLOPT_HTTP_TRANSFER_DECODING:
|
case CURLOPT_HTTP_TRANSFER_DECODING:
|
||||||
/*
|
/*
|
||||||
@@ -2086,16 +2078,16 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy
|
* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy
|
||||||
*/
|
*/
|
||||||
switch (va_arg(param, long)) {
|
switch (va_arg(param, long)) {
|
||||||
case 0:
|
case 0:
|
||||||
data->set.proxy_transfer_mode = FALSE;
|
data->set.proxy_transfer_mode = FALSE;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
data->set.proxy_transfer_mode = TRUE;
|
data->set.proxy_transfer_mode = TRUE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* reserve other values for future use */
|
/* reserve other values for future use */
|
||||||
result = CURLE_FAILED_INIT;
|
result = CURLE_FAILED_INIT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -4344,11 +4336,12 @@ static CURLcode setup_conn(struct connectdata *conn,
|
|||||||
set this here perhaps a second time */
|
set this here perhaps a second time */
|
||||||
|
|
||||||
#ifdef __EMX__
|
#ifdef __EMX__
|
||||||
/* 20000330 mgs
|
/*
|
||||||
* the check is quite a hack...
|
* This check is quite a hack. We're calling _fsetmode to fix the problem
|
||||||
* we're calling _fsetmode to fix the problem with fwrite converting newline
|
* with fwrite converting newline characters (you get mangled text files,
|
||||||
* characters (you get mangled text files, and corrupted binary files when
|
* and corrupted binary files when you download to stdout and redirect it to
|
||||||
* you download to stdout and redirect it to a file). */
|
* a file).
|
||||||
|
*/
|
||||||
|
|
||||||
if((data->set.out)->_handle == NULL) {
|
if((data->set.out)->_handle == NULL) {
|
||||||
_fsetmode(stdout, "b");
|
_fsetmode(stdout, "b");
|
||||||
|
|||||||
Reference in New Issue
Block a user