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

ffi: add functions to deal with sliced strings (fix #1909) #1913

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ichordev
Copy link
Contributor

Adds *_sliced variants of the following functions that accept an additional length parameter for strings instead of using null-termination:

  • quiche_version_sliced
  • quiche_enable_debug_logging_sliced
  • quiche_config_load_cert_chain_from_pem_file_sliced
  • quiche_config_load_priv_key_from_pem_file_sliced
  • quiche_config_load_verify_locations_from_file_sliced
  • quiche_config_load_verify_locations_from_directory_sliced
  • quiche_config_set_cc_algorithm_name_sliced
  • quiche_connect_sliced
  • quiche_conn_set_keylog_path_sliced
  • quiche_conn_set_qlog_path_sliced
  • quiche_conn_set_qlog_fd_sliced

This fixes issue #1909.
I'm not very experienced with Rust, so please double-check that I didn't do anything wrong in ffi.rs. I'm using std::str::from_utf8_unchecked to create the str& in Rust so that there's no runtime overhead for checking UTF-8 validity.

@ichordev ichordev requested a review from a team as a code owner January 17, 2025 13:09
@ichordev
Copy link
Contributor Author

Is this check failing because of mis-formatting?

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.

1 participant