You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
write method calls send_data before poll_ready #78
Huh, good point. I don't recall why the order was switched there... Granted, technically we aren't using Sink specifically, but the pattern is definitely similar.
That change would require that the bytes always be copied out, no? I guess unless it was already a Bytes. Whereas currently, by passing ownership of the impl Buf, a QUIC implementation could copy, but it could also choose to store it, kinda like h2 does.
Yea, that's what I meant by if it was already a Bytes. If it was a custom impl Buf, it would end up being copied into a Bytes... I think there's merit in discussing if the API around sending data is the right one. But for this specific issue, it also looks like that's a simple bug: the calls should be reversed.
Activity
seanmonstar commentedon Feb 8, 2022
Huh, good point. I don't recall why the order was switched there... Granted, technically we aren't using
Sinkspecifically, but the pattern is definitely similar.camshaft commentedon Feb 8, 2022
Another option would be to rename the methods to something like
set_dataandpoll_send_data, which it seems like is how it's being used currently.But if we're considering an API change, I'm not sure why we couldn't just change it to:
It would remove the need for the stream implementation to convert/store the buffer and make things a bit simpler, IMO.
seanmonstar commentedon Feb 8, 2022
That change would require that the bytes always be copied out, no? I guess unless it was already a
Bytes. Whereas currently, by passing ownership of theimpl Buf, a QUIC implementation could copy, but it could also choose to store it, kinda likeh2does.camshaft commentedon Feb 8, 2022
Not necessarily. If the caller used
copy_to_byteswithchunklengths theBufimpl would specialize on it:(see, for example,
impl Buf for Bytes)seanmonstar commentedon Feb 9, 2022
Yea, that's what I meant by if it was already a
Bytes. If it was a customimpl Buf, it would end up being copied into aBytes... I think there's merit in discussing if the API around sending data is the right one. But for this specific issue, it also looks like that's a simple bug: the calls should be reversed.feat: make SendStream allow writing arbitrary data like io::Write
Ruben2424 commentedon Sep 20, 2026
I merged #360 with changes in that area. Leaving this issue open to discuss if and how the methods should change.