1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Don't accidentally replay requests over and over

Client#reset uses the presence of @buffer to detect if there is a
partial next request available. Thusly we have to be sure to nil it out
after we use @buffer otherwise we'll accidentally replay the request
over and over again.
This commit is contained in:
Evan Phoenix 2012-07-24 10:59:04 -07:00
parent e13d9ba9e9
commit a3aefc1c51

View file

@ -70,6 +70,7 @@ module Puma
if remain <= 0
@body = StringIO.new(body)
@buffer = nil
@ready = true
return true
end
@ -137,6 +138,7 @@ module Puma
# No chunk means a closed socket
unless chunk
@body.close
@buffer = nil
@ready = true
raise EOFError
end
@ -145,6 +147,7 @@ module Puma
if remain <= 0
@body.rewind
@buffer = nil
@ready = true
return true
end