extend/cowboy_examples — Issue #4: Crash when requesting http://localhost:8080/eventsource
Author: barcoyou
Created: 2012-02-20 05:53:20+00:00
State: open

=ERROR REPORT==== 20-Feb-2012::13:46:03 ===
** Handler eventsource_emitter terminating in handle/2
for the reason error:badarg
** Options were []
** Handler state was undefined
** Request was {http_req,#Port<0.1884>,cowboy_tcp_transport,keepalive,
<0.381.0>,'GET',
{1,1},
undefined,
[<<"localhost">>],
undefined,<<"localhost">>,8080,
[<<"eventsource">>,<<"live">>],
undefined,<<"/eventsource/live">>,undefined,<<>>,[],
[{'Accept-Charset',<<"ISO-8859-1,utf-8;q=0.7,*;q=0.3">>},
{'Accept-Language',<<"en-US,en;q=0.8">>},
{'Accept-Encoding',<<"gzip,deflate,sdch">>},
{'Referer',<<"http://localhost:8080/eventsource">>},
{'Cache-Control',<<"no-cache">>},
{'Accept',<<"text/event-stream">>},
{'User-Agent',
<<"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.21 (KHTML, like Gecko) Chrome/19.0.1041.0 Safari/535.21">>},
{'Connection',<<"keep-alive">>},
{'Host',<<"localhost">>}],
[{'Connection',[<<"keep-alive">>]}],
undefined,[],waiting,<<>>,waiting,[],<<>>,
{#Fun,crash}}
** Stacktrace: [{erlang,iolist_size,
[["id: ","4B95ECC087EB4","\ndata: ",
{cowboy_http_req,resp_sent},
"\n\n"]],
[]},
{cowboy_http_req,chunk,2,
[{file,"src/cowboy_http_req.erl"},
{line,595}]},
{eventsource_emitter,handle_loop,2,
[{file,"src/eventsource_emitter.erl"},
{line,23}]},
{cowboy_http_protocol,handler_handle,3,
[{file,"src/cowboy_http_protocol.erl"},
{line,271}]}]