Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix other places where we should use bytesize

  • Loading branch information...
commit e74b8621c6a3de77e6158615ae369595a6b2a73f 1 parent dcc93b0
@evanphx authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/puma/server.rb
View
10 lib/puma/server.rb
@@ -235,9 +235,9 @@ def process_client(client)
return
end
- nparsed += parser.body.size if cl
+ nparsed += parser.body.bytesize if cl
- if data.size > nparsed
+ if data.bytesize > nparsed
data.slice!(0, nparsed)
parser.reset
env = @proto_env.dup
@@ -293,7 +293,7 @@ def normalize_env(env, client)
if host = env[HTTP_HOST]
if colon = host.index(":")
env[SERVER_NAME] = host[0, colon]
- env[SERVER_PORT] = host[colon+1, host.size]
+ env[SERVER_PORT] = host[colon+1, host.bytesize]
else
env[SERVER_NAME] = host
env[SERVER_PORT] = PORT_80
@@ -371,7 +371,7 @@ def handle_request(env, client, body, cl)
no_body = false
if res_body.kind_of? Array and res_body.size == 1
- content_length = res_body[0].size
+ content_length = res_body[0].bytesize
end
cork_socket client
@@ -502,7 +502,7 @@ def handle_request(env, client, body, cl)
def read_body(env, client, body, cl)
content_length = cl.to_i
- remain = content_length - body.size
+ remain = content_length - body.bytesize
return StringIO.new(body) if remain <= 0
Please sign in to comment.
Something went wrong with that request. Please try again.