Supporting UNIX sockets in address matching.
This closes #645 issue on GitHub. (Also moved a changelog line that was misplaced in a previous commit.)
This commit is contained in:
@@ -31,6 +31,12 @@ NGINX Unit updated to 1.28.0.
|
|||||||
date="" time=""
|
date="" time=""
|
||||||
packager="Nginx Packaging <nginx-packaging@f5.com>">
|
packager="Nginx Packaging <nginx-packaging@f5.com>">
|
||||||
|
|
||||||
|
<change type="feature">
|
||||||
|
<para>
|
||||||
|
supporting UNIX sockets in address matching.
|
||||||
|
</para>
|
||||||
|
</change>
|
||||||
|
|
||||||
<change type="feature">
|
<change type="feature">
|
||||||
<para>
|
<para>
|
||||||
forwarded header to replace client address and protocol.
|
forwarded header to replace client address and protocol.
|
||||||
@@ -49,6 +55,12 @@ more http variables support.
|
|||||||
</para>
|
</para>
|
||||||
</change>
|
</change>
|
||||||
|
|
||||||
|
<change type="feature">
|
||||||
|
<para>
|
||||||
|
added a new variable, $dollar, that translates to a literal "$" during
|
||||||
|
</para>
|
||||||
|
</change>
|
||||||
|
|
||||||
<change type="bugfix">
|
<change type="bugfix">
|
||||||
<para>
|
<para>
|
||||||
an index file that didn't contain a file extension was incorrectly
|
an index file that didn't contain a file extension was incorrectly
|
||||||
@@ -62,13 +74,6 @@ increased the applications' startup timeout.
|
|||||||
</para>
|
</para>
|
||||||
</change>
|
</change>
|
||||||
|
|
||||||
<change type="feature">
|
|
||||||
<para>
|
|
||||||
added a new variable, $dollar, that translates to a literal "$" during
|
|
||||||
variable substitution.
|
|
||||||
</para>
|
|
||||||
</change>
|
|
||||||
|
|
||||||
</changes>
|
</changes>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2157,6 +2157,11 @@ nxt_conf_vldt_match_addr(nxt_conf_validation_t *vldt,
|
|||||||
return nxt_conf_vldt_error(vldt, "The \"address\" does not support "
|
return nxt_conf_vldt_error(vldt, "The \"address\" does not support "
|
||||||
"IPv6 with your configuration.");
|
"IPv6 with your configuration.");
|
||||||
|
|
||||||
|
case NXT_ADDR_PATTERN_NO_UNIX_ERROR:
|
||||||
|
return nxt_conf_vldt_error(vldt, "The \"address\" does not support "
|
||||||
|
"UNIX domain sockets with your "
|
||||||
|
"configuration.");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nxt_conf_vldt_error(vldt, "The \"address\" has an unknown "
|
return nxt_conf_vldt_error(vldt, "The \"address\" has an unknown "
|
||||||
"format.");
|
"format.");
|
||||||
|
|||||||
@@ -1818,6 +1818,13 @@ nxt_http_route_addr_pattern_match(nxt_http_route_addr_pattern_t *p,
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (NXT_HAVE_UNIX_DOMAIN)
|
||||||
|
case AF_UNIX:
|
||||||
|
|
||||||
|
match = (base->addr_family == AF_UNIX);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
match = 0;
|
match = 0;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -41,6 +41,16 @@ nxt_http_route_addr_pattern_parse(nxt_mp_t *mp,
|
|||||||
base->negative = 0;
|
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)) {
|
if (nxt_slow_path(addr.length < 2)) {
|
||||||
return NXT_ADDR_PATTERN_LENGTH_ERROR;
|
return NXT_ADDR_PATTERN_LENGTH_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ enum {
|
|||||||
NXT_ADDR_PATTERN_RANGE_OVERLAP_ERROR,
|
NXT_ADDR_PATTERN_RANGE_OVERLAP_ERROR,
|
||||||
NXT_ADDR_PATTERN_CIDR_ERROR,
|
NXT_ADDR_PATTERN_CIDR_ERROR,
|
||||||
NXT_ADDR_PATTERN_NO_IPv6_ERROR,
|
NXT_ADDR_PATTERN_NO_IPv6_ERROR,
|
||||||
|
NXT_ADDR_PATTERN_NO_UNIX_ERROR,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user