diff options
author | Eric Wong <e@yhbt.net> | 2011-01-17 03:17:28 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-01-17 09:18:31 +0000 |
commit | 2c913347a6e5cc8be776b14e1a177adec0fbd5b6 (patch) | |
tree | 8d001fa557ef23c66bc56aa6c2fba943e428382e /lib/metropolis/tc/hdb.rb | |
parent | 34a18520286313a05edc9a927ac4bed95b05191c (diff) | |
download | metropolis-2c913347a6e5cc8be776b14e1a177adec0fbd5b6.tar.gz |
use constants everywhere to reduce GC thrashing
This makes it easier to notice a typo, too.
Diffstat (limited to 'lib/metropolis/tc/hdb.rb')
-rw-r--r-- | lib/metropolis/tc/hdb.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/metropolis/tc/hdb.rb b/lib/metropolis/tc/hdb.rb index e63b015..6ba6f85 100644 --- a/lib/metropolis/tc/hdb.rb +++ b/lib/metropolis/tc/hdb.rb @@ -95,15 +95,15 @@ module Metropolis::TC::HDB end def put(key, env) - value = env["rack.input"].read + value = env[Rack_Input].read writer(key) do |hdb| - case env['HTTP_X_TT_PDMODE'] - when '1' + case env[HTTP_X_TT_PDMODE] + when "1" unless hdb.putkeep(key, value) TCHDB::EKEEP == hdb.ecode and return r(409) ex!(:putkeep, hdb) end - when '2' + when "2" hdb.putcat(key, value) or ex!(:putcat, hdb) else # ttserver does not care for other PDMODE values, so we don't, either @@ -131,7 +131,7 @@ module Metropolis::TC::HDB ex!(:get, hdb) end end - [ 200, { 'Content-Length' => value.size.to_s }.merge!(@headers), [ value ] ] + [ 200, { Content_Length => value.size.to_s }.merge!(@headers), [ value ] ] end def close! |