nekipelov / httpparser

HTTP request, response and urls parser
MIT License
117 stars 36 forks source link

clear request/response parser state before starting #4

Closed mghhimu closed 4 years ago

mghhimu commented 4 years ago

Currently, the parser retains the parser state, so no matter how many times you call consume, it will always start with the last state of the first call

nekipelov commented 4 years ago

Yep. This is because we receive data in chunks over the network. One request is processed by multiple calls consume. To clear the state, create a new parser instance for the next request.