| @@ -5,7 +5,7 @@ |
| 5 | 5 | //! buffer holding several pipelined requests or many small chunks is never |
| 6 | 6 | //! copied per item (`std/http` slices what it keeps). |
| 7 | 7 | //! |
| 8 | | −//! The parsing is plain Rust over `&[u8]` ([`parse_head`], [`parse_chunk`], |
| 8 | +//! The parsing is plain Rust over `&[u8]` (`parse_head`, `parse_chunk`, |
| 9 | 9 | //! unit-tested below). The externs only turn its result into `std/http`'s |
| 10 | 10 | //! `Head` and `Chunk` values, whose constructor order the `HEAD_*` and |
| 11 | 11 | //! `CHUNK_*` constants follow. |
| @@ -158,10 +158,11 @@ unsafe fn offset(at: Value) -> usize { |
| 158 | 158 | usize::try_from(unsafe { saturating(at) }).unwrap_or(0) |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | | −/// `parse_head(buffer, at)` (`std/http`): [`parse_head`] as a `Head`: |
| 162 | | −/// `Partial`, `Invalid(reason)`, or `Complete(method, path, version, |
| 163 | | −/// headers, end, content_length)`, where `content_length` is -1 when |
| 164 | | −/// absent. Header values that are not UTF-8 have invalid bytes replaced. |
| 161 | +/// `parse_head(buffer, at)` (`std/http`): the Rust `parse_head` as a |
| 162 | +/// `Head`: `Partial`, `Invalid(reason)`, or `Complete(method, path, |
| 163 | +/// version, headers, end, content_length)`, where `content_length` is -1 |
| 164 | +/// when absent. Header values that are not UTF-8 have invalid bytes |
| 165 | +/// replaced. |
| 165 | 166 | /// |
| 166 | 167 | /// # Safety |
| 167 | 168 | /// `buffer` must be live `Bytes`; `at` a live `Int`. |
| @@ -196,9 +197,9 @@ pub unsafe extern "C" fn tl_http_parse_request(ctx: *mut Ctx, buffer: Value, at: |
| 196 | 197 | } |
| 197 | 198 | } |
| 198 | 199 | |
| 199 | | −/// `parse_chunk(buffer, at)` (`std/http`): [`parse_chunk`] as a `Chunk`: |
| 200 | | −/// `ChunkPartial`, `ChunkInvalid(reason)`, `ChunkData(start, size)` or |
| 201 | | −/// `ChunkEnd(end)`. |
| 200 | +/// `parse_chunk(buffer, at)` (`std/http`): the Rust `parse_chunk` as a |
| 201 | +/// `Chunk`: `ChunkPartial`, `ChunkInvalid(reason)`, `ChunkData(start, |
| 202 | +/// size)` or `ChunkEnd(end)`. |
| 202 | 203 | /// |
| 203 | 204 | /// # Safety |
| 204 | 205 | /// `buffer` must be live `Bytes`; `at` a live `Int`. |