# File lib/mongrel.rb, line 405 405: def send_file(path) 406: File.open(path, "rb") do |f| 407: if @socket.respond_to? :sendfile 408: begin 409: @socket.sendfile(f) 410: rescue => details 411: socket_error(details) 412: end 413: else 414: while chunk = f.read(Const::CHUNK_SIZE) and chunk.length > 0 415: write(chunk) 416: end 417: end 418: @body_send = true 419: end 420: end