Skip to content
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

feat: (2 of 2) Upstream module example #37

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

f5yacobucci
Copy link
Contributor

@f5yacobucci f5yacobucci commented Jul 6, 2023

Upstream example

  • derived from github.com/gabihodoroaga/nginx-upstream-module and NGINX ngx_http_upstream_keepalive_module.c

Simply replaces peer functions with passthrough versions, i.e., proxies
traffic through this module to originally configured upstream functions.

Useful as a guide and example, but does not add load balancing
algorithms.

Fixes #30 (replaces PR #35)

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • [X ] I have written my commit messages in the Conventional Commits format.
  • [X ] I have read the CONTRIBUTING doc
  • [X ] I have added tests (when possible) that prove my fix is effective or that my feature works
  • [X ] I have checked that all unit tests pass after adding my changes
  • [X ] I have updated necessary documentation
  • [X ] I have rebased my branch onto master
  • [X ] I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

}
let hccf = maybe_conf.unwrap();
// NOTE: ngx_conf_init_uint_value macro is unavailable
if (*hccf).max == u32::MAX {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: may be do a dereference here and then you don't need to do (*hccf)/(*us)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you suggesting something like:
let hccf = *(maybe_conf.unwrap());

or something different that i'm not understanding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was looking at the Deref trait, but doesn't seem appropriate here unless i'm missing something more.

Matthew Yacobucci added 2 commits September 1, 2023 12:10
Upstream example

- derived from github.com/gabihodoroaga/nginx-upstream-module and NGINX ngx_http_upstream_keepalive_module.c

Simply replaces peer functions with passthrough versions, i.e., proxies
traffic through this module to originally configured upstream functions.

Useful as a guide and example, but does not add load balancing
algorithms.
@f5yacobucci f5yacobucci merged commit 840d789 into nginx:master Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Examples on upstream/loadbalancer modules
2 participants