Skip to content

Commit

Permalink
ffi: add quiche_h3_send_goaway
Browse files Browse the repository at this point in the history
  • Loading branch information
LPardue authored and ghedo committed Oct 12, 2023
1 parent a97f096 commit 46f9e0c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions quiche/include/quiche.h
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,10 @@ ssize_t quiche_h3_send_body(quiche_h3_conn *conn, quiche_conn *quic_conn,
ssize_t quiche_h3_recv_body(quiche_h3_conn *conn, quiche_conn *quic_conn,
uint64_t stream_id, uint8_t *out, size_t out_len);

// Sends a GOAWAY frame to initiate graceful connection closure.
int quiche_h3_send_goaway(quiche_h3_conn *conn, quiche_conn *quic_conn,
uint64_t id);

// Try to parse an Extensible Priority field value.
int quiche_h3_parse_extensible_priority(uint8_t *priority,
size_t priority_len,
Expand Down
11 changes: 11 additions & 0 deletions quiche/src/h3/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,17 @@ pub extern fn quiche_h3_recv_body(
}
}

#[no_mangle]
pub extern fn quiche_h3_send_goaway(
conn: &mut h3::Connection, quic_conn: &mut Connection, id: u64,
) -> c_int {
match conn.send_goaway(quic_conn, id) {
Ok(()) => 0,

Err(e) => e.to_c() as c_int,
}
}

#[no_mangle]
#[cfg(feature = "sfv")]
pub extern fn quiche_h3_parse_extensible_priority(
Expand Down

0 comments on commit 46f9e0c

Please sign in to comment.