From 83876c3e33deaaa4c5fb99ff90b9d4bcaac91ade Mon Sep 17 00:00:00 2001 From: Ali Sabil Date: Thu, 7 Mar 2013 14:06:58 +0100 Subject: Do not crash if connection times out while sending a file using sendfile --- src/cowboy_static.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cowboy_static.erl b/src/cowboy_static.erl index d583fa9..fe6600c 100644 --- a/src/cowboy_static.erl +++ b/src/cowboy_static.erl @@ -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}. -- cgit v1.2.3