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

docs: clarify freeing client/server builder directly #443

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

cpu
Copy link
Member

@cpu cpu commented Jul 19, 2024

Previously the docs for the rustls_client_config_builder and rustls_server_config_builder structs seemed to imply the only safe way to dispose of a builder was to build it, and then free the resulting config (e.g. this is a pattern curl uses for its rustls-ffi integration ). It's also possible (and clearer for most error-handling paths) to free the builder directly.

This commit updates the relevant docs to make this alternative option clearer.

@cpu cpu self-assigned this Jul 19, 2024
@cpu cpu force-pushed the cpu-better-builder-free-docs branch from c6ba94d to 22da4e1 Compare July 19, 2024 16:47
@cpu
Copy link
Member Author

cpu commented Jul 19, 2024

rustls-ffi / Clippy nightly (optional) (pull_request) Failing after 19s

I looked at fixing this one but the simple fix (renaming the allow) is mutually exclusive with the non-nightly clippy task. For now it seems better to allow the optional nightly job to fail and the required non-nightly to use the old name in its allow.

@cpu
Copy link
Member Author

cpu commented Jul 19, 2024

For now it seems better to allow the optional nightly job to fail and the required non-nightly to use the old name in its allow.

Here's one alternative to consider: #444

@cpu cpu requested a review from ctz July 29, 2024 13:17
src/client.rs Outdated Show resolved Hide resolved
cpu added 2 commits July 29, 2024 09:52
Previously the docs for the `rustls_client_config_builder` and
`rustls_server_config_builder` structs seemed to imply the only safe way
to dispose of a builder was to build it, and then free the resulting
config. It's also possible (and clearer for most error-handling paths)
to free the builder directly.

This commit updates the relevant docs to make this alternative option
clearer.
Small readability tweaks to the comments that were updated in the
previous commit to add some whitespace. Also fixes some parameter names
that were referenced in `rustls_client_config_builder_new_custom` with
the incorrect name.
@cpu cpu force-pushed the cpu-better-builder-free-docs branch from 22da4e1 to b3563a0 Compare July 29, 2024 13:59
@cpu cpu merged commit 554382d into rustls:main Jul 29, 2024
25 checks passed
@cpu cpu deleted the cpu-better-builder-free-docs branch July 29, 2024 14:03
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.

2 participants