Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change 'size' to 'bytesize' in worker.rb

  • Loading branch information...
commit edb247e6ce82a3fce9d24641b1b02dde0e370e56 1 parent dfcf950
@kkiselev kkiselev authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 priv/worker.rb
View
8 priv/worker.rb
@@ -63,7 +63,7 @@ def handle_request(app, env)
$stderr.puts status.inspect, headers.inspect, body.inspect
packed_body = if body.respond_to?(:to_path) # file
- [1, body.to_path.size, body.to_path].pack("CNa*")
+ [1, body.to_path.bytesize, body.to_path].pack("CNa*")
else
ary = []
@@ -73,17 +73,17 @@ def handle_request(app, env)
t = ary.join("")
- [0, t.size, t].pack("CNa*")
+ [0, t.bytesize, t].pack("CNa*")
end
body.close if body.respond_to?(:close)
packed = [status, headers.length].pack("NN") +
- headers.map {|key,value| [key.size, key, value.to_s.size, value.to_s].pack("Na*Na*")}.join("") +
+ headers.map {|key,value| [key.bytesize, key, value.to_s.bytesize, value.to_s].pack("Na*Na*")}.join("") +
packed_body
- OUTPUT.write([packed.size].pack("N"))
+ OUTPUT.write([packed.bytesize].pack("N"))
OUTPUT.write(packed)
OUTPUT.flush
end
Please sign in to comment.
Something went wrong with that request. Please try again.