quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Removed assert to check finalize is called before drop #1703

Open boserohan opened 10 months ago

boserohan commented 10 months ago

Removed the debug_assert statement in fn finalize_inner() for checking finalize is called before drop on Chunks. Also removed the boolean 'drop' variable used for this check.

boserohan commented 10 months ago

Thanks for reviewing. Sure, can you please point me to the location in the docs where I can make those changes?

djc commented 10 months ago

Just the docstrings for the relevant methods.

boserohan commented 10 months ago

To me it seems finalize() needs to be called whenever all chunks of data available to the receiver on a given stream have been read (i.e. stream is finished or reset). Hence, disposing it's stored state. This might also involve situations where the sender is blocked due to flow control limits, and thus preventing the stream from being stalled by additionally granting these credits to the sender, and notifying the QUIC state machine that a frame needs to be transmitted for the same. Is my understanding correct with this? If not, please could you correct me if I am wrong.

boserohan commented 10 months ago

@djc can you help my understanding on this please?

djc commented 10 months ago

@boserohan91 I don't have much time right now to dig into this. I suggest just updating your PR with some documentation based on your understanding and we'll review the suggested changes to see if they make sense.