index('GET', [], Context) ->
timer:sleep(3000),
{ok, Context}.
It built response completely even request was canceled at client-side
{response,200,[
{header,"Content-Language","en"},
{header,"Set-Cookie","csrf_token=SRRQPPONMLLI; Version=1; Expires=Mon, 27-Jan-2014 17:01:55 GMT; Max-Age=525600; Path=/"},
{header,"Set-Cookie","_boss_session=f5fb29155ac748ab81e40e5a74fd08a8c5d5f6ba; Version=1; Expires=Mon, 27-Jan-2014 17:01:55 GMT; Max-Age=525600; Path=/"},{header,"Content-Type","text/html"}],
[],
{data,[<<"bla bla bla">>]}})
(
in boss_web_controller_handle_request, it calls
handle_request/3,
handle_result/6,
build)dynamic_response/4,
handle_response/4,
then simple_bridge_response_wrapper:build_response/0,
then mochiweb_response_bridge:build_response/2
Here I don't understand why it didn't call cowboy_response_bridge:build_response/2. I define cowboy in boss.config
)
then there are error messages from cowboy
[error] Error in process <0.273.0> on node 'r2d2@localhost' with exit value: {{case_clause,closed},[{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,529}]}]}
[error] Ranch listener boss_http_listener had connection process started with cowboy_protocol:start_link/4 at <0.273.0> exit with reason: {{case_clause,closed},[{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,529}]}]}
(
I don't know where CB uses cowboy, so I don't know to print debug
)