about summary refs log tree commit homepage
path: root/lib/unicorn
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-07-08 05:33:49 +0000
committerEric Wong <normalperson@yhbt.net>2010-07-08 05:36:18 +0000
commit5ece8c1c33f10e6496dfe5ae1d0d368293278d2d (patch)
tree2ba247c01f9f3a1de2fce758e85efabc931c6739 /lib/unicorn
parent1cd698f8c7938b1f19e9ba091708cb4515187939 (diff)
downloadunicorn-5ece8c1c33f10e6496dfe5ae1d0d368293278d2d.tar.gz
"[]" is slightly faster under Ruby 1.9 (but slightly
slower under 1.8).
Diffstat (limited to 'lib/unicorn')
-rw-r--r--lib/unicorn/http_request.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb
index 65b09fa..8c369cf 100644
--- a/lib/unicorn/http_request.rb
+++ b/lib/unicorn/http_request.rb
@@ -53,7 +53,7 @@ module Unicorn
       #  that client may be a proxy, gateway, or other intermediary
       #  acting on behalf of the actual source client."
       REQ[Const::REMOTE_ADDR] =
-                    TCPSocket === socket ? socket.peeraddr.last : LOCALHOST
+                    TCPSocket === socket ? socket.peeraddr[-1] : LOCALHOST
 
       # short circuit the common case with small GET requests first
       if PARSER.headers(REQ, socket.readpartial(Const::CHUNK_SIZE, BUF)).nil?