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

2031 commits

Author SHA1 Message Date
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
Loïc Hoguin
0c4103984b
Add migration guide for Cowboy 2.7 2019-10-07 17:48:45 +02:00
Loïc Hoguin
b350180503
Add new stream handlers to the guide
Also link from the guide to manual pages.
2019-10-07 14:06:37 +02:00
Loïc Hoguin
80aef3cdaa
Document no date/server headers from response/headers commands 2019-10-07 13:45:07 +02:00
Loïc Hoguin
2e8fcb9a9e
Add cowboy_req:cast/2
Better than sending messages manually.
2019-10-07 13:25:49 +02:00
Loïc Hoguin
5cdf78fd57
Fix an intermittent test issue 2019-10-07 12:18:03 +02:00
Loïc Hoguin
fad0ac8fb6
Document the set_options stream handler command 2019-10-07 12:07:23 +02:00
Loïc Hoguin
e25fb19bab
Document the log stream handler command 2019-10-07 11:58:45 +02:00
Loïc Hoguin
53bc54a860
Document the logger option 2019-10-07 11:43:44 +02:00
Loïc Hoguin
0342866c2e
Document cowboy_tracer_h 2019-10-07 10:43:22 +02:00
Loïc Hoguin
eaed063702
Document cowboy_metrics_h 2019-10-07 09:59:36 +02:00
Loïc Hoguin
3977f2b96f
Document the commands based Websocket interface
The old interface with ok|reply|stop tuples is deprecated.
2019-10-06 16:51:27 +02:00
Loïc Hoguin
2b38526351
Fix PUT when resource doesn't exist in flowchart
This required moving around a lot of things so hopefully I
did not add errors while doing so. Only time will tell.

Also add the 415 that can result from content_types_accepted.
2019-10-06 12:48:35 +02:00
Loïc Hoguin
62836cdddc
Document how to recover from cookie parsing errors 2019-10-06 10:18:16 +02:00
Loïc Hoguin
3e23aff1d1
Add Websocket option validate_utf8
This allows disabling the UTF-8 validation check
for text and close frames.
2019-10-05 17:32:50 +02:00