0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 04:10:24 +00:00
Commit graph

2166 commits

Author SHA1 Message Date
Björn Svensson
662f6af982
Correcting TransOpts in send_timeout_close tests 2025-01-23 13:29:47 +01:00
Jose M Perez
49061587be
Add WS compression test where only server sets client_max_window_bits
When the server has a non-default value configured and the client
doesn't send one the extension negotiation should fail.
2025-01-23 11:39:48 +01:00
Loïc Hoguin
7f739cad6d
Websocket: Also apply max_frame_size limit to decompressed data
Before this commit frames could "cheat" by compressing data
below the limit which would get expanded above the limit.
Now Cowboy will stop decompressing data when the limit is
reached.
2025-01-22 15:20:20 +01:00
Loïc Hoguin
6e221d38b1
Use cow_deflate in cowboy_decompress_h
The function inflate/3 was moved there to make it
usable from within Cowlib itself.
2025-01-22 15:20:16 +01:00
Loïc Hoguin
9d385fa909
Add compressed Websocket to ws_perf_SUITE 2025-01-22 11:32:56 +01:00
Loïc Hoguin
81de580aee
Websocket: Allow setting the max_frame_size option dynamically
This can be used to limit the maximum frame size before
some authentication or other validation is completed.
2025-01-16 14:47:20 +01:00
Loïc Hoguin
818b448ae9
Switch to running autobahntestsuite via Docker 2025-01-15 13:31:19 +01:00
Loïc Hoguin
1724575b42
Avoid resetting HTTP/2 idle_timeout timer too often
Following the same strategy as Websocket described in
commit cbed21c383e4cebb7df5a0a8b81f18c1738bef3e

Gains are comparable as far as Websocket over HTTP/2
is concerned.
2025-01-15 13:31:19 +01:00
Loïc Hoguin
086f60cca4
Avoid resetting Websocket idle_timeout timer too often
`perf` has shown that Cowboy spends a lot of time
cancelling and starting this timer. Instead of resetting
for every data received, we now only reset a field in the
state.

Before it was working like this:

- start idle timeout timer
- on trigger, close the connection
- on data, cancel and start again

Now it's working like this:

- start idle timeout timer for a tenth of its duration, with tick number = 0
- on trigger, if tick number != 10
  - start the timer again, again for a tenth of its duration
  - increment tick number
- on trigger, if tick number = 10
  - close the connection
- on data, set tick number to 0
2025-01-15 13:31:19 +01:00
Loïc Hoguin
643b335ba8
Add ws_perf_SUITE to measure Websocket performance
It benchmarks binary, ascii, mixed and japanese data
using Websocket and Websocket over HTTP/2.

HTTP/2 options get set to ensure that performance is
better than the default HTTP/2 options.

It switches to Gun and Ranch branches that include
fixes that are required for tests to complete successfully.
2025-01-15 13:28:57 +01:00
Loïc Hoguin
022013b6c4
Update Discord link to a permanent invite 2024-11-27 12:10:12 +01:00
Loïc Hoguin
e4762a6be3
Update CONTRIBUTING.asciidoc 2024-11-15 11:16:45 +01:00
Loïc Hoguin
c91f4d99ce
Add Discord server to README 2024-11-15 11:07:41 +01:00
Loïc Hoguin
7e160b4947
CI: Remove unneeded env 2024-11-08 12:54:26 +01:00
Loïc Hoguin
b7362f3263
CI: Add concurrency rules 2024-11-08 12:13:28 +01:00
Loïc Hoguin
5c74869abc
CI: Simplify testing for examples
Since we only test them on Ubuntu we can use setup-beam
to install Erlang/OTP and avoid waiting for all other
checks to complete.

Also make the "delete master" job conditional rather
than only its step.
2024-11-08 12:13:23 +01:00
Loïc Hoguin
b1cb95fe74
CI: Fix master build deletion
Some things likely changed and made it not work anymore.

Also seems that the macOS runner is now ARM64.
2024-11-07 14:45:42 +01:00
Loïc Hoguin
9f0f2a89d7
Fix markdown example for OTP-27 2024-11-07 13:28:26 +01:00
Loïc Hoguin
e761e3ba7b
CI: Upload logs in examples job too 2024-11-06 20:26:21 +01:00
Loïc Hoguin
99e2cf43c2
Update Erlang.mk 2024-11-06 16:33:39 +01:00
Loïc Hoguin
b77dd29133
Add VU#421644 to the HTTP/2 CONTINUATION Flood test 2024-04-05 22:08:59 +02:00
Loïc Hoguin
8cb9d242b0
Initial HTTP/3 implementation
This includes Websocket over HTTP/3.

Since quicer, which provides the QUIC implementation,
is a NIF, Cowboy cannot depend directly on it. In order
to enable QUIC and HTTP/3, users have to set the
COWBOY_QUICER environment variable:

  export COWBOY_QUICER=1

In order to run the test suites, the same must be done
for Gun:

  export GUN_QUICER=1

