Message197950
Ok, I'm adding a more comprehensive patch. It adds support for
peek, readline, and read1 for both regular and chunked responses.
readline falls back to IOBase.readline for chunked, which again makes use of peek() for performance.
read1() is available for other kinds of client buffering, e.g. when reading the stream incrementally using other delimiters than newline.
The real work is done by the _read1_or_peek_chunked() method. the code for both cases is almost identical so a dual purpose method is warranted.
Added test cases to test this. The test cases don't attempt to test that we don't block on partial resopnses, though. I'm not sure how I would write such a test. I'd probably have to extend FakeSocket to work on some stream that can be appended to... |
|
Date |
User |
Action |
Args |
2013-09-16 22:29:01 | kristjan.jonsson | set | recipients:
+ kristjan.jonsson, orsenthil, pitrou, r.david.murray, serhiy.storchaka |
2013-09-16 22:29:01 | kristjan.jonsson | set | messageid: <1379370541.7.0.285916803238.issue19009@psf.upfronthosting.co.za> |
2013-09-16 22:29:01 | kristjan.jonsson | link | issue19009 messages |
2013-09-16 22:29:00 | kristjan.jonsson | create | |
|