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

2045 commits

Author SHA1 Message Date
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
Loïc Hoguin
2b65b575c6
Change a few flaky tests to use timetrap and infinity timeouts
The experiment was successful in Gun, let's see if it helps
with Cowboy as well.
2020-04-01 21:11:59 +02:00
Loïc Hoguin
8471788826
Update Cowlib to 2.9.1
Fixes HPACK edge cases (error conditions).
2020-04-01 20:14:35 +02:00
Loïc Hoguin
a8a2689727
Fix h2spec "invalid preface sequence" test
Introduce a currently undocumented option to allow disabling
cowboy_http when using a clear listener.
2020-04-01 18:02:59 +02:00
Loïc Hoguin
bcef70818b
Fix the req_SUITE:parse_cookie test
We now allow spaces in cookie names.
2020-03-30 17:46:42 +02:00
Loïc Hoguin
0fc33c5300
Add more headers to cowboy_req:parse_header/2,3 2020-03-30 15:02:35 +02:00
Loïc Hoguin
6b3fa5bb76
Update Cowlib to 2.9.0 2020-03-30 15:02:31 +02:00
Loïc Hoguin
27d10cf597
Update Erlang.mk 2020-03-29 15:45:51 +02:00
Loïc Hoguin
70e43ec112
Add more router tests 2020-03-29 15:44:47 +02:00
Loïc Hoguin
6ad842a742
Increase the default max_received_frame_rate
Allow 10000 frames every 10 seconds instead of just 1000,
as the limit was too quickly reached in some deployments.
2020-03-29 13:51:21 +02:00
Loïc Hoguin
f8e94c3315
Add more specifications 2020-03-29 13:22:06 +02:00
Loïc Hoguin
ab82d316b0
Cowboy itself doesn't use proper; Cowlib does 2020-03-29 13:20:57 +02:00
Loïc Hoguin
2ea1313763
Add Trace Context to the list of specs 2020-02-08 15:32:46 +01:00
Loïc Hoguin
3ec0cd8b8d
Clarify modifying/adding to the Req object 2020-02-08 15:32:46 +01:00
Loïc Hoguin
8fc3da2fc3
Fix HTTP/1.1 bug when a flow command is returned after fin
This resulted in a badarith error due to the current flow being
set to infinity when the body has been fully read. A test case
has been added reproducing the issue.
2020-02-07 11:32:15 +01:00
Loïc Hoguin
47ecfd7318
Add a test confirming push requests have no body 2020-02-05 18:06:00 +01:00
Loïc Hoguin
752297b153
Fix bugs related to HTTP/1.1 pipelining
The flow control is now only set to infinity when we are
skipping the request body of the stream that is being
terminated. This fixes a bug where it was set to infinity
while reading a subsequent request's body, leading to a
crash.

The timeout is no longer reset on stream termination.
Timeout handling is already done when receiving data
from the socket and doing a reset on stream termination
was leading to the wrong timeout being set or the right
timeout being reset needlessly.
2020-01-17 11:42:28 +01:00
Loïc Hoguin
edea415da8
Fix cowboy_req:parse_header manual for unknown headers 2020-01-06 14:42:24 +01:00
Loïc Hoguin
5e0be061bb
Add a skeleton performance chapter to the guide 2020-01-06 14:04:25 +01:00
Loïc Hoguin
db0d6f8d25
Use active,N
This reduces the number of times we need to ask for more packets,
and as a result we get a fairly large boost in performance,
especially with HTTP/1.1.

Unfortunately this makes Cowboy require at least Erlang/OTP 21.3+
because the ssl application did not have active,N. For simplicity
the version required will be Erlang/OTP 22+.

In addition this change improves hibernate handling in
cowboy_websocket. Hibernate will now work for HTTP/2 transport
as well, and stray or unrelated messages will no longer cancel
hibernate (the process will handle the message and go back into
hibernation).

Thanks go to Stressgrid for benchmarking an early version of this
commit: https://stressgrid.com/blog/cowboy_performance_part_2/
2020-01-06 12:58:14 +01:00
Loïc Hoguin
592029070d
Reduce number of Transport:send/2 calls for HTTP/2
When sending a complete response it is far more efficient
to send the headers and the body in one Transport:send/2
call instead of two or more, at least for small responses.

This is the HTTP/2 counterpart to what was done for HTTP/1.1
many years ago in bfab8d4b22.

In HTTP/2's case however the implementation is a little
more difficult due to flow control. On the other hand the
optimization will apply not only for headers/body but also
for the body of multiple separate responses, which may need
to be sent all at the same time when we receive a WINDOW_UPDATE
frame.

When a body is sent using sendfile however a separate call
is still made.
2020-01-02 13:29:56 +01:00
Loïc Hoguin
3a7232b019
No longer use erlang:get_stacktrace/0
It has been deprecated in OTP and the new way is available
on all supported OTP versions.
2019-12-31 15:10:38 +01:00
Marcos Ferreira
3b85b808ae
Ignore malformed accept-encoding headers in cowboy_compress_h 2019-12-31 13:48:05 +01:00
Loïc Hoguin
aa1a7d09f3
Add sponsor link to the README 2019-12-31 11:12:44 +01:00
Loïc Hoguin
3fb55f076f
Add a commented option in the Makefile 2019-12-31 11:12:04 +01:00
Tony Han
43f1754f33
Test trailers bug when there are data frames in queue 2019-12-31 11:06:31 +01:00
Loïc Hoguin
e81cd6328b
Add new RFCs to the list 2019-12-31 11:04:42 +01:00
Loïc Hoguin
63b17e4edf
Use /long_polling for rfc7540 tests that reset the stream 2019-10-10 17:06:59 +02:00
Loïc Hoguin
3ae228897a
Don't log stray messages for lingering HTTP/2 streams 2019-10-10 17:06:24 +02:00
Loïc Hoguin
525eeeecc9
Cowboy 2.7.0 2019-10-10 16:15:51 +02:00
Loïc Hoguin
a73004e966
Fix a number of low hanging todos 2019-10-10 16:04:28 +02:00
Loïc Hoguin
ecb39eea10
Newly documented cow_cookie:cookie_opts() is now a map 2019-10-10 14:52:02 +02:00
Loïc Hoguin
d52e84bdd9
Add shutdown_reason Websocket command
This allows changing the normal exit reason of Websocket
processes, providing a way to signal other processes of
why the exit occurred.
2019-10-10 11:33:35 +02:00
Loïc Hoguin
cc54c207e3
Implement flow control for HTTP/1.1
We now stop reading from the socket unless asked to,
when we reach the request body. The option
initial_stream_flow_size controls how much data
we read without being asked, as an optimization.
We may also have received additional data along
with the request headers.

This commit also reworks the timeout handling for HTTP/1.1
because the stray timeout message was easily reproducible
after implementing the flow control. The issue should be
gone for good this time.
2019-10-09 20:54:33 +02:00