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:40:47 +0000 |
commit | 6ea71159e2557eca51d2388f07ab552c69a44dd7 (patch) | |
tree | 99164e633ebf8eccf57e724c8a1a82702bbfca93 /lib/unicorn/http_request.rb | |
parent | 4fa17dfb4adef0945d73e692147a3302b8dd9b74 (diff) | |
download | unicorn-6ea71159e2557eca51d2388f07ab552c69a44dd7.tar.gz |
"[]" is slightly faster under Ruby 1.9 (but slightly slower under 1.8). (cherry picked from commit 5ece8c1c33f10e6496dfe5ae1d0d368293278d2d)
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? |