Age | Commit message (Collapse) | Author |
|
Middlewares allow customizing the request processing.
All existing Cowboy project are incompatible with this commit.
You need to change `{dispatch, Dispatch}` in the protocol options
to `{env, [{dispatch, Dispatch}]}` to fix your code.
|
|
This commit prevents erlang messages from keeping a websocket connection
alive. Previously, the timer was canceled upon any activity. Now, the
timeout is only canceled when actual data is sent from the client. The
handler_loop_timeout/1 function is called from websocket_data/4 instead
of handler_before_loop/4. It is also called after every successful reply
in handler_call/4.
|
|
The purpose of this patch is to make the arguments cowboy passes to
error_logger more consistent. With this patch there's only 3 variations
on the error_logger argument list; a 5 element list, an 8 element list
and a 10 element list. In all cases, the first 3 arguments are the
Module, Function and Arity of the function being called and the
second-to-last argument is always the Request. Additionally, for lists
longer than 5 elements, the last argument is always the stack-trace.
The added consistency of the argument ordering makes it much easier to
write code in lager's error_logger handler to catch these messages and
write a pretty one-liner (while writing the full message to the
crash.log).
|
|
|
|
|
|
|
|
|
|
We can now reply empty close, ping and pong frames, or close
frames with a payload.
This means that we can send a frame and then close the connection
in a single operation.
If a close packet is sent, the connection is closed immediately,
even if there was frames that remained to be sent. Cowboy will
silently drop any extra frames in the list given as a reply.
|
|
|
|
In some situations, the underlying socket might become "half-open" in
which case the websocket will stay in a waiting state indefinitely. The
detection of this state requires checking for errors when calling send.
|
|
Instead of returning {text, Data}, you can now return
[{text, Data}, {text, Data2}, ...].
|
|
As suggested by @prof3ta.
|
|
Header names are now binaries. Since header names are case insensitive
they are all converted to lowercase. For example: <<"content-length">>.
The max_line_length option was removed. Three new options have been
added instead:
* max_request_line_length (defaults to 4096)
* max_header_name_length (defaults to 64)
* max_header_value_length (defaults to 4096)
|
|
The signature of parse_header, body_qs, multipart_data and
the set_resp_* functions has changed.
See the cowboy_req module edoc for more details.
|
|
|
|
|
|
Use it in cowboy_websocket for hixie76, replacing http by ws.
|
|
Do this by checking whether we received the resp_sent message.
|
|
As part of the work to make cowboy_req:req() opaque.
|
|
Removes a lot of duplicate code when printing error messages.
|
|
|
|
This removes cowboy_static's dependency on http.hrl.
|
|
The latter is much more useful than the former, which ends up
being removed.
|
|
The latter is much more useful than the former, which ends up
being removed.
|
|
|