0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Do not crash if connection times out while sending a file using sendfile

This commit is contained in:
Ali Sabil 2013-03-07 14:06:58 +01:00
parent e16fae1196
commit 83876c3e33

View file

@ -324,7 +324,8 @@ file_contents(Req, #state{filepath=Filepath,
%% if the connection is closed while sending the file.
case Transport:sendfile(Socket, Filepath) of
{ok, _} -> ok;
{error, closed} -> ok
{error, closed} -> ok;
{error, etimedout} -> ok
end
end,
{{stream, Filesize, Writefile}, Req, State}.