=htc #17683 drop already consumed input in continue
This commit is contained in:
parent
8527e0347e
commit
a26670a58e
1 changed files with 3 additions and 1 deletions
|
|
@ -252,7 +252,9 @@ private[http] abstract class HttpMessageParser[Output >: MessageOutput <: Parser
|
|||
def continue(input: ByteString, offset: Int)(next: (ByteString, Int) ⇒ StateResult): StateResult = {
|
||||
state =
|
||||
math.signum(offset - input.length) match {
|
||||
case -1 ⇒ more ⇒ next(input ++ more, offset)
|
||||
case -1 ⇒
|
||||
val remaining = input.drop(offset)
|
||||
(more ⇒ next(remaining ++ more, 0))
|
||||
case 0 ⇒ next(_, 0)
|
||||
case 1 ⇒ throw new IllegalStateException
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue