Просмотр исходного кода

Merge branch 'fix/sendfile-error-handling' of git://github.com/soundrop/cowboy

Loïc Hoguin 12 лет назад
Родитель
Сommit
2a98ae05e3
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      src/cowboy_static.erl

+ 2 - 1
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}.