aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-03-23 01:26:47 +0100
committerLoïc Hoguin <[email protected]>2012-03-23 01:55:30 +0100
commit7b2793b344697eca3037d20e7beb809f1b41b089 (patch)
tree895807e0a4bf5beaf0a6e78bb72d58b6bef66ef4
parent7e745824324187ed7b4559bc7c4eb6e40e87567c (diff)
parent6e0b764e0abfdbdbf174032358d43fb50f05e504 (diff)
downloadcowboy-7b2793b344697eca3037d20e7beb809f1b41b089.tar.gz
cowboy-7b2793b344697eca3037d20e7beb809f1b41b089.tar.bz2
cowboy-7b2793b344697eca3037d20e7beb809f1b41b089.zip
Merge branch 'patch-1' of https://github.com/si14/cowboy
-rw-r--r--src/cowboy_http_static.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cowboy_http_static.erl b/src/cowboy_http_static.erl
index 007cd16..8b9f558 100644
--- a/src/cowboy_http_static.erl
+++ b/src/cowboy_http_static.erl
@@ -316,8 +316,10 @@ sfallback(Transport, Socket, File, Sent) ->
ok = file:close(File),
{sent, Sent};
{ok, Bin} ->
- ok = Transport:send(Socket, Bin),
- sfallback(Transport, Socket, File, Sent + byte_size(Bin))
+ case Transport:send(Socket, Bin) of
+ ok -> sfallback(Transport, Socket, File, Sent + byte_size(Bin));
+ {error, closed} -> {sent, Sent}
+ end
end.