aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-11-27AcceptCallback may now return created/see_other tuples for POSTMartin Björklund
They replace and deprecate the {true,URI} return value.
2020-11-27Also include trace messages when timestamp flag isn't usedSebastian Strollo
2020-11-27Use functions for inititalizing rate limitingSimon Johansson
... to ensure that the same values are used in all places.
2020-11-27Graceful shutdownViktor Söderqvist
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-23Use gun:ws_send/3 in testsLoïc Hoguin
2020-11-23Don't produce an error report for normal stream process exitsLoïc Hoguin
2020-10-07Update Erlang.mkLoïc Hoguin
2020-08-19Minor grammar correctionsThomas Sciaroni
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-07-03Fix concurrent body streaming getting stuck with HTTP/2Loïc Hoguin
2020-07-01Tweak a sentence in the guideLoïc Hoguin
Thanks Tamir Halperin for pointing this out. [skip ci]
2020-05-28Fix the cowboy_req:inform/3 example in the manualLoïc Hoguin
2020-05-23Remove jQuery, cleanup Websocket example a bit2.8.0Loïc Hoguin
2020-05-21Cowboy 2.8.0Loïc Hoguin
2020-05-20204 and 304 responses must not include a bodyLoïc Hoguin
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-20Increase the default max_keepalive HTTP option to 1000Loïc Hoguin
100 is very low for current deployments. 1000 is more appropriate as a default value.
2020-05-20Don't stop listeners that don't exist in static_handler_SUITELoïc Hoguin
2020-05-20Clarify the routing algorithmLoïc Hoguin
2020-04-08Increase the timetrap timeout in req_SUITE on WindowsLoïc Hoguin
Still seeing intermittent failures on Windows due to timetrap so let's see if doubling the timeout again helps.
2020-04-08Get rid of timeouts in metrics_SUITELoïc Hoguin
Again to avoid intermittent issues.
2020-04-08Document the HTTP/2 linger_timeout optionLoïc Hoguin
2020-04-08Clarify that protocol opts may be defined by stream handlersLoïc Hoguin
2020-04-07Allow {error, enotconn} as test success in security_SUITELoïc Hoguin
This happens from time to time on Windows and is partially due to how the test is written.
2020-04-06Rely on timetrap timeouts for tracer_SUITELoïc Hoguin
2020-04-06NO_PARALLEL=1 will disable (most) parallel testingLoïc Hoguin
This is to make up for very slow or low resource environments, like the FreeBSD CI environment currently.
2020-04-06Experiment with a linger_timeout for HTTP/2Loïc Hoguin
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-06Increase the req_SUITE timetrap timeout on WindowsLoïc Hoguin
The local network is much slower so the tests take longer there.
2020-04-05Reduce the pipeline test body sizes to avoid filling send buffersLoïc Hoguin
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-04Fix active mode and flow control during pipeliningLoïc Hoguin
We could get stuck in passive mode under certain conditions (fast and non-busy machine and perhaps other environment factors).
2020-04-02Disable ws_SUITE:unlimited_connections on WindowsLoïc Hoguin
2020-04-02Skip ws_SUITE:unlimited_connections when ulimit -n is too lowLoïc Hoguin
2020-04-02Make req_SUITE:read*_body_urlencoded_too_long tests reliableLoïc Hoguin
2020-04-02Update rebar.configLoïc Hoguin
2020-04-02Use infinity timeout for gun:await* calls in req_SUITELoïc Hoguin
2020-04-02Rework the req_SUITE:read_body_period testLoïc Hoguin
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-01Change a few flaky tests to use timetrap and infinity timeoutsLoïc Hoguin
The experiment was successful in Gun, let's see if it helps with Cowboy as well.
2020-04-01Update Cowlib to 2.9.1Loïc Hoguin
Fixes HPACK edge cases (error conditions).
2020-04-01Fix h2spec "invalid preface sequence" testLoïc Hoguin
Introduce a currently undocumented option to allow disabling cowboy_http when using a clear listener.
2020-03-30Fix the req_SUITE:parse_cookie testLoïc Hoguin
We now allow spaces in cookie names.
2020-03-30Add more headers to cowboy_req:parse_header/2,3Loïc Hoguin
2020-03-30Update Cowlib to 2.9.0Loïc Hoguin
2020-03-29Update Erlang.mkLoïc Hoguin
2020-03-29Add more router testsLoïc Hoguin
2020-03-29Increase the default max_received_frame_rateLoïc Hoguin
Allow 10000 frames every 10 seconds instead of just 1000, as the limit was too quickly reached in some deployments.
2020-03-29Add more specificationsLoïc Hoguin
2020-03-29Cowboy itself doesn't use proper; Cowlib doesLoïc Hoguin
2020-02-08Add Trace Context to the list of specsLoïc Hoguin
2020-02-08Clarify modifying/adding to the Req objectLoïc Hoguin
2020-02-07Fix HTTP/1.1 bug when a flow command is returned after finLoïc Hoguin
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-05Add a test confirming push requests have no bodyLoïc Hoguin
2020-01-17Fix bugs related to HTTP/1.1 pipeliningLoïc Hoguin
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.