HTTP/3 support is currently not available on Windows
due to compilation issues of quicer which have yet to
be looked at or resolved.

HTTP/3 support is also unavailable on the upcoming
OTP-27 due to compilation errors in quicer dependencies.
Once resolved HTTP/3 should work on OTP-27.

Because of how QUIC currently works, it's possible
that streams that get reset after sending a response
do not receive that response. The test suite was
modified to accomodate for that. A future extension
to QUIC will allow us to gracefully reset streams.

This also updates Erlang.mk.
2024-03-26 15:53:48 +01:00
Loïc Hoguin
3ea8395eb8
Cowboy 2.12.0 2024-03-14 15:06:07 +01:00
Loïc Hoguin
f7956a0f44
Update erlang.mk 2024-03-14 12:59:05 +01:00
Loïc Hoguin
cf71c742d6
Add max_fragmented_header_block_size HTTP/2 option 2024-03-14 12:56:33 +01:00
Loïc Hoguin
81f3a21474
Make sure we can cancel ct-examples in CI 2024-01-29 11:38:35 +01:00
Loïc Hoguin
1c464083fa
Update ssl_hello_world example certificate 2024-01-26 15:38:40 +01:00
Loïc Hoguin
a0314a6dff
Don't use specific actions versions and update cache to v4 2024-01-26 13:43:11 +01:00
Loïc Hoguin
7d3aa6c9dd
Run make ct-examples at the end of normal CI 2024-01-26 12:34:37 +01:00
Loïc Hoguin
b36f064a91
Refresh copyright lines 2024-01-25 11:22:54 +01:00
Loïc Hoguin
8f9051519e
Cowboy 2.11 2024-01-23 15:29:41 +01:00
Loïc Hoguin
f060e6c4ff
Document reset_idle_timeout_on_send option 2024-01-23 14:48:15 +01:00
geeksilva97
08c2be058a
Fix match_qs with constraints when key is not present
Original fix by Ali Farhadi <a.farhadi@gmail.com>.
2024-01-23 14:11:29 +01:00
Loïc Hoguin
3e145af9b9
Getting started must include relx in deps 2024-01-23 14:08:06 +01:00
Loïc Hoguin
427a276ef2
Update the guide with range requests support
Also update the list of headers cowboy_rest might set
and tweak a small number of other items.
2024-01-23 13:15:55 +01:00
Loïc Hoguin
4ffcbfbf43
Document range requests 2024-01-22 11:41:46 +01:00
Loïc Hoguin
e8b4715a9f
Reduce sleep in chunked_one_byte_at_a_time
To avoid having the connection get closed due to us taking
too long on unreliable environments like GitHub Actions.
2024-01-18 15:19:23 +01:00
Loïc Hoguin
992ee6241d
Retry the read_urlencoded_body_too_large if timeout triggers
This is caused by the timeout being 1s after the period.
When the CI environment is overloaded, sometimes the
timeout will trigger. We retry, knowing that the
timetrap will catch us if we retry too much.
2024-01-18 12:15:11 +01:00
Loïc Hoguin
ecf3d43613
Improve reliability of a few tests
GitHub Actions runners are not as good as self-hosted BuildKite
so some adjustments need to be made to timeouts and such.
2024-01-17 20:56:46 +01:00
Loïc Hoguin
cff9938a66
Show links in README in make prepare_tag 2024-01-17 12:55:52 +01:00
Loïc Hoguin
5fe1be7007
Add missing manual pages for cowboy_stream functions 2024-01-17 12:52:45 +01:00
Loïc Hoguin
defce46fdf
REST: Allow generate_etag to return undefined
This allows conditionally generating an etag.
2024-01-16 16:28:52 +01:00
Loïc Hoguin
ec12c2f051
Recommend increasing max_frame_size_received HTTP/2 option 2024-01-16 13:11:38 +01:00
Loïc Hoguin
08a8d7b9e9
Confirm Websocket pong frames are received by handlers 2024-01-16 12:20:38 +01:00
Loïc Hoguin
920adb9b82
Fix an intermittent test failure 2024-01-16 11:21:30 +01:00
geeksilva97
308045fd67
Reject responses with explicit set-cookie header
LH: The tests received a lot of fixes and tweaking.
    I also reworded the error message to be more concise.
2024-01-15 17:43:14 +01:00
Loïc Hoguin
1a175e7b56
Fix wrong HTTP/1 timeout being used in some cases
Added many tests to ensure the right timeout is picked in
the appropriate situation. Should there be any issues
remaining we can add more tests.
2024-01-15 15:18:40 +01:00
Loïc Hoguin
906a7ffc3c
Better error message when trying to reply twice
Also crash if trying to push after a reply was sent.
2024-01-09 13:06:11 +01:00
Loïc Hoguin
f0101ffe41
Shorten the 204/304 error message 2024-01-09 11:01:39 +01:00
Loïc Hoguin
a40bab8fb3
Improve the error when trying to send a 204/304 with a body 2024-01-09 10:59:40 +01:00