Age | Commit message (Collapse) | Author |
|
Replaces the 'Connection' interpretation in cowboy_http_protocol
from raw value to the parsed value, looking for a single token
matching close/keep-alive instead of the whole raw value (which
could contain more than one token, for example with Firefox 6+
using websocket).
Introduce the functions cowboy_http_req:parse_header/2 and /3
to semantically parse the header values and return a proper
Erlang term.
|
|
|
|
Use the Req connection information instead.
|
|
And use a proper cowboy_http_req:reply/4 call for the 204 response.
|
|
|
|
The server should not send a response if there wasn't at least
the beginning of a request sent (the Request-Line).
|
|
Thanks to @nivertech for pointing it out in ticket #61.
|
|
Thanks to @klaar for pointing it out in ticket #59.
|
|
|
|
|
|
|
|
|
|
|
|
Making it look more like the websocket handler error messages.
|
|
|
|
|
|
|
|
The issue was that we were calling erlang:hibernate before a
receive .. after .. end call. Erlang hibernates the process before
reaching the receive instruction and we therefore couldn't enter
the after clause when hibernating.
This is now fixed by using erlang:send_after instead and receiving
that message instead of using an after clause.
|
|
Also improve the documentation about hibernate.
|
|
Krishnamurthy, Kristol, Mogul: "Key Differences between HTTP/1.0
and HTTP/1.1", "Internet address conservation".
http://www8.org/w8-papers/5c-protocols/key/key.html
Fixes issue #35 reported by Alex Kropivny.
|
|
Fixes issue #47.
|
|
Responses to the HEAD requests used to include an response body.
|
|
|
|
|
|
The implementation is only partial for now but should work for
all browsers implementing it.
|
|
To this end we are formatting the header names just like OTP does
except we do it for names of up to 32 characters, as there are
widely used header names of more than 20 characters, the limit that
OTP follows currently. An example of such header name would be
Sec-Websocket-Version.
The formatting itself is fairly simple: an uppercase character at
the start and after dashes, everything else lowercase.
|
|
Until calendar exports them at least.
|
|
Also sends a message 'shoot' that can be received by the protocol
to make sure Cowboy has had enough time to fully initialize the
socket. This message should be received before any socket-related
operations are performed.
WebSocket request connections are now moved from the pool 'default'
to the pool 'websocket', meaning we can have a lot of running
WebSockets despite having a low 'max_connections' setting.
|
|
Currently only supports limiting the maximum number of
connections by managing connection pools.
|
|
|
|
|
|
|
|
|
|
Based on Mochi Media, Inc.'s work in Mochiweb.
Conflicts:
rebar.config
|
|
This fixes issue #33.
|
|
Should be good for both GET and POST query strings.
This adds https://github.com/klaar/quoted.erl as a dependency.
Props to klaar for this code.
|
|
Improves the readability of websocket handler code by having
two functions: websocket_handle/3 handles the packets received
from the socket, removing the tuple construct that was otherwise
needed, so only websocket_handle(Data, Req, State) is needed now;
websocket_info/3 handles the messages that the websocket handler
process received, as websocket_info(Info, Req, State).
Both functions return values are handled identically by Cowboy
so nothing changes on that end.
|
|
Idea given by bfrog, fixes issue #34.
|
|
This ensures that an error thrown in handler_terminate/4 will be
shown after the error from handler_call/6, in the expected order.
As we already call WebSocketHandler:terminate/3, this should
fix issue #23.
|
|
This ensures we can cleanup what we did in Handler:init/3.
|
|
Fixes issue #31.
Recursion shouldn't happen in a single catch statement or inside
a try .. catch statement. The only safe construct for catching
exceptions and perform recursion when everything goes well is
to put the recursive call inside a try .. of .. catch construct
in the of .. catch block.
Otherwise the stack gets filled with exception-related information
since they can still be caught if we were to send them and unfold
the whole thing.
Thanks go to lpgauth for reporting the issue and people on IRC
for explaining the hows and whys.
|
|
This is probably not perfect yet but it should be better than
nothing. We'll improve things with feedback received from the
many users.
|
|
|
|
Found thanks to warn_missing_spec and added with the help of typer.
Eunit functions do not have specs yet however.
|
|
Browsers get mad that the returned location address is not the same
as what they sent, since the :(80|443) is stripped.
Add a simple eunit test due to existing ct websockets tests not
covering this case.
|
|
|
|
Just a change in the order of arguments of update_rfc1123.
|
|
Return {ok, Req, State, hibernate}
or {reply, Data, Req, State, hibernate} to hibernate the websocket
process and save up memory and CPU. You should hibernate processes
that will receive few messages. So probably most of them.
|
|
|
|
|