Commit 4a2f776
Apu Islam
feat(http2): implement 103 Early Hints support
Add HTTP/2 103 Early Hints implementation with client and server support:
- Add builder opt-in pattern via enable_informational() for zero-cost abstraction
- Create early_hints_pusher() API for server-side hint transmission via mpsc channel
- Add InformationalCallback system for client-side informational response handling
- Extend HTTP/2 client builder with informational_responses() configuration method
- Implement informational response polling in h2 client task with callback invocation
- Add server-side informational response forwarding using h2's send_informational API
- Include test coverage: 11 integration tests, 18 unit tests, 2 doc tests
- Add complete working example with TLS, resource preloading, and performance monitoring
- Update Cargo.toml with h2 = 0.4.13 dependency requirement
The implementation enables servers to send resource preload hints before final responses,
allowing browsers to start downloading critical resources early and improve page load
performance. Feature is opt-in and disabled by default for zero overhead when not used.
Clients can register callbacks to process 103 Early Hints and other informational responses.
Closes #3980, #24261 parent 7950930 commit 4a2f776
File tree
14 files changed
+2594
-10
lines changed- examples
- src
- client/conn
- ext
- proto
- h1
- h2
- server/conn
- tests
14 files changed
+2594
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | | - | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| |||
202 | 206 | | |
203 | 207 | | |
204 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
205 | 214 | | |
206 | 215 | | |
207 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
0 commit comments