-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supporting UNIX sockets in address matching. #655
Conversation
Simplified it to support any unix socket, by specifying the string |
src/nxt_http_route_addr.c
Outdated
@@ -47,6 +47,16 @@ nxt_http_route_addr_pattern_parse(nxt_mp_t *mp, | |||
|
|||
nxt_str_null(&port); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nulling port variable has no sense in case of "unix" socket. This should be after the "unix" socket condition, not before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to move "unix" socket condition also above the addr.length < 2
check. Because that check is directly related to the following condition with addr.start[0] == '*' && addr.start[1] == ':'
. Keeping them together makes code self-explainable about why length should be not less than 2.
You also need to add a feature to |
Done. I still need to add a pytest. |
docs/changes.xml
Outdated
@@ -37,6 +37,12 @@ compatibility with GCC 12. | |||
</para> | |||
</change> | |||
|
|||
<change type="feature"> | |||
<para> | |||
supporting UNIX sockets in address matching |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dot at the end of sentence is missing.
Also I usually try to estimate subjectively the amount of users affected or importance of the feature/fix for them and sort relatively to that estimation. In this case, this feature seems more important than support for a not-yet-released compiler version (so it should go above).
Also 2, it makes sense to consult with Artem about the best wording. Commit log for devs, change log for users. The current wording is good enough, but I have some doubts that many users will understand what "address matching" is meant here. Maybe it's worth to describe specifically, that this is about address matching in routing and "client_ip" options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dot at the end of sentence is missing.
D'oh.
Also I usually try to estimate subjectively the amount of users affected or importance of the feature/fix for them and sort relatively to that estimation. In this case, this feature seems more important than support for a not-yet-released compiler version (so it should go above).
Makes sense.
Also 2, it makes sense to consult with Artem about the best wording. Commit log for devs, change log for users. The current wording is good enough, but I have some doubts that many users will understand what "address matching" is meant here. Maybe it's worth to describe specifically, that this is about address matching in routing and "client_ip" options.
Yes, and yes, I'll add those details regarding client_ip.
I'm getting EACCESS from unlink(2) :( |
I broke the patch I added yesterday for unlinking sockets to a new separate PR. |
This closes #645 issue on GitHub. (Also moved a changelog line that was misplaced in a previous commit.)
No description provided.