Commit Graph

622 Commits

Author SHA1 Message Date
Anthony Ramine
556447c130 Make use of NLL to clean up handshaking logic (#576) 2022-01-26 11:18:28 +01:00
Sean McArthur
7de2ccc1a3 fix panic when receiving already reset push promise (#597)
Found by oss-fuzz
2022-01-21 15:41:39 -08:00
Anthony Ramine
a28a39ca4a Update tracing-subscriber and use tracing-tree when testing (#586)
This makes reading the logs way easier on the eyes.
2022-01-21 10:59:11 -08:00
Anthony Ramine
d92ba1c45b Make SendStream::poll_capacity never return Ok(Some(0)) (#596)
Fixes #270
2022-01-19 10:49:53 -08:00
Sean McArthur
b949d6ef99 v0.3.10 2022-01-06 17:09:42 -08:00
Sean McArthur
6336cc3d7b Add Error::is_go_away() and Error::is_remote() 2022-01-06 15:53:38 -08:00
Sean McArthur
c876dda6d0 Fix panic when receiving malformed push promise with stream id 0 2021-12-09 15:27:36 -08:00
Sean McArthur
308663e71e v0.3.9 2021-12-09 09:29:24 -08:00
Sean McArthur
a5c60b24de Fix poll_capacity to wake in combination with max_send_buffer_size 2021-12-09 09:20:01 -08:00
Sean McArthur
88037ae0ab v0.3.8 2021-12-08 11:20:56 -08:00
Sean McArthur
efa113bac6 Add max send buffer per stream option (#580) 2021-12-08 10:03:15 -08:00
Anthony Ramine
e9e0f27b80 Add test that would make wait_for_capacity hang if it doesn't loop 2021-12-02 11:52:15 -08:00
Anthony Ramine
87969c1f29 Implement the extended CONNECT protocol from RFC 8441 (#565) 2021-11-24 10:05:10 +01:00
Sean McArthur
dbaa3a4285 fix: properly reject prioritized HEADERS with stream ID of zero 2021-11-23 10:32:45 -08:00
Sean McArthur
ce81583cf1 v0.3.7 2021-10-22 10:49:46 -07:00
Sean McArthur
405972739b Fix panic if remote causes local to reset a stream before opening 2021-10-22 09:47:30 -07:00
Anthony Ramine
f52d5e6290 Replace HTTP/2.0 by HTTP/2 😅
The protocol is named HTTP/2.
2021-10-20 11:10:25 -07:00
Anthony Ramine
c38c94cb16 Make :status in requests be a stream error 2021-10-19 11:02:44 -07:00
Sean McArthur
8520f06f93 v0.3.6 2021-09-30 12:18:30 -07:00
Sean McArthur
fc73fc987f fix: user created Error would not return provided Reason 2021-09-30 11:26:28 -07:00
Sean McArthur
44cb57c9d9 tests: add explicit SendResponse::send_reset test 2021-09-30 11:26:28 -07:00
Sean McArthur
953112944a v0.3.5 2021-09-29 13:40:13 -07:00
Anthony Ramine
508bcb1d27 Store buffered data size as usize (fixes #269) (#542) 2021-09-28 09:05:06 -07:00
Anthony Ramine
465f0337f8 Refactor errors internals (#556)
h2::Error now knows whether protocol errors happened because the user
sent them, because it was received from the remote peer, or because
the library itself emitted an error because it detected a protocol
violation.

It also keeps track of whether it came from a RST_STREAM or GO_AWAY
frame, and in the case of the latter, it includes the additional
debug data if any.

Fixes #530
2021-09-28 09:04:35 -07:00
David Korczynski
cab307d2ed fuzzing: fix build 2021-09-24 13:40:41 -07:00
Anthony Ramine
96d9277454 Remove code that was made obsolete by #555 2021-09-13 12:19:11 -07:00
Anthony Ramine
61b4f8fc34 Support very large headers
This completely refactors how headers are hpack-encoded.

Instead of trying to be clever, constructing frames on the go
while hpack-encoding, we just make a blob of all the
hpack-encoded headers first, and then we split that blob
in as many frames as necessary.
2021-09-08 10:20:30 -07:00
Alex Touchet
e9a13700cb Update version number in Readme (#549) 2021-09-08 09:44:22 +02:00
Sean McArthur
5072292320 v0.3.4 2021-08-20 15:47:50 -07:00
Sean McArthur
ab6f148ee1 Fix potential hang if extensions contain same StreamRef
If a user stored a `StreamRef` to the same stream in the request or
response extensions, they would be dropped while the internal store lock
was held. That would lead to a deadlock, since dropping a stream ref
will try to take the store lock to clean up.

Clear extensions of Request and Response before locking store, prevent
this.

Fixes hyperium/hyper#2621
2021-08-20 14:44:08 -07:00
Sean McArthur
288a5f086f remove unused macro_escape attribute 2021-07-21 07:57:41 -07:00
Sean McArthur
b66f3aea99 fuzz: fix e2e MockIo reading too much for the buffer 2021-07-21 07:57:41 -07:00
Anthony Ramine
47d107aa17 Wake up connection when dropping SendRequest (#538)
Fixes #502
2021-05-06 11:57:44 -07:00
Anthony Ramine
fea3ae6ca9 Read body in the example server (#544)
Co-authored-by: Kornel Lesiński <kornel@cloudflare.com>
2021-05-06 20:42:29 +02:00
Anthony Ramine
5c72713e2a Remove panic (fixes #395) (#541)
I don't even understand why that should panic, what's wrong with values
greater than 0x0fff_ffff? If we truly wish to avoid very large dynamic
tables, we should do so when we get the large SETTINGS_HEADER_TABLE_SIZE
value, not when encoding it.
2021-05-06 06:26:01 -07:00
boxdot
04570652b7 Do not use Instant::now when zero reset streams are configured. (#537)
This allows to use `h2` on wasm platforms which lack an
`Instant::now` implementation by setting the number of streams to
0 with: `h2::client::Builder::max_concurrent_reset_streams`.
2021-05-05 09:28:45 -07:00
Anthony Ramine
361de985a0 Enable all features on docs.rs (fixes #437) 2021-05-05 08:09:59 -07:00
Jason Hinch
50d6297d23 Replace unsafe code by ByteStr (fixes #440) 2021-05-04 20:00:30 -07:00
Anthony Ramine
a6b414458f v0.3.3 2021-04-29 09:18:12 -07:00
Justin Mayhew
2ccf8dd280 Fix calculation in FlowControl documentation 2021-04-29 09:18:12 -07:00
Anthony Ramine
0a738e6588 Document RecvStream::poll_data
I need it in another polling function.
2021-04-29 09:18:12 -07:00
Anthony Ramine
869e7162c4 Remove obsolete note in the docs
The Stream implementationa also wants you to take care of
managing capacity yourself.
2021-04-29 09:18:12 -07:00
Anthony Ramine
c3bc09550e Remove commented-out code 2021-04-29 09:18:12 -07:00
Anthony Ramine
13dd80be8d Remove useless mut 2021-04-29 09:18:12 -07:00
Anthony Ramine
10d17e5f62 Don't override empty path for CONNECT requests (#534) 2021-04-27 18:55:46 -07:00
Sean McArthur
35699e721a Fix fuzzing of client sending to not fail on user errors (#533) 2021-04-22 14:54:26 -07:00
DavidKorczynski
9c7f47af95 Initial oss-fuzz integration. (#529)
Signed-off-by: davkor <david@adalogics.com>
2021-04-16 14:58:07 -07:00
Sean McArthur
2c53d60098 v0.3.2 2021-03-24 17:34:52 -07:00
Anthony Ramine
a1f914f46f Skip 1xx frames in more states (#527)
#524

Co-authored-by: Kornel <kornel@cloudflare.com>
2021-03-24 08:03:12 -07:00
Sean McArthur
7a5b574d8e v0.3.1 2021-02-26 12:36:26 -08:00