Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpParser and multiple concatenated HTTP responses #44

Open
mejedi opened this issue Mar 14, 2014 · 2 comments
Open

HttpParser and multiple concatenated HTTP responses #44

mejedi opened this issue Mar 14, 2014 · 2 comments

Comments

@mejedi
Copy link

mejedi commented Mar 14, 2014

Hi!

If my understanding is correct HttpParser.execute returns the number of bytes consumed, hence it is possible to parse multiple concatenated HTTP responses by checking is_message_complete() and starting a new parser from the same very position the last one stopped.

However the observed behavior is very different: execute() happily consumes the whole string, the subsequent responses text ends up in the message body and _clen_rest is negative.

@benoitc
Copy link
Owner

benoitc commented Mar 20, 2014

Do you mean in case of pipelined requests?

@mejedi
Copy link
Author

mejedi commented Mar 20, 2014

Precisely.

Actually I am working on a weird task motivated by the needs of a network analysis tool. I am looking for HTTP message boundaries in opaque byte streams.

Currently I ended up using the modified parser from httplib + eventlet so that the script can do other things while waiting for more data to arrive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants