aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-06-02Fix terminate not being called on connection close in HTTP/1.1Loïc Hoguin
Introduces the new stream_handler_SUITE test suite. More cases will be added later on.
2017-05-31Don't terminate streams that were already terminatedLoïc Hoguin
This and the issues in the last two commits were reported by leo2007 on IRC.
2017-05-31Fix bad accounting of HTTP/2 windowsLoïc Hoguin
The previous code was incorrectly substracting the maximum frame size we could send when the data we were actually sending was much lower.
2017-05-31Apply the received SETTINGS frameLoïc Hoguin
2017-05-28Introduce the req_filter Websocket optionLoïc Hoguin
This option allows customizing the compacting of the Req object when using Websocket. By default it will keep most public fields excluding headers of course, since those can be large.
2017-05-23Fix a harmless warning in testsLoïc Hoguin
2017-05-23Add many tests for RFC7540 5.1 and 5.1.1 and related fixesLoïc Hoguin
2017-05-23Add a test suite for h2specLoïc Hoguin
h2spec must be preinstalled on the machine and its location pointed at by the H2SPEC environment variable.
2017-05-20Add another RFC to the list of specsLoïc Hoguin
2017-05-19Update to 2.0.0-pre.92.0.0-pre.9Loïc Hoguin
2017-05-19Preliminary h2 flow control supportLoïc Hoguin
Existing tests pass. A number of things remain to be done. Has only been tested with Gun so far. Feedback welcome!
2017-05-07make set_env working with maps.Alexandre Snarskii
2017-05-07Add a test for cowboy:set_envLoïc Hoguin
2017-05-05Add test for inactivity_timeout option in cowboy_http2Gary Rennie
The inactivity timeout is used to close the connection in the absence of any data from the client. Since this is not part or the rfc7540 spec, a new http2_SUITE module has been created with a test for the inactivity_timeout.
2017-05-05length can be a non_neg_integer or infinitySteven Magelowitz
2017-05-05Add OTP 19.3.3 and 20-rc1 to CI; remove OTP 18Loïc Hoguin
2017-05-05Properly handle 101 upgrade responses for WebsocketLoïc Hoguin
2017-05-05Add inactivity_timeout and other options improvementsLoïc Hoguin
2017-05-03Kill all children processes when terminating the connectionLoïc Hoguin
This is a more or less temporary solution to an existing problem. In the future we will need to enforce a shutdown timeout for these processes.
2017-05-03Add the idle_timeout HTTP/1.1 protocol optionLoïc Hoguin
This fixes the connection being dropped because of request_timeout despite there being some active streams.
2017-04-18Update Websocket handler docs default timeoutGary Rennie
This was changed from infinity to 60s in a45813c60f0f983a24ea29d491b37f0590fdd087
2017-04-18Remove an outdated todo comment2.0.0-pre.8Loïc Hoguin
2017-04-18Get rid of stray messages when killing HTTP/2 request processesLoïc Hoguin
2017-04-18Make the default 204 response go through stream handlersLoïc Hoguin
2017-04-18Pass the HTTP/2 switch_protocol event to stream handlersLoïc Hoguin
To accomplish this the code for sending the 101 response was moved to the cowboy_http2 module.
2017-04-18Add more RFCs to the specs listLoïc Hoguin
2017-04-10Initial cowboy_stream manualLoïc Hoguin
2017-03-27Add the early_error cowboy_stream callbackLoïc Hoguin
This callback is called when an error occurs before the request (including headers, excluding body) was fully received. The init/3 callback will not be called. The callback receives the partial Req object (possibly empty), the reason for the error and the response command that the server will send. It allows you to be aware of the error and possibly modify the response before it is sent.
2017-03-20Add a guide chapter linking to all specsLoïc Hoguin
2017-03-02Add more HTTP/2 tests for RFC7540 4.1 and 4.3Loïc Hoguin
2017-02-26Unknown HTTP/2 frames are ignoredLoïc Hoguin
2017-02-25Add many test cases covering RFC7540 4.2Loïc Hoguin
These tests cover frame sizes. It's mostly edge cases for sure (ie misbehaving clients and us having to reject them properly). I had these almost ready for a long time, so I'm glad I can push them out. This requires updating Cowlib too (we currently track master).
2017-02-19Remove another useless todoLoïc Hoguin
2017-02-19Change the type of bindings from a list to a mapLoïc Hoguin
Maps make more sense because the keys are unique.
2017-02-19Change the order of set_resp_cookie argumentsLoïc Hoguin
The Opts value is put last, to be more consistent with the rest of the cowboy_req module. Additionally a test handler was fixed which reduced the number of errors in http_SUITE.
2017-02-19Change the type of cookie name to binary()Loïc Hoguin
The API will be more consistent like this, and we can ensure that duplicate cookie names are never sent.
2017-02-18Update version to 2.0.0-pre.72.0.0-pre.7Loïc Hoguin
2017-02-18Ensure Websocket errors result in a crash logLoïc Hoguin
2017-02-18Erlang/OTP 19.2.3Loïc Hoguin
2017-02-18Allow passing options to sub protocolsLoïc Hoguin
Before this commit we had an issue where configuring a Websocket connection was simply not possible without doing magic, adding callbacks or extra return values. The init/2 function only allowed setting hibernate and timeout options. After this commit, when switching to a different type of handler you can either return {module, Req, State} or {module, Req, State, Opts} where Opts is any value (as far as the sub protocol interface is concerned) and is ultimately checked by the custom handlers. A large protocol like Websocket would accept only a map there, with many different options, while a small interface like loop handlers would allow passing hibernate and nothing else. For Websocket, hibernate must be set from the websocket_init/1 callback, because init/2 executes in a separate process. Sub protocols now have two callbacks: one with the Opts value, one without. The loop handler code was largely reworked and simplified. It does not need to manage a timeout or read from the socket anymore, it's the job of the protocol code. A lot of unnecessary stuff was therefore removed. Websocket compression must now be enabled from the handler options instead of per listener. This means that a project can have two separate Websocket handlers with different options. Compression is still disabled by default, and the idle_timeout value was changed from inifnity to 60000 (60 seconds), as that's safer and is also a good value for mobile devices.
2017-02-05Remove or fix a small number of todo commentsLoïc Hoguin
One had the todo text fixed, another had the task to do done.
2017-02-05Add test for the compress_response exampleLoïc Hoguin
2017-02-05Remove outdated todo comments from req_SUITELoïc Hoguin
2017-02-05Erlang/OTP 19.2.2 and 18.3.4.5Loïc Hoguin
2017-02-05Add missing human-readable errors for HTTP/1.1Loïc Hoguin
2017-02-05Fix sending of large files with HTTP/2Loïc Hoguin
Also finish implementing the relevant test, getting rid of todos.
2017-02-05Test Websocket protocol version 7Loïc Hoguin
A bit late but at least removes a todo.
2017-01-24examples_SUITE: Query system to find GNU Make executable2.0.0-pre.6Jean-Sébastien Pédron
... instead of hard-coding "make". First, we check the value of `$MAKE`. If it's unset, we look for `gmake` in the `$PATH`. If it's missing, we assume it's `make`. This fixes the testsuite where GNU Make is installed as `gmake`.
2017-01-24cowboy_static: Add support for files in EZ archivesJean-Sébastien Pédron
If cowboy_static is initialized with `{priv_file, ...}` or `{priv_dir, ...}`, it is now able to read files from Erlang application .ez archives. When serving a file from an archive, the #file_info{} comes from the archive, not the contained file, except for the size and type. The erl_prim_loader module is used to read the latter's #file_info{} and the actual file content (ie. sendfile(2) is not used in this case).
2017-01-22Fix and update the compress example to use cowboy_compress_hLoïc Hoguin