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/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/base.rb') diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb index a29a5bb..a9314ee 100644 --- a/lib/rainbows/base.rb +++ b/lib/rainbows/base.rb @@ -36,7 +36,7 @@ module Rainbows hp = HttpParser.new env = {} alive = true - remote_addr = TCPSocket === client ? client.peeraddr.last : LOCALHOST + remote_addr = Rainbows.addr(client) begin # loop while ! hp.headers(env, buf) -- cgit v1.2.3-24-ge0c7