diff options
author | Loïc Hoguin <[email protected]> | 2013-01-05 20:19:43 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-01-05 20:19:43 +0100 |
commit | 58e89e218991a8d04108616620de9bb99dbeb7c0 (patch) | |
tree | 53e952bf5b17a351f8efee9533dd0616f0bde9f6 /test | |
parent | d8be610d4c68aa126afa952de4f134d68cc80636 (diff) | |
download | cowboy-58e89e218991a8d04108616620de9bb99dbeb7c0.tar.gz cowboy-58e89e218991a8d04108616620de9bb99dbeb7c0.tar.bz2 cowboy-58e89e218991a8d04108616620de9bb99dbeb7c0.zip |
Change the response body streaming fun interface
Before we were required to get the socket and transport ourselves,
now they're passed to the function.
Diffstat (limited to 'test')
-rw-r--r-- | test/http_handler_stream_body.erl | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/test/http_handler_stream_body.erl b/test/http_handler_stream_body.erl index feb4f78..15870a8 100644 --- a/test/http_handler_stream_body.erl +++ b/test/http_handler_stream_body.erl @@ -13,8 +13,7 @@ init({_Transport, http}, Req, Opts) -> {ok, Req, #state{headers=Headers, body=Body, reply=Reply}}. handle(Req, State=#state{headers=_Headers, body=Body, reply=set_resp}) -> - {ok, Transport, Socket} = cowboy_req:transport(Req), - SFun = fun() -> Transport:send(Socket, Body), sent end, + SFun = fun(Socket, Transport) -> Transport:send(Socket, Body) end, SLen = iolist_size(Body), Req2 = cowboy_req:set_resp_body_fun(SLen, SFun, Req), {ok, Req3} = cowboy_req:reply(200, Req2), |