# File lib/ftw/webserver.rb, line 44 def handle_connection(connection) while true begin request = read_http_message(connection) rescue EOFError, Errno::EPIPE, Errno::ECONNRESET, HTTP::Parser::Error, IOError # Connection EOF'd or errored before we finished reading a full HTTP # message, shut it down. break rescue FTW::HTTP::Message::UnsupportedHTTPVersion break end if request["Content-Length"] || request["Transfer-Encoding"] request.body = connection end begin handle_request(request, connection) rescue => e puts e.inspect puts e.backtrace raise e end end connection.disconnect("Fun") end