mirror of https://github.com/moparisthebest/curl
lib: fix compiler warnings with CURL_DISABLE_NETRC
warning C4189: 'netrc_user_changed': local variable is initialized but not referenced warning C4189: 'netrc_passwd_changed': local variable is initialized but not referenced Closes #7423
This commit is contained in:
parent
d896184c9b
commit
9a47d77126
|
@ -850,7 +850,9 @@ Curl_http_output_auth(struct Curl_easy *data,
|
||||||
/* To prevent the user+password to get sent to other than the original
|
/* To prevent the user+password to get sent to other than the original
|
||||||
host due to a location-follow, we do some weirdo checks here */
|
host due to a location-follow, we do some weirdo checks here */
|
||||||
if(!data->state.this_is_a_follow ||
|
if(!data->state.this_is_a_follow ||
|
||||||
|
#ifndef CURL_DISABLE_NETRC
|
||||||
conn->bits.netrc ||
|
conn->bits.netrc ||
|
||||||
|
#endif
|
||||||
!data->state.first_host ||
|
!data->state.first_host ||
|
||||||
data->set.allow_auth_to_other_hosts ||
|
data->set.allow_auth_to_other_hosts ||
|
||||||
strcasecompare(data->state.first_host, conn->host.name)) {
|
strcasecompare(data->state.first_host, conn->host.name)) {
|
||||||
|
|
|
@ -2887,11 +2887,13 @@ static CURLcode override_login(struct Curl_easy *data,
|
||||||
char **passwdp = &conn->passwd;
|
char **passwdp = &conn->passwd;
|
||||||
char **optionsp = &conn->options;
|
char **optionsp = &conn->options;
|
||||||
|
|
||||||
|
#ifndef CURL_DISABLE_NETRC
|
||||||
if(data->set.use_netrc == CURL_NETRC_REQUIRED && conn->bits.user_passwd) {
|
if(data->set.use_netrc == CURL_NETRC_REQUIRED && conn->bits.user_passwd) {
|
||||||
Curl_safefree(*userp);
|
Curl_safefree(*userp);
|
||||||
Curl_safefree(*passwdp);
|
Curl_safefree(*passwdp);
|
||||||
conn->bits.user_passwd = FALSE; /* disable user+password */
|
conn->bits.user_passwd = FALSE; /* disable user+password */
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(data->set.str[STRING_OPTIONS]) {
|
if(data->set.str[STRING_OPTIONS]) {
|
||||||
free(*optionsp);
|
free(*optionsp);
|
||||||
|
@ -2900,6 +2902,7 @@ static CURLcode override_login(struct Curl_easy *data,
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef CURL_DISABLE_NETRC
|
||||||
conn->bits.netrc = FALSE;
|
conn->bits.netrc = FALSE;
|
||||||
if(data->set.use_netrc && !data->set.str[STRING_USERNAME]) {
|
if(data->set.use_netrc && !data->set.str[STRING_USERNAME]) {
|
||||||
bool netrc_user_changed = FALSE;
|
bool netrc_user_changed = FALSE;
|
||||||
|
@ -2925,6 +2928,7 @@ static CURLcode override_login(struct Curl_easy *data,
|
||||||
conn->bits.user_passwd = TRUE; /* enable user+password */
|
conn->bits.user_passwd = TRUE; /* enable user+password */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* for updated strings, we update them in the URL */
|
/* for updated strings, we update them in the URL */
|
||||||
if(*userp) {
|
if(*userp) {
|
||||||
|
|
|
@ -508,7 +508,9 @@ struct ConnectBits {
|
||||||
BIT(ftp_use_data_ssl); /* Enabled SSL for the data connection */
|
BIT(ftp_use_data_ssl); /* Enabled SSL for the data connection */
|
||||||
BIT(ftp_use_control_ssl); /* Enabled SSL for the control connection */
|
BIT(ftp_use_control_ssl); /* Enabled SSL for the control connection */
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef CURL_DISABLE_NETRC
|
||||||
BIT(netrc); /* name+password provided by netrc */
|
BIT(netrc); /* name+password provided by netrc */
|
||||||
|
#endif
|
||||||
BIT(bound); /* set true if bind() has already been done on this socket/
|
BIT(bound); /* set true if bind() has already been done on this socket/
|
||||||
connection */
|
connection */
|
||||||
BIT(multiplex); /* connection is multiplexed */
|
BIT(multiplex); /* connection is multiplexed */
|
||||||
|
@ -1727,8 +1729,10 @@ struct UserDefined {
|
||||||
*/
|
*/
|
||||||
curl_sshkeycallback ssh_keyfunc; /* key matching callback */
|
curl_sshkeycallback ssh_keyfunc; /* key matching callback */
|
||||||
void *ssh_keyfunc_userp; /* custom pointer to callback */
|
void *ssh_keyfunc_userp; /* custom pointer to callback */
|
||||||
|
#ifndef CURL_DISABLE_NETRC
|
||||||
enum CURL_NETRC_OPTION
|
enum CURL_NETRC_OPTION
|
||||||
use_netrc; /* defined in include/curl.h */
|
use_netrc; /* defined in include/curl.h */
|
||||||
|
#endif
|
||||||
curl_usessl use_ssl; /* if AUTH TLS is to be attempted etc, for FTP or
|
curl_usessl use_ssl; /* if AUTH TLS is to be attempted etc, for FTP or
|
||||||
IMAP or POP3 or others! */
|
IMAP or POP3 or others! */
|
||||||
long new_file_perms; /* Permissions to use when creating remote files */
|
long new_file_perms; /* Permissions to use when creating remote files */
|
||||||
|
|
Loading…
Reference in New Issue