Skip to content

Commit

Permalink
feat: Add a stub for downstream_client_h2_fingerprint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Champion committed Jun 18, 2023
1 parent 09e4f1b commit 9617535
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/compute-at-edge-abi/compute-at-edge.witx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@
(result $err (expected $num_bytes (error $fastly_status)))
)

(@interface func (export "downstream_client_h2_fingerprint")
(param $h2fp_out (@witx pointer (@witx char8)))
(param $h2fp_max_len (@witx usize))
(param $nwritten_out (@witx pointer (@witx usize)))
(result $err (expected (error $fastly_status)))
)

(@interface func (export "downstream_client_request_id")
(param $reqid_out (@witx pointer (@witx char8)))
(param $reqid_max_len (@witx usize))
Expand Down
6 changes: 6 additions & 0 deletions lib/src/linking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ fn link_legacy_aliases(linker: &mut Linker<WasmCtx>) -> Result<(), Error> {
"env",
"xqd_req_downstream_client_ip_addr",
)?;
linker.alias(
req,
"downstream_client_h2_fingerprint",
"env",
"xqd_req_downstream_client_h2_fingerprint",
)?;
linker.alias(
req,
"downstream_client_request_id",
Expand Down
10 changes: 10 additions & 0 deletions lib/src/wiggle_abi/req_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ impl FastlyHttpReq for Session {
}
}

#[allow(unused_variables)] // FIXME JDC 2023-06-18: Remove this directive once implemented.
fn downstream_client_h2_fingerprint<'a>(
&mut self,
h2fp_out: &GuestPtr<'a, u8>,
h2fp_max_len: u32,
nwritten_out: &GuestPtr<u32>,
) -> Result<(), Error> {
Err(Error::NotAvailable("Client H2 fingerprint"))
}

#[allow(unused_variables)] // FIXME FGS 2023-06-14: Remove this directive once implemented.
fn downstream_client_request_id(
&mut self,
Expand Down

0 comments on commit 9617535

Please sign in to comment.