if netrc is parsed and our host was found in there, set data->bits.user_passwd

unconditioanlly!
This commit is contained in:
Daniel Stenberg 2001-02-08 13:53:13 +00:00
parent 7e36c4437e
commit b12e334d83

View File

@ -1086,15 +1086,15 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
infof(data, "Couldn't find host %s in the .netrc file, using defaults", infof(data, "Couldn't find host %s in the .netrc file, using defaults",
data->hostname); data->hostname);
} }
else
data->bits.user_passwd = 1; /* enable user+password */
/* weather we failed or not, we don't know which fields that were filled /* weather we failed or not, we don't know which fields that were filled
in anyway */ in anyway */
if(!data->user[0]) if(!data->user[0])
strcpy(data->user, CURL_DEFAULT_USER); strcpy(data->user, CURL_DEFAULT_USER);
if(!data->passwd[0]) if(!data->passwd[0])
strcpy(data->passwd, CURL_DEFAULT_PASSWORD); strcpy(data->passwd, CURL_DEFAULT_PASSWORD);
if(conn->protocol&PROT_HTTP) {
data->bits.user_passwd = 1; /* enable user+password */
}
} }
else if(!(data->bits.user_passwd) && else if(!(data->bits.user_passwd) &&
(conn->protocol & (PROT_FTP|PROT_HTTP)) ) { (conn->protocol & (PROT_FTP|PROT_HTTP)) ) {