| commit | 0913e8b57efc584c317c51988c079a56c6c82a94 | [log] [tgz] |
|---|---|---|
| author | Ben Caimano <[email protected]> | Thu Jan 20 13:31:22 2022 -0500 |
| committer | Ben Caimano <[email protected]> | Mon Jan 24 17:44:06 2022 -0500 |
| tree | 4c6907081ce2391d35e0611beb7dc316734a3620 | |
| parent | 6ac968cceb0bdd1432386b1ffd8fae52065a6bbd [diff] |
Assert that HttpHeaders instances know about indexed ids The HttpHeaderTable::Builder class allows you to reference its future table before it is fully built. But that HttpHeaderTable must be used to make HttpHeaders instances only after HttpHeaderTable::Builder::build() is invoked under peril of index out of bounds error in debug mode or segfault in release mode. These errors can be somewhat mysterious since they usually occur on a different stack from where the HttpHeaders instance was made. This commit adds an assertion that makes this situation more evident and logs useful diagnostic info about which header id was added after the construction. Hopefully, it should downgrade a segfault to failed Promise or thrown Exception for most users.
Cap‘n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster. In fact, in benchmarks, Cap’n Proto is INFINITY TIMES faster than Protocol Buffers.