ikreymer/pywb — pull request #7 by jcushman (2014-01-22 01:05:43+00:00)
Title: Robust chunked data exception handling.

OK, I way overcomplicated the chunked data thing this morning. Here's a robust parsing approach that doesn't mess around with pattern matching. Basically: if at any point while parsing a chunk it stops looking like chunked data, throw it all in the buffer and treat it as an ordinary LineReader. But if we just run out of data while parsing, assume the file was cut off at some point, and treat it as chunked data that's just missing its end.

Still a little complicated, but I think the doctests are all intuitive outcomes.