aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_loop.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-03-06 18:09:43 +0100
committerLoïc Hoguin <[email protected]>2016-03-06 18:09:43 +0100
commit0193538dbafd275f543bfbce1065358ea6554641 (patch)
treea1cc93696152465eebedf03b88b8ea5b7c040c89 /src/cowboy_loop.erl
parent7bdd710849a35c12afe3f91bc5df4006db4c0282 (diff)
downloadcowboy-0193538dbafd275f543bfbce1065358ea6554641.tar.gz
cowboy-0193538dbafd275f543bfbce1065358ea6554641.tar.bz2
cowboy-0193538dbafd275f543bfbce1065358ea6554641.zip
Fix warnings
Diffstat (limited to 'src/cowboy_loop.erl')
-rw-r--r--src/cowboy_loop.erl34
1 files changed, 1 insertions, 33 deletions
diff --git a/src/cowboy_loop.erl b/src/cowboy_loop.erl
index e162417..dc07e13 100644
--- a/src/cowboy_loop.erl
+++ b/src/cowboy_loop.erl
@@ -121,45 +121,13 @@ timeout(State=#state{timeout=Timeout,
-spec loop(Req, #state{}, module(), any())
-> {ok, Req, cowboy_middleware:env()} | {suspend, module(), atom(), [any()]}
when Req::cowboy_req:req().
-loop(Req, State=#state{buffer_size=NbBytes,
- max_buffer=Threshold, timeout_ref=TRef,
- resp_sent=RespSent}, Handler, HandlerState) ->
-% [Socket, Transport] = cowboy_req:get([socket, transport], Req),
-% {OK, Closed, Error} = Transport:messages(),
+loop(Req, State=#state{timeout_ref=TRef}, Handler, HandlerState) ->
receive
-% {OK, Socket, Data} ->
-% NbBytes2 = NbBytes + byte_size(Data),
-% if NbBytes2 > Threshold ->
-% _ = if RespSent -> ok; true ->
-% cowboy_req:reply(500, Req)
-% end,
-% cowboy_handler:terminate({error, overflow}, Req, HandlerState, Handler),
-% exit(normal);
-% true ->
-% Req2 = cowboy_req:append_buffer(Data, Req),
-% State2 = timeout(State#state{buffer_size=NbBytes2}),
-% before_loop(Req2, State2, Handler, HandlerState)
-% end;
-% {Closed, Socket} ->
-% terminate(Req, State, Handler, HandlerState, {error, closed});
-% {Error, Socket, Reason} ->
-% terminate(Req, State, Handler, HandlerState, {error, Reason});
{timeout, TRef, ?MODULE} ->
after_loop(Req, State, Handler, HandlerState, timeout);
{timeout, OlderTRef, ?MODULE} when is_reference(OlderTRef) ->
loop(Req, State, Handler, HandlerState);
Message ->
- %% We set the socket back to {active, false} mode in case
- %% the handler is going to call recv. We also flush any
- %% data received after that and put it into the buffer.
- %% We do not check the size here, if data keeps coming
- %% we'll error out on the next packet received.
-% Transport:setopts(Socket, [{active, false}]),
-% Req2 = receive {OK, Socket, Data} ->
-% cowboy_req:append_buffer(Data, Req)
-% after 0 ->
-% Req
-% end,
call(Req, State, Handler, HandlerState, Message)
end.