From 07846bcac6604babf0dd1f296d99c148b63340d6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 5 Feb 2009 14:33:43 -0800 Subject: HttpResponse: remove send_file --- lib/unicorn/http_response.rb | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'lib/unicorn/http_response.rb') diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb index 7454516..f4b30fd 100644 --- a/lib/unicorn/http_response.rb +++ b/lib/unicorn/http_response.rb @@ -107,27 +107,6 @@ module Unicorn end end - # Appends the contents of +path+ to the response stream. The file is opened for binary - # reading and written in chunks to the socket. - # - # Sendfile API support has been removed in 0.3.13.4 due to stability problems. - def send_file(path, small_file = false) - if small_file - File.open(path, "rb") {|f| @socket << f.read } - else - File.open(path, "rb") do |f| - while chunk = f.read(Const::CHUNK_SIZE) and chunk.length > 0 - begin - write(chunk) - rescue Object => exc - break - end - end - end - end - @body_sent = true - end - def socket_error(details) # ignore these since it means the client closed off early @socket.close rescue nil -- cgit v1.2.3-24-ge0c7