-
Notifications
You must be signed in to change notification settings - Fork 196
Fix: stream end when length of last chunk equal to MAX_CHUNK #356
Conversation
Lukasa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, this looks like it’ll work. Mind adding an entry to the change log and also a test for me?
|
@Lukasa I changed the code and made unit test pass on my machine. I also added a test to test specific change. |
|
@PrimozGodec, CI is fixed now, can you rebase please? Also, change log is in HISTORY.rst and CONTRIBUTORS.rst. |
hyper/http20/stream.py
Outdated
| self._send_chunk(chunk, final) | ||
| # since we need to know when we have a last package we need to know | ||
| # if there is another package in advance | ||
| cur_chunk = next(chunks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will explode if there are no chunks to send: I think you need to write a test case for that and refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Lukasa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks! ✨
This pull request is fixing bug #355
I changed the approach of taking chunks form the generator, such that we know when we reach the last chunk with memorising the next chunk.