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

Update API docs for retry. #37

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/tquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void quic_config_enable_stateless_reset(struct quic_config_t *config, bool enabl
void quic_config_set_address_token_lifetime(struct quic_config_t *config, uint64_t seconds);

/**
* Set the key for address token generation. It also enables retry.
* Set the key for address token generation.
* The token_key_len should be a multiple of 16.
*/
int quic_config_set_address_token_key(struct quic_config_t *config,
Expand Down
2 changes: 1 addition & 1 deletion src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ pub extern "C" fn quic_config_set_address_token_lifetime(config: &mut Config, se
config.set_address_token_lifetime(seconds);
}

/// Set the key for address token generation. It also enables retry.
/// Set the key for address token generation.
/// The token_key_len should be a multiple of 16.
#[no_mangle]
pub extern "C" fn quic_config_set_address_token_key(
Expand Down
11 changes: 10 additions & 1 deletion website/docs/api_reference/c_quic.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,19 @@ int quic_config_set_address_token_key(struct quic_config_t *config,
const uint8_t *token_keys,
size_t token_keys_len);
```
* Set the key for address token generation. It also enables retry.
* Set the key for address token generation.
The `token_key_len` should be a multiple of 16.


#### quic_config_enable_retry
```c
void quic_config_enable_retry(struct quic_config_t *config,
bool enabled);
```
* Set whether stateless retry is allowed.
* Default is not allowed.


#### quic_config_set_cid_len
```c
void quic_config_set_cid_len(struct quic_config_t *config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,19 @@ int quic_config_set_address_token_key(struct quic_config_t *config,
const uint8_t *token_keys,
size_t token_keys_len);
```
* 设置生成地址令牌的密钥。设置后会同时启用Retry机制。
* 设置生成地址令牌的密钥。
参数`token_key_len`应该是16的倍数。


#### quic_config_enable_retry
```c
void quic_config_enable_retry(struct quic_config_t *config,
bool enabled);
```
* 设置是否启用Retry机制。
* 默认禁用。


#### quic_config_set_cid_len
```c
void quic_config_set_cid_len(struct quic_config_t *config,
Expand Down