-
Notifications
You must be signed in to change notification settings - Fork 76
add ngx::core::resolver, which provides async name resolution #197
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
base: main
Are you sure you want to change the base?
Conversation
For the record, I already raised 3-4 during the review for acme, and we decided to defer it until the ngx-rust PR. |
08fd958
to
4becb06
Compare
Thanks, implemented 1, 2, and 4.
Its not obvious to me where these two heap allocations are that we can avoid with proper pinning, and I don't see where it was discussed in the closed PRs. If we're going to tear out the channel, the most obvious improvement to me would be to handle the |
And one more heap allocation is in the resulting
Oh. Right, we consume the |
enforced by workspace level lints, now specified in each Cargo.toml, except nginx-sys, because bindgen can't be set to Edition2024 until MSRV hits 1.85 this change set is created automatically by `cargo fix --edition --all`, then with manual fixes afterwards: * Back out any use of unsafe(no_mangle) for plain no_mangle, since 1.81 wont accept it * remove uses of expr_2021 in macros, which is not available in the MSRV. * Manual fix to ngx_container_of! macro for safety rules in 2024, these weren't migrated automatically by `cargo fix` * Manual fixes to several other macros that created an &mut Request in an expression, Rust 2024 is stricter about taking &mut of temporaries, so instead the request is let-bound first.
4becb06
to
0205d33
Compare
Added behind the async feature, and adds the futures-channel dep to to the deps enabled by async. This PR is an upstreaming of nginx-acme::net::resolver, see: https://github.com/nginx/nginx-acme/blob/main/src/net/resolver.rs Co-authored-by: Evgeny Shirykalov <[email protected]>
0205d33
to
6ce390b
Compare
Feedback addressed, I rewrote it as a Future by hand. It still requires one Box because Pin::new requires the inner to have Deref. Tests exist in another repo where @bavshin-f5 can see them. I can port tests to this repo once #198 lands as a basis, but that PR is stuck on an unrelated issue. I will squash this down once feedback is complete. |
b9bef62
to
75add6c
Compare
Based on #200
Added behind its own feature flag, because it incurs two extra deps (thiserror and futures-channel) on top of the async feature set.
This PR is an upstreaming of nginx-acme::net::resolver, see: https://github.com/nginx/nginx-acme/blob/main/src/net/resolver.rs
There are no examples or tests for this module at this time.
Checklist
Before creating a PR, run through this checklist and mark each as complete.