tornado_http2 icon indicating copy to clipboard operation
tornado_http2 copied to clipboard

Resolve bugs

Open elieLeE opened this issue 2 years ago • 1 comments

Resolve error wehen send data with size bigger than max size => partionning data in packets. Remove StreamClosedError at closing connection

elieLeE avatar Jan 13 '23 20:01 elieLeE

Thanks for the patches, it's good to see someone trying out this library!

For the max packet size check, I think it's better to do this chunking at a higher level. Specifically, you're duplicating the same frame.flags for each packet, which looks incorrect for at least the END_STREAM flag. In Stream.write_chunk we are already doing chunking based on the window size, so I think we could apply the max frame size here as well:

allowance = yield self.window.consume(min(len(chunk), max_size)

bdarnell avatar Jan 16 '23 19:01 bdarnell