aboutsummaryrefslogtreecommitdiffstats
path: root/test/websocket_handler_init_shutdown.erl
AgeCommit message (Collapse)Author
2013-01-22Replace terminate/2 with terminate/3, adding a ReasonLoïc Hoguin
This should have been done a *long* time ago, back when I initially added Websocket support. This is the first part of two in improving loop handler support with regards to socket closure. Reason may include: {normal, shutdown} for the most normal shutdown, {normal, timeout} for a loop handler timeout shutdown, or {error, _} if an error occured.
2012-08-27Rename cowboy_http_websocket to cowboy_websocketLoïc Hoguin
2012-08-27Rename cowboy_http_req to cowboy_reqLoïc Hoguin
2012-08-27Update behaviours for R15B+Loïc Hoguin
This effectively drops the R14B compatibility. The cowboy_req:req() type will be introduced in a future commit. It refers to the #http_req{} record.
2011-11-28Fix a websocket test handler that was throwing an unwanted errorLoïc Hoguin
The test still worked because we expect the websocket connection to fail, but it didn't fail exactly the way we wanted it to.
2011-10-13Add shortcuts to reply functionsLoïc Hoguin
New functions are reply/2, reply/3, chunked_reply/2 in cowboy_http_req.
2011-10-10Add {shutdown, Req} to websocket_init/3 to fail a websocket upgradeLoïc Hoguin
This change allows application developers to refuse websocket upgrades by returning {shutdown, Req}. The application can also send a reply with a custom error before returning from websocket_init/3, otherwise an error 400 is sent. Note that right now Cowboy closes the connection immediately. Also note that neither terminate/3 nor websocket_terminate/3 will be called when the connection is shutdown by websocket_init/3.