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

283 commits

Author SHA1 Message Date
Loïc Hoguin
49af57d546
Implement backpressure on cowboy_req:stream_body
This should limit the amount of memory that Cowboy is using
when a handler is sending data much faster than the network.

The new max_stream_buffer_size is a soft limit and only has
an effect when the cowboy_stream_h handler is used.
2019-09-14 18:21:05 +02:00
Loïc Hoguin
42eb6bae69
Fix using custom fields in Req 2019-09-06 12:25:02 +02:00
Loïc Hoguin
d14c59d905
Document unit for options that are in bytes 2019-09-06 11:53:19 +02:00
Alastair Hole
bbf36a2ac0
Minor grammar correction
Noun 'setup' -> verb phrase 'set up'
2019-09-05 17:15:13 +02:00
Loïc Hoguin
48f417ac8f
Fix and optimize sending of WINDOW_UPDATE frames
For long-running connections it was possible for the connection
window to become larger than allowed by the protocol because the
window increases claimed by stream handlers were never reclaimed
even if no data was consumed.

The new code applies heuristics to fix this and reduce the number
of WINDOW_UPDATE frames that are sent. It includes six new options
to control that behavior: margin, max and threshold for both the
connection and stream windows. The margin is some extra space
added on top of the requested read size. The max is the maximum
window size at any given time. The threshold is a minimum window
size that must be reached before we even consider sending more
WINDOW_UPDATE frames. We also avoid sending WINDOW_UPDATE frames
when there is already enough space in the window, or when the
read size is 0.

Cowlib is set to master until a new tag is done.
2019-09-05 14:07:38 +02:00
Loïc Hoguin
5829f1b9ac
Add more related specs 2019-07-22 10:41:04 +02:00
Loïc Hoguin
504c7c55f7
Add two related specs 2019-07-12 10:46:49 +02:00
Loïc Hoguin
dfeec3b74a
Add two new RFCs to the list 2019-05-27 13:43:01 +02:00
Loïc Hoguin
3030c2d5c9
Fix a few examples using cert instead of certfile 2019-05-13 11:25:00 +02:00
Loïc Hoguin
8875b07b37
Add RFC 8586 2019-04-24 20:24:23 +02:00
Loïc Hoguin
d846827b2a
Cowboy 2.6.3 2019-04-05 11:09:55 +02:00
Loïc Hoguin
d5489b4c73
Cowboy 2.6.2
Updates Cowlib to 2.7.2.
2019-04-04 11:23:50 +02:00
Loïc Hoguin
21d267a44a
Describe what star represent in the REST flowcharts 2019-04-03 14:08:53 +02:00
Ginetom
cd9b04792c
Clarify what the private directory is 2019-04-03 13:48:57 +02:00
Jesper Louis Andersen
b86e2839bc
Fix calling convention for set_resp_cookie/3
If not providing optional values, they are set to `#{}` and
are the last parameter according to the source code. Reflect
this in the documentation.
2019-04-02 15:40:05 +02:00
Loïc Hoguin
9edfef34b2
Add this year's April Fool's RFC 2019-04-02 11:03:55 +02:00
Loïc Hoguin
459fc959b4
Add a related RFC 2019-03-25 20:27:20 +01:00
Loïc Hoguin
e0254cdcb0
Cowboy 2.6.1 2018-11-28 12:15:17 +01:00
Loïc Hoguin
6cc3b0ccca
Document cowboy_stream_h/cowboy_compress_h 2018-11-18 23:03:30 +01:00
Loïc Hoguin
8d6d78575f
Add the chunked option for HTTP/1.1
It allows disabling the chunked transfer-encoding. It
can also be disabled on a per-request basis, although
it will be ignored for responses that are not streamed.
2018-11-18 13:25:12 +01:00
Loïc Hoguin
417032a445
Prepare the Cowboy 2.6 release 2018-11-17 13:36:14 +01:00
Loïc Hoguin
8185d356c5
Add the idle_timeout option to HTTP/2 2018-11-16 16:30:57 +01:00
Loïc Hoguin
dba17fdddb
Document using undefined as content_types_provided callback
This is a convention that indicates the callback will never
be called, for example because the methods HEAD or GET are
not accepted.
2018-11-14 18:04:32 +01:00
Loïc Hoguin
15fb3187f5
Add some missing items to a few module changelogs 2018-11-14 18:04:32 +01:00
Loïc Hoguin
6f57405b5c
Allow disabling keep-alive for HTTP/1.0 connections 2018-11-14 18:04:32 +01:00
Loïc Hoguin
f0cae8dbcf
Document some undefined behavior in cowboy_router 2018-11-14 18:04:32 +01:00
Loïc Hoguin
c65e3ff20e
Add a use case to loop handlers 2018-11-14 18:04:31 +01:00
Loïc Hoguin
ef05956a5a
Document the proxy_header protocol option 2018-11-14 12:32:31 +01:00
Loïc Hoguin
8164b50453
Add deflate options for Websocket compression
They allow the server to configure what it is willing to accept
for both the negotiated configuration (takeover and window bits)
and the other zlib options (level, mem_level and strategy).

