diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-07-08 05:33:49 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-07-08 05:36:18 +0000 |
commit | 5ece8c1c33f10e6496dfe5ae1d0d368293278d2d (patch) | |
tree | 2ba247c01f9f3a1de2fce758e85efabc931c6739 /lib/unicorn/http_request.rb | |
parent | 1cd698f8c7938b1f19e9ba091708cb4515187939 (diff) | |
download | unicorn-5ece8c1c33f10e6496dfe5ae1d0d368293278d2d.tar.gz |
"[]" is slightly faster under Ruby 1.9 (but slightly slower under 1.8).
Diffstat (limited to 'lib/unicorn/http_request.rb')
-rw-r--r-- | lib/unicorn/http_request.rb | 2 |
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? |