From 70c976bdd85bb8515fea01d6ad6074ef472fc2e0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 14 Nov 2015 02:47:24 +0000 Subject: reduce constant lookup dependencies Unicorn 5 removes some constants we were using, and constant lookups + inline caching are waste of time anyways on newer Rubies with the opt_str_freeze bytecode instruction. This may reduce performance for folks on older Rubies (probably not noticeable); but improves performance for folks on newer Rubies. --- lib/rainbows/error.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/rainbows/error.rb') diff --git a/lib/rainbows/error.rb b/lib/rainbows/error.rb index 736d5d8..3686eab 100644 --- a/lib/rainbows/error.rb +++ b/lib/rainbows/error.rb @@ -28,11 +28,11 @@ module Rainbows::Error Errno::EBADF, Errno::ENOTCONN, Errno::ETIMEDOUT, Errno::EHOSTUNREACH # swallow error if client shuts down one end or disconnects when Unicorn::HttpParserError - Rainbows::Const::ERROR_400_RESPONSE # try to tell the client they're bad + "HTTP/1.1 400 Bad Request\r\n\r\n" # try to tell the client they're bad when IOError # HttpParserError is an IOError else app(e) - Rainbows::Const::ERROR_500_RESPONSE + "HTTP/1.1 500 Internal Server Error\r\n\r\n" end end end -- cgit v1.2.3-24-ge0c7