aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/hpack/context.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plum/hpack/context.rb')
-rw-r--r--lib/plum/hpack/context.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/plum/hpack/context.rb b/lib/plum/hpack/context.rb
index 71f07cb..d15249a 100644
--- a/lib/plum/hpack/context.rb
+++ b/lib/plum/hpack/context.rb
@@ -16,8 +16,9 @@ module Plum
end
def store(name, value)
+ value = value.to_s
@dynamic_table.unshift([name, value])
- @size += name.bytesize + value.to_s.bytesize + 32
+ @size += name.bytesize + value.bytesize + 32
evict
end
@@ -34,7 +35,7 @@ module Plum
end
def search(name, value)
- pr = proc {|n, v|
+ pr = proc { |n, v|
n == name && (!value || v == value)
}
@@ -47,7 +48,7 @@ module Plum
def evict
while @limit && @size > @limit
name, value = @dynamic_table.pop
- @size -= name.bytesize + value.to_s.bytesize + 32
+ @size -= name.bytesize + value.bytesize + 32
end
end
end