aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAli Sabil <[email protected]>2013-03-07 14:06:58 +0100
committerAli Sabil <[email protected]>2013-04-08 21:21:26 +0200
commit83876c3e33deaaa4c5fb99ff90b9d4bcaac91ade (patch)
treed7b14553ddfcf5d8708fba088184544ea21f7a50
parente16fae1196e3c8533c7ab60a6084063f4ee9f532 (diff)
downloadcowboy-83876c3e33deaaa4c5fb99ff90b9d4bcaac91ade.tar.gz
cowboy-83876c3e33deaaa4c5fb99ff90b9d4bcaac91ade.tar.bz2
cowboy-83876c3e33deaaa4c5fb99ff90b9d4bcaac91ade.zip
Do not crash if connection times out while sending a file using sendfile
-rw-r--r--src/cowboy_static.erl3
1 files changed, 2 insertions, 1 deletions
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}.