This can be used to reduce the memory and/or CPU footprint of
the compressed data, which comes with a cost in compression ratio.
2018-11-12 18:12:44 +01:00
Loïc Hoguin
d7b7580b39
Add sendfile support to cowboy_req:stream_body
It is now possible to stream one or more sendfile tuples.
A simple example of what can now be done would be for
example to build a tar file on the fly using the sendfile
syscall for sending the files, or to support Range requests
with more than one range with the sendfile syscall.

When using cowboy_compress_h unfortunately we have to read
the file in order to send it. More options will be added
at a later time to make sure users don't read too much
into memory. This is a new feature however so existing
code is not affected.

Also rework cowboy_http's data sending to be flatter.
2018-11-09 17:42:37 +01:00
Loïc Hoguin
805a156785
Test stop against all relevant REST callbacks 2018-11-05 10:30:26 +01:00
Loïc Hoguin
8c9ad7bf07
Add the rate_limited/2 REST callback 2018-11-04 11:58:59 +01:00
Loïc Hoguin
be09711687
Add an option to disable sendfile for a listener 2018-11-03 18:55:40 +01:00
Loïc Hoguin
571719a164
Add a charset option to cowboy_static 2018-11-02 15:36:41 +01:00
Loïc Hoguin
9569043bdd
Add RFC6657 to the list of related documents 2018-11-02 14:04:32 +01:00
Loïc Hoguin
e0b036fe68
Add tests for charsets_provided
Fix cases where the q-value is 0 and where a wildcard
was sent in the accept-charset header.

Also don't send a charset in the content-type of the
response if the media type is not text.

Thanks to Philip Witty for help figuring this out.
2018-11-02 13:54:19 +01:00
Loïc Hoguin
399b6a16b4
Better handle content negotiation when accept contains charsets
Thanks to Philip Witty for help figuring this out.
2018-11-02 13:49:54 +01:00
Loïc Hoguin
d4129e6305
Exit gracefully on parent exit/sys:terminate/2,3 2018-10-28 10:20:43 +01:00
Loïc Hoguin
497e9d459e
Add yet another RFC to the list 2018-10-26 10:15:41 +02:00
Loïc Hoguin
c998673eb0
Fix Cowboy version in the getting started chapter 2018-10-02 10:05:40 +02:00
getong
4493afbba0
Update Ranch to 1.6.2 2018-09-23 14:24:37 +02:00
Loïc Hoguin
8045f7a998
Add a spec to the list 2018-09-23 14:11:28 +02:00
Loïc Hoguin
9901a3b568
Update Cowlib to 2.6.0 2018-09-21 15:12:58 +02:00
Loïc Hoguin
f810d8dd64
Add the {active, boolean()} Websocket command
This command is currently not documented. It allows disabling
the reading of incoming data from the socket, and can be used
as a poor man's flow control.
2018-09-21 15:01:57 +02:00
Loïc Hoguin
6e784f1a45
Remove an outdated note about cowboy_loop timeout 2018-09-20 15:57:15 +02:00
Loïc Hoguin
9f401f8899
Add RFC 8441 to the list 2018-09-19 09:14:58 +02:00
Loïc Hoguin
b56a5a1d60
Do not send a 101 after a final response in switch_protocol 2018-09-12 16:16:29 +02:00
Loïc Hoguin
26bc4afad4
Prepare the 2.5.0 release 2018-09-12 15:00:48 +02:00
Loïc Hoguin
4b385749f2
Add cowboy_req:read_and_match_urlencoded_body/2,3 2018-09-07 13:56:12 +02:00
Loïc Hoguin
dcc6f9326f
Fix some grammatical errors in the manual 2018-09-07 13:53:12 +02:00