aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
6 daysUpdate to most recent WebTransport draftHEADmasterLoïc Hoguin
WEBTRANSPORT -> WT in most places. Only ENABLE_WEBTRANSPORT remains (since it is a draft-02 setting that was later removed) as well as internal functions and atoms about stream headers, for greater clarity.
11 daysInitial implementation of HTTP/3 WebTransportLoïc Hoguin
This adds support for WebTransport HTTP/3 settings, error codes, headers, stream types as well as capsules, with an initial implementation of the Capsule protocol.
2025-04-11Cowlib 2.15.02.15.0Loïc Hoguin
2025-04-10Make Dialyzer happy againLoïc Hoguin
2025-04-10Add cow_http2_machine:terminate/1 for cleanupLoïc Hoguin
This allows cleaning up timers and avoids receiving stray timeout messages when reusing a process. This is otherwise optional since the termination of a process cleans up the timers.
2025-02-14Cowlib 2.14.02.14.0Loïc Hoguin
2025-02-14Remove copyright years from all files except LICENSELoïc Hoguin
2025-02-11Improve cow_http2:settings/0 type and export itLoïc Hoguin
2025-02-11Add a function to check remote HTTP/2 setting MAX_CONCURRENT_STREAMSViktor Söderqvist
This is to be used primarily by a client before initiating a new stream so that it can respect the setting from the server.
2025-02-10Add cow_http_hd:allow/1Loïc Hoguin
2025-01-23Disable WS compression when only server sets client_max_window_bitsJose M Perez
When the client does not provide the "client_max_window_bits" option, the server must be able to handle a sliding window of up to 32,768 bytes. When the server has configured a lower limit than the default, and the client has not provided the parameter, compression must be disabled. Co-authored-by: Ignacio Martínez <[email protected]>
2025-01-22Use zlib:safeInflate and limits for Websocket decompressionLoïc Hoguin
The `max_inflate_size` value can be configured in the extensions map to set a limit to the size of the expanded data. This is done via the previously introduced cow_deflate:inflate/3 function.
2025-01-22Add cow_deflate:inflate/3Loïc Hoguin
This function can be used to safely inflate data up to a given limit. It has been extracted from the cowboy_decompress_h module.
2025-01-22Fix compression of zero-byte Websocket framesLoïc Hoguin
An empty deflate block must be inserted when zlib returns nothing.
2025-01-16Update mimetypesLoïc Hoguin
2025-01-14Fix OTP-27 Dialyzer warningsLoïc Hoguin
Disable improper lists warnings in cow_qs/cow_uri since we intentionally create them.
2025-01-13Avoid an extra multiplication before unmaskingLoïc Hoguin
This has no real impact on performance but simplies the code a little.
2025-01-07Optimise Websocket (un)maskingLoïc Hoguin
By (un)masking 16 bytes at a time when possible (instead of 4) we process frames roughly 10% faster for all frame types.
2025-01-06Optimise Websocket UTF-8 validationLoïc Hoguin
See comment within the commit for full details. This results in improved Cowboy performance decoding text messages of around 10 to 15% in all scenarios, except when the message is small and it contains mostly non-ASCII (due to the cost of trying ASCII first). This brings decoding of text frames closer to decoding of binary frames, with ASCII data taking approximately 1.1 times longer to decode, mixed data 1.25 times longer and mostly non-ASCII data 1.35 times longer to decode.
2025-01-06Add debug logging for receiving of HTTP/2 framesLoïc Hoguin
2024-07-04Optimise all cow_qs functionsLoïc Hoguin
See the previous commit [1] for details on the optimisations involved. The optimisation provides the same type of performance gains for encoding, decoding, building and parsing query strings. [1] cdaac4c907dbee90a91ad123b18dc6919a3835f6
2024-07-03Optimise cow_uri:urlencodeLoïc Hoguin
See the previous commit [1] for details on the optimisations involved. The optimisation provides the same type of performance gains for encoding and decoding. [1] cdaac4c907dbee90a91ad123b18dc6919a3835f6
2024-07-02Optimise cow_uri:urldecodeLoïc Hoguin
The recently added `json` module in OTP demonstrated new, better ways of optimising binary string manipulations. Some of which likely make better use of recent compiler or VM improvements. The main improvement is returning as fast as possible when there's nothing to decode: cow_uri:urldecode in 0.053833s cow_uri:urldecode in 0.005991s When there's a little to decode, the performance is nicely improved, although not as much: cow_uri:urldecode_hex in 0.061018s cow_uri:urldecode_hex in 0.040028s When the input if fully/mostly encoded JP text, the difference is remarkable: cow_uri:urldecode_jp_hex in 0.099333s cow_uri:urldecode_jp_hex in 0.039391s cow_uri:urldecode_jp_mixed_hex in 0.097653s cow_uri:urldecode_jp_mixed_hex in 0.046385s The worst case scenario unfortunately is slower than before, but nothing too bad. The worst case is when the input is a sequence of 3 encoded characters followed by 3 non-encoded characters: cow_uri:urldecode_worst_case_hex in 0.050017s cow_uri:urldecode_worst_case_hex in 0.061515s
2024-03-26Initial HTTP/3 and QPACK implementationqpackLoï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.
2024-03-14Cowlib 2.13.02.13.0Loïc Hoguin
2024-03-14Update erlang.mkLoïc Hoguin
2024-03-14Add max_fragmented_header_block_size HTTP/2 optionLoïc Hoguin
2023-03-29Cowlib 2.12.12.12.1Loïc Hoguin
2023-03-28Pin the structured-headers-test repoLoïc Hoguin
Since a draft for a revision was introduced the tests have started covering additions that we don't currently support.
2023-03-28Fix handling of bad length for RST_STREAM parsingLuis Gustavo Beligante
2023-02-28Fix compile error due to bad specLoïc Hoguin
OTP fixed a bug that leads to the bad spec no longer compiling. Fix is expected to land in OTP-26.0.
2023-01-16Update cookie manual pages2.12.0Loïc Hoguin
2023-01-16Cowlib 2.12.0Loïc Hoguin
2023-01-09We must also rebuild the rebar used for autopatchLoïc Hoguin
2023-01-09Always rebuild from scratch in CILoïc Hoguin
2023-01-09Always rebuild deps in CILoïc Hoguin
2023-01-09Also rebuild proper for OTP/25Loïc Hoguin
2023-01-09Rebuild horse between each CI run so that it works for OTP/25Loïc Hoguin
2022-10-24Update SameSite cookie attribute to handle "Default"Loïc Hoguin
2022-09-12Remove the obsolete Version cookie attributeSebastian Strollo
2022-09-02Do additional cookie parsing checks based on RFC6265bisLoïc Hoguin
2022-03-22Implement RFC5861 (stale-* cache-control directives)Tangui Le Pense
Loïc: amended to add RFC5861 examples to the tests.
2022-03-22Update Basic auth parsing to RFC 7617Sebastian Strollo
In particular we now ignore unknown authentication parameters. Loïc: Small cleanup edits in amend.
2022-03-22Fix URI template reserved expansion of %-encodedLoïc Hoguin
2022-03-22Update structured headers implementation to RFC 8941Loïc Hoguin
I have in the process changed the output a little with regard to parameters. The dictionaries also build as a list of key-values now to keep ordering. This should be the definitive interface.
2021-05-12Update link in Hex metadataLoïc Hoguin
2021-04-24Cowlib 2.11.02.11.0Loïc Hoguin
2021-03-29Update base32 master->mainLoïc Hoguin
2020-11-27Handle last remote stream ID in cow_http2_machineViktor Söderqvist
New function set_last_streamid/1 sets the last accepted stream ID to the last known remote stream ID. Frames with a remote stream ID greater than this are thereafter discarded by frame/2, which returns {ok, Http2Machine} for such frames.
2020-11-19Add Sponsor link to Hex metadata2.10.1Loïc Hoguin