commit | c596327aabfc4262a967c0ccb68cd388d0b9212a | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu May 23 15:42:38 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu May 23 15:42:38 2024 +0000 |
tree | ecd447faddaaef2b7a1dcc20d818e3a8750cf32d | |
parent | c3a6162a0cc3d1a93b75c99fc62af9a0d0b7b626 [diff] | |
parent | 56e077df3503fedd6439f0b949ff9f2bd2d71bca [diff] |
Snap for 11880863 from 56e077df3503fedd6439f0b949ff9f2bd2d71bca to build-tools-release Change-Id: I83453d11f17a0868b8f67c2be0bcbd82a3a37337
A push parser for the HTTP 1.x protocol. Avoids allocations. No copy. Fast.
Works with no_std
, simply disable the std
Cargo feature.
let mut headers = [httparse::EMPTY_HEADER; 64]; let mut req = httparse::Request::new(&mut headers); let buf = b"GET /index.html HTTP/1.1\r\nHost"; assert!(req.parse(buf)?.is_partial()); // a partial request, so we try again once we have more data let buf = b"GET /index.html HTTP/1.1\r\nHost: example.domain\r\n\r\n"; assert!(req.parse(buf)?.is_complete());
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.