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

2078 commits

Author SHA1 Message Date
Loïc Hoguin
b2a16a2ee6
Don't force verify client cert in tests
This makes req_SUITE's cert_undefined test work again.
2023-11-23 15:09:06 +01:00
Loïc Hoguin
22adc4de51
Fix Ranch link in user guide 2023-05-02 11:20:02 +02:00
Loïc Hoguin
9e600f6c1d
Cowboy 2.10.0 2023-04-28 10:41:18 +02:00
Loïc Hoguin
326939c8a8
We are not using erl_make_certs anymore 2023-03-30 16:38:08 +02:00
Loïc Hoguin
8093d716fa
Fix tests with serialised maps
The key order of serialised maps changed in OTP-26.
2023-03-30 15:39:13 +02:00
Loïc Hoguin
12108ab668
Fix TLS tests for OTP-26+
ct_helper now uses the test certificates generated by
public_key. A few adjustments had to be made as a result.
2023-03-30 15:38:29 +02:00
Loïc Hoguin
251e70b219
Fix OTP-26+ warnings in test suites 2023-03-30 10:35:08 +02:00
Loïc Hoguin
4958af5745
Update Cowlib to 2.12.1 2023-03-29 15:20:48 +02:00
Loïc Hoguin
b9d4e05be0
Fix tests for OTP-25+ 2023-03-29 15:17:09 +02:00
Loïc Hoguin
30ee75cea1
Update Erlang.mk 2022-09-19 14:17:37 +02:00
Loïc Hoguin
105edf1d6e
Fix data sent after RST_STREAM in HTTP/2 in rare cases 2022-09-19 14:10:32 +02:00
Loïc Hoguin
137e86de7b
Update LICENSE copyright year 2022-07-12 16:38:41 +02:00
Loïc Hoguin
2a08250499
Add Hex metadata 2021-05-12 12:04:03 +02:00
Loïc Hoguin
04ca4c5d31
Cowboy 2.9.0 2021-05-12 10:24:40 +02:00
Loïc Hoguin
136e74fc51
Two more HTTP specs 2021-04-24 16:31:29 +02:00
Loïc Hoguin
880c72ef99
Cowlib 2.11.0 and Ranch 1.8.0 2021-04-24 16:31:14 +02:00
Martin Björklund
8795233c57
AcceptCallback may now return created/see_other tuples for POST
They replace and deprecate the {true,URI} return value.
2020-11-27 16:17:43 +01:00
Sebastian Strollo
63a6b86fba
Also include trace messages when timestamp flag isn't used 2020-11-27 16:02:54 +01:00
Simon Johansson
f6049b85a3
Use functions for inititalizing rate limiting
... to ensure that the same values are used in all places.
2020-11-27 15:51:09 +01:00
Viktor Söderqvist
059d58d39f
Graceful shutdown
Note: This commit makes cowboy depend on cowlib master.

Graceful shutdown for HTTP/2:

1. A GOAWAY frame with the last stream id set to 2^31-1 is sent and a
   timer is started (goaway_initial_timeout, default 1000ms), to wait
   for any in-flight requests sent by the client, and the status is set
   to 'closing_initiated'. If the client responds with GOAWAY and closes
   the connection, we're done.
2. A second GOAWAY frame is sent with the actual last stream id and the
   status is set to 'closing'. If no streams exist, the connection
   terminates. Otherwise a second timer (goaway_complete_timeout,
   default 3000ms) is started, to wait for the streams to complete. New
   streams are not accepted when status is 'closing'.
3. If all streams haven't completed after the second timeout, the
   connection is forcefully terminated.

Graceful shutdown for HTTP/1.x:

1. If a request is currently being handled, it is waited for and the
   response is sent back to the client with the header "Connection:
   close". Then, the connection is closed.
2. If the current request handler is not finished within the time
   configured in transport option 'shutdown' (default 5000ms), the
   connection process is killed by its supervisor (ranch).

Implemented for HTTP/1.x and HTTP/2 in the following scenarios:

* When receiving exit signal 'shutdown' from the supervisor (e.g. when
  cowboy:stop_listener/3 is called).
* When a connection process is requested to terminate using
  sys:terminate/2,3.

LH: Edited tests a bit and added todos for useful tests to add.
2020-11-27 15:38:21 +01:00
Loïc Hoguin
fa9c8ad832
Use gun:ws_send/3 in tests 2020-11-23 11:02:01 +01:00
Loïc Hoguin
e12d7bbe21
Don't produce an error report for normal stream process exits 2020-11-23 11:02:01 +01:00
Loïc Hoguin
c47f1e5fb8
Update Erlang.mk 2020-10-07 13:44:24 +02:00
Thomas Sciaroni
70d393caad
Minor grammar corrections
Verb agreement error "The request process executes
middlewares which, by default, including the router
and then the execution of handlers." -> "The request
process executes middlewares. By default, the request
process executes the router and then the handlers."

