diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2022-02-28 12:12:30 +0100 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2022-07-26 16:24:33 +0200 |
commit | 6e36584a2e9bad0e7c4f96d68c527992deadc650 (patch) | |
tree | 927317d737b55d0bdec616d01cd39e10cbcb6f32 /src/nxt_http_route_addr.c | |
parent | c1cea3c97d5dfc260a54cab67b7dc1637a3deb59 (diff) | |
download | unit-6e36584a2e9bad0e7c4f96d68c527992deadc650.tar.gz unit-6e36584a2e9bad0e7c4f96d68c527992deadc650.tar.bz2 |
Supporting UNIX sockets in address matching.
This closes #645 issue on GitHub.
(Also moved a changelog line that was misplaced in a previous commit.)
Diffstat (limited to 'src/nxt_http_route_addr.c')
-rw-r--r-- | src/nxt_http_route_addr.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nxt_http_route_addr.c b/src/nxt_http_route_addr.c index 985fb737..34455af4 100644 --- a/src/nxt_http_route_addr.c +++ b/src/nxt_http_route_addr.c @@ -41,6 +41,16 @@ nxt_http_route_addr_pattern_parse(nxt_mp_t *mp, base->negative = 0; } + if (nxt_str_eq(&addr, "unix", 4)) { +#if (NXT_HAVE_UNIX_DOMAIN) + base->addr_family = AF_UNIX; + + return NXT_OK; +#else + return NXT_ADDR_PATTERN_NO_UNIX_ERROR; +#endif + } + if (nxt_slow_path(addr.length < 2)) { return NXT_ADDR_PATTERN_LENGTH_ERROR; } |