aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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
2017-01-22Erlang/OTP 19.2.1Loïc Hoguin
2017-01-22Add experimental cowboy_compress_h stream handlerLoïc Hoguin
Currently marked as experimental because it can't be tweaked (just enabled/disabled) and because it is not documented yet.
2017-01-20Fix error responses not including a content-lengthLoïc Hoguin
This would prevent the client from knowing whether the request was received fully without the connection closing first.
2017-01-20Fix protocol breaking when user tries to send empty chunkLoïc Hoguin
The {data, IsFin, Data} uses IsFin to indicate whether this is the last chunk, while chunked transfer-encoding uses the length of Data, and ends when it is 0. We must therefore not send chunks with empty data.
2017-01-16Add support for multiple stream handlersLoïc Hoguin
The stream handlers can be specified using the protocol option 'stream_handlers'. It defaults to [cowboy_stream_h]. The cowboy_stream_h module currently does not forward the calls to further stream handlers. It feels like an edge case; usually we'd want to put our own handlers between the protocol code and the request process. I am therefore going to focus on other things for now. The various types and specifications for stream handlers have been updated and the cowboy_stream module can now be safely used as a behavior. The interface might change a little more, though. This commit does not include tests or documentation. They will follow separately.
2017-01-04Make the new cowboy_req tests more realistic2.0.0-pre.5Loïc Hoguin
2017-01-04Improve the manual for the new resp_header functionsLoïc Hoguin
2017-01-04Add functions for getting and setting response headersJohan Lövdahl
2017-01-03Rewrite the tests for header name/value limitsLoïc Hoguin
Putting them in the correct test suite, with the proper documentation etc.
2017-01-03Return status 431 if the request header field is too largeJosé Valim
This commit changes Cowboy to follow RFC6585.
2017-01-03Update rebar.config2.0.0-pre.4Loïc Hoguin
2017-01-02Remove ROADMAP fileLoïc Hoguin
The only ROADMAP now is small fixes toward making it stable and very little interface changes, so the file is not that useful anymore.
2017-01-02Welcome to 2017Loïc Hoguin
2017-01-02Update Erlang.mkLoïc Hoguin
2017-01-02Update READMELoïc Hoguin
2017-01-02Remove AUTHORS fileLoïc Hoguin
Information can be found in cgit.
2017-01-02Remaining Dialyzer fixesLoïc Hoguin
2017-01-02Update Ranch to 1.3.0Loïc Hoguin
2017-01-02Numerous Dialyzer fixesLoïc Hoguin
2017-01-02Add a few more test cases for cowboy_req:match_qsLoïc Hoguin
2017-01-02Various fixes and tweaks to the user guideLoïc Hoguin
2016-12-28Add templates as Erlang.mk pluginLoïc Hoguin
2016-12-28Update the cowboy_rest manualLoïc Hoguin
2016-12-23Leave a few manual pages for post 2.0.0-pre.4Loïc Hoguin
In particular the cowboy_sub_protocol is subject to change soon. Also the cowboy_stream behavior is going to be left hidden in this release and enabled when it becomes easier to chain them.
2016-12-23Update cowboy_middlewareLoïc Hoguin
2016-12-23Update cowboy_loop manualLoïc Hoguin
2016-12-23Update the cowboy_handler manualLoïc Hoguin
Also fixes a small mistake in cowboy_websocket.
2016-12-23Update the cowboy_static manualLoïc Hoguin
2016-12-22Updates cowboy_http documents changelogSasan Hezarkhani
The changelog had a wrong reference to an option that was updated. `max_header_request_line_length` -> `max_request_line_length`
2016-12-22Update cowboy_websocket_manualLoïc Hoguin
2016-12-22Add the manual for cowboy_http2Loïc Hoguin
2016-12-22Add cowboy_http manualLoïc Hoguin
Updates and replaces the cowboy_protocol manual.
2016-12-22Update the cowboy_router manualLoïc Hoguin
2016-12-21Update CI release listLoïc Hoguin
2016-12-21Add man pages for the reply functionsLoïc Hoguin
2016-12-02Update Erlang.mkLoïc Hoguin
2016-12-02Add the man pages for body reading functionsLoïc Hoguin
[ci skip]
2016-11-07Add man pages for the parse/match/binding cowboy_req functionsLoïc Hoguin