diff options
author | rofl0r <rofl0r@users.noreply.github.com> | 2020-08-19 12:01:20 +0100 |
---|---|---|
committer | rofl0r <rofl0r@users.noreply.github.com> | 2020-08-19 12:01:20 +0100 |
commit | 335477b16e8926a51d35d94789906397524eb7bb (patch) | |
tree | 41f4026f088ef344010433f05b77f23b429776b8 /src/upstream.c | |
parent | 5ba958829f73ecc02658a46f5b1bba5ffed2281d (diff) |
upstream: allow port 0 to be specified
this is useful to use upstream directive to null-route a specific target
domain.
e.g.
upstream http 0.0.0.0:0 ".adserver.com"
Diffstat (limited to 'src/upstream.c')
-rw-r--r-- | src/upstream.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/upstream.c b/src/upstream.c index 327b727..321b282 100644 --- a/src/upstream.c +++ b/src/upstream.c @@ -123,7 +123,7 @@ static struct upstream *upstream_build (const char *host, int port, const char * log_message (LOG_INFO, "Added no-upstream for %s", domain); } else { - if (!host || host[0] == '\0' || port < 1 || !domain + if (!host || host[0] == '\0' || !domain || domain[0] == '\0') { log_message (LOG_WARNING, "Nonsense upstream rule: invalid parameters"); @@ -234,7 +234,7 @@ struct upstream *upstream_get (char *host, struct upstream *up) up = up->next; } - if (up && (!up->host || !up->port)) + if (up && (!up->host)) up = NULL; if (up) |