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:
parent
e13d9ba9e9
commit
a3aefc1c51
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue