aboutsummaryrefslogtreecommitdiffstats
path: root/src/cow_hpack.erl
AgeCommit message (Collapse)Author
2024-03-26Initial HTTP/3 and QPACK implementationHEADqpackmasterLoïc Hoguin
Cowlib now uses GitHub Actions for CI. As a result of this change, Cowlib is tested against OTP-24+. This commit adds initial implementations of cow_http3, cow_http3_machine and cow_qpack. Because QPACK is similar to HPACK, some encoding and decoding functions were moved to a common include file, particularly the huffman functions. The cow_http module now contains the types and functions common to all or most versions of HTTP. The types and functions specific to HTTP/1 were moved to the new cow_http1 module. Because HTTP/3 is similar to HTTP/2, part of the code processing headers is common and can be found in cow_http. Other functions common to both versions were moved out of cow_http2_machine. This commit updates comments indicating that the HTTP/2 PRIORITY mechanism will no longer be implemented.
2023-01-16Cowlib 2.12.0Loïc Hoguin
2020-10-07Minor optimization in cow_hpack:update_table_size/2Viktor Söderqvist
Table only needs to be resized if the current size exceeds the new max size, regardless of current max size.
2020-10-07Make HPACK encode respect new configured max sizeViktor Söderqvist
Correction to cow_hpack:encode/2,3 according to RFC 7541, 4.3. Entry Eviction When Dynamic Table Size Changes. This change also corrects the handling of inserting entries larger than the max size, which shall result in an empty table, according to 4.4. in the same RFC. Fixes #101, #103.
2020-03-30Fix some HPACK Huffman decoding failure casesLoïc Hoguin
When EOS is found within the string the decoding must fail. When the final padding is > 7 bit in length the decoding must fail as well.
2019-12-29HPACK: Fix inline integer decodingsLoïc Hoguin
There's no shift to be done for the first value.
2019-12-27HPACK: Turn off Dialyzer warning about improper listsLoïc Hoguin
2019-12-27HPACK decode: decode integers directly to avoid copying binariesLoïc Hoguin
2019-12-27HPACK decode: don't try to drop entries when increasing sizeLoïc Hoguin
2019-12-27HPACK encoding now produces a more compact resultLoïc Hoguin
This in turn leads to a small performance improvement.
2019-12-26Fix Proper tests following cow_hpack changesLoïc Hoguin
2019-12-26HPACK encode shouldn't maps:get(huffman...) for every stringLoïc Hoguin
2019-12-26Use binary append instead of lists:reverseLoïc Hoguin
2019-12-26Remove unused cow_hpack:decode/3 Opts argumentLoïc Hoguin
2019-12-26HPACK encode: conditionally call an iolist_to_binaryLoïc Hoguin
This provides a small but noticeable improvement so it's probably worth doing.
2019-12-25Fix typo in commentLoïc Hoguin
2019-12-25Optimize HPACK Huffman decodingLoïc Hoguin
The previous naive implementation ended up not benefitting from binary match context reuse because it was matching on bit boundaries (and not bytes). This new implementation matches a byte at a time. The result is almost twice faster when decoding the examples from the HPACK RFC (before/after): cow_hpack:decode_huffman in 0.250666s cow_hpack:decode_huffman in 0.133743s
2018-04-25Prevent the HPACK configured_max_size from being droppedLoïc Hoguin
2018-04-23Add proper support for table size updatesLoïc Hoguin
2017-07-10Switch from Triq to ProperLoïc Hoguin
2016-10-09Fix HPACK table size tracking when table is prunedPablo Polvorin
The new entry size wasn't being added to the table size after a prune. Also fixes incorrect test cases. The size number was different than the one found in RFC 7541 Appendix C.
2016-10-04Fix Dialyzer warningsLoïc Hoguin
2016-06-08Fix #39: Prefer crypto:strong_rand_bytes/1Leo Liu
See also https://github.com/erlang/otp/pull/883
2016-05-24HPACK: Fix an issue with header values as iolistsLoïc Hoguin
2015-03-19Add HPACK decoding and encoding functionsLoïc Hoguin
No decoding options have been added in this commit. They will be added in the future. Only one encoding option has been added: #{huffman => boolean()}. It allows to disable Huffman compression of strings. This compression is enabled by default.