From b04d465d65f896290d36538181d91dd264d10575 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 28 Mar 2010 17:35:10 -0700 Subject: cleanup: avoid redundant REMOTE_ADDR logic Every concurrency model does this the same way. This removes the Rainbows::Const::LOCALHOST constant and may break some existing apps that rely on it. --- lib/rainbows/ev_core.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/ev_core.rb') diff --git a/lib/rainbows/ev_core.rb b/lib/rainbows/ev_core.rb index 3d02b8a..682bdd6 100644 --- a/lib/rainbows/ev_core.rb +++ b/lib/rainbows/ev_core.rb @@ -14,7 +14,7 @@ module Rainbows ASYNC_CLOSE = "async.close".freeze def post_init - @remote_addr = ::TCPSocket === @_io ? @_io.peeraddr.last : LOCALHOST + @remote_addr = Rainbows.addr(@_io) @env = {} @hp = HttpParser.new @state = :headers # [ :body [ :trailers ] ] :app_call :close -- cgit v1.2.3-24-ge0c7