Skip to content

Commit

Permalink
Clarify usage of rx_buf in HTTP response reading
Browse files Browse the repository at this point in the history
  • Loading branch information
zargony committed Oct 4, 2024
1 parent 76afeaa commit 8ad2dc5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions firmware/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ impl<'a> Http<'a> {
async fn send_request_parse_response<C: Read + Write, B: RequestBody, T: DeserializeOwned>(
request: HttpResourceRequestBuilder<'_, '_, C, B>,
) -> Result<T, Error> {
// rx_buf is used to buffer response headers. The response body reader uses this only for
// non-TLS connections. Body reader of TLS connections will use the TLS read_buffer for
// buffering parts of the body. However, read_to_end will again always use this buffer.
let mut rx_buf = [0; MAX_RESPONSE_SIZE];
let response = request.send(&mut rx_buf).await?;

Expand Down

0 comments on commit 8ad2dc5

Please sign in to comment.