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/fiber/rev.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/fiber') diff --git a/lib/rainbows/fiber/rev.rb b/lib/rainbows/fiber/rev.rb index bd9638f..a733103 100644 --- a/lib/rainbows/fiber/rev.rb +++ b/lib/rainbows/fiber/rev.rb @@ -80,7 +80,7 @@ module Rainbows::Fiber hp = HttpParser.new env = {} alive = true - remote_addr = TCPSocket === io ? io.peeraddr.last : LOCALHOST + remote_addr = Rainbows.addr(io) begin # loop buf << (client.read_timeout or return) until hp.headers(env, buf) -- cgit v1.2.3-24-ge0c7