Skip to content

Commit

Permalink
Update API docs for retry. (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaofei0800 authored Nov 17, 2023
1 parent aa04fdf commit d4c1eca
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
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

0 comments on commit d4c1eca

Please sign in to comment.