Adverbial clause at beginning of sentence needs comma
"By default Cowboy comes..." -> "By default, Cowboy comes..."
2020-08-19 14:37:50 +02:00
Loïc Hoguin
03d306e6d1
Fix concurrent body streaming getting stuck with HTTP/2 2020-07-03 11:02:59 +02:00
Loïc Hoguin
5aac00d60c
Tweak a sentence in the guide
Thanks Tamir Halperin for pointing this out.

[skip ci]
2020-07-01 13:55:58 +02:00
Loïc Hoguin
de955079f9
Fix the cowboy_req:inform/3 example in the manual 2020-05-28 21:07:20 +02:00
Loïc Hoguin
3eec447960
Remove jQuery, cleanup Websocket example a bit 2020-05-23 11:00:17 +02:00
Loïc Hoguin
8d5628c5f1
Cowboy 2.8.0 2020-05-21 19:02:12 +02:00
Loïc Hoguin
39b2816255
204 and 304 responses must not include a body
When calling cowboy_req:reply/4 with a body a crash will occur
resulting in a 500 response. When calling cowboy_req:stream_reply/2,3
and then attempting to send a body a crash will occur.
2020-05-20 13:41:05 +02:00
Loïc Hoguin
8337aca4d3
Increase the default max_keepalive HTTP option to 1000
100 is very low for current deployments. 1000 is more
appropriate as a default value.
2020-05-20 11:08:58 +02:00
Loïc Hoguin
4edc39b003
Don't stop listeners that don't exist in static_handler_SUITE 2020-05-20 11:08:24 +02:00
Loïc Hoguin
78b23ddfa5
Clarify the routing algorithm 2020-05-20 10:53:52 +02:00
Loïc Hoguin
0d0e7d164c
Increase the timetrap timeout in req_SUITE on Windows
Still seeing intermittent failures on Windows due to
timetrap so let's see if doubling the timeout again helps.
2020-04-08 10:28:27 +02:00
Loïc Hoguin
f79d60e0c7
Get rid of timeouts in metrics_SUITE
Again to avoid intermittent issues.
2020-04-08 10:28:11 +02:00
Loïc Hoguin
8af3216c4c
Document the HTTP/2 linger_timeout option 2020-04-08 10:27:45 +02:00
Loïc Hoguin
f58189df19
Clarify that protocol opts may be defined by stream handlers 2020-04-08 10:27:14 +02:00
Loïc Hoguin
b339713461
Allow {error, enotconn} as test success in security_SUITE
This happens from time to time on Windows and is partially
due to how the test is written.
2020-04-07 10:18:29 +02:00
Loïc Hoguin
e51ac66728
Rely on timetrap timeouts for tracer_SUITE 2020-04-06 20:14:31 +02:00
Loïc Hoguin
8cba8c3c68
NO_PARALLEL=1 will disable (most) parallel testing
This is to make up for very slow or low resource environments,
like the FreeBSD CI environment currently.
2020-04-06 16:39:28 +02:00
Loïc Hoguin
775091134d
Experiment with a linger_timeout for HTTP/2
This is mostly to ensure that the GOAWAY frame is properly
received on Windows in some tests, but should be benefitial
also in production in particular when clients are slower.
2020-04-06 14:50:35 +02:00
Loïc Hoguin
5203ee6a84
Increase the req_SUITE timetrap timeout on Windows
The local network is much slower so the tests take longer there.
2020-04-06 12:27:41 +02:00
Loïc Hoguin
cc8a2e4257
Reduce the pipeline test body sizes to avoid filling send buffers
This causes the test to get stuck because both the client and
server end up waiting in Transport:send for the other side to
read data from the socket.
2020-04-05 16:28:54 +02:00
Loïc Hoguin
4ab69f402e
Fix active mode and flow control during pipelining
We could get stuck in passive mode under certain conditions
(fast and non-busy machine and perhaps other environment factors).
2020-04-04 20:15:23 +02:00
Loïc Hoguin
4274f077a6
Disable ws_SUITE:unlimited_connections on Windows 2020-04-02 17:36:03 +02:00
Loïc Hoguin
3f37985d2c
Skip ws_SUITE:unlimited_connections when ulimit -n is too low 2020-04-02 16:23:36 +02:00
Loïc Hoguin
962d715ad4
Make req_SUITE:read*_body_urlencoded_too_long tests reliable 2020-04-02 15:46:38 +02:00
Loïc Hoguin
909c8a4b4d
Update rebar.config 2020-04-02 15:05:15 +02:00
Loïc Hoguin
0143d9e5a9
Use infinity timeout for gun:await* calls in req_SUITE 2020-04-02 14:57:10 +02:00
Loïc Hoguin
789768e8d3
Rework the req_SUITE:read_body_period test
To avoid intermittent test failures. We only want to make
sure the function eventually returns so we don't need to
use timeouts in the test itself, or check exactly what was
read.
2020-04-02 14:01:26 +02:00