Renamed upstream_bauth_add -> upstream_add

This commit is contained in:
Valen Blanco 2016-10-07 11:57:50 +02:00
parent 14eae55fef
commit 066b2d5ede
3 changed files with 10 additions and 24 deletions

View File

@ -1090,13 +1090,12 @@ static HANDLE_FUNC (handle_upstream)
if (match[12].rm_so != -1) {
domain = get_string_arg (line, &match[12]);
if (domain) {
upstream_bauth_add (ip, port, basic_auth, domain,
upstream_add (ip, port, basic_auth, domain,
&conf->upstream_list);
safefree (domain);
}
} else {
upstream_bauth_add (ip, port, basic_auth, NULL,
&conf->upstream_list);
upstream_add (ip, port, basic_auth, NULL, &conf->upstream_list);
}
safefree (basic_auth);
@ -1113,7 +1112,7 @@ static HANDLE_FUNC (handle_upstream_no)
if (!domain)
return -1;
upstream_add (NULL, 0, domain, &conf->upstream_list);
upstream_add (NULL, 0, NULL, domain, &conf->upstream_list);
safefree (domain);
return 0;

View File

@ -30,8 +30,7 @@
#ifdef UPSTREAM_SUPPORT
/**
* Construct an upstream struct from input data, with basic auth credentials.
* 'basic_auth' can be NULL.
* Construct an upstream struct from input data.
*/
static struct upstream *upstream_build (const char *host, int port,
const char *basic_auth,
@ -126,10 +125,9 @@ fail:
}
/*
* Add an entry to the upstream list, with basic auth credentials.
* 'basic_auth' can be NULL.
* Add an entry to the upstream list.
*/
void upstream_bauth_add (const char *host, int port, const char *basic_auth,
void upstream_add (const char *host, int port, const char *basic_auth,
const char *domain, struct upstream **upstream_list)
{
struct upstream *up;
@ -173,15 +171,6 @@ upstream_cleanup:
return;
}
/*
* Add an entry to the upstream list
*/
void upstream_add (const char *host, int port, const char *domain,
struct upstream **upstream_list)
{
upstream_bauth_add (host, port, NULL, domain, upstream_list);
}
/*
* Check if a host is in the upstream list
*/

View File

@ -41,9 +41,7 @@ struct upstream {
};
#ifdef UPSTREAM_SUPPORT
extern void upstream_add (const char *host, int port, const char *domain,
struct upstream **upstream_list);
extern void upstream_bauth_add (const char *host, int port,
extern void upstream_add (const char *host, int port,
const char *basic_auth, const char *domain,
struct upstream **upstream_list);
extern struct upstream *upstream_get (char *host, struct upstream *up);