Full send_buf prevents sending of FIN
- Dominant language
- Rust
- Stars
- 40
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
I've spent some time playing around with this library. Basically, I've been running a bare simple app locally that creates a sender & receiver utp socket and tries to tx 100000 bytes. This transfer has failed consistently - while it might be user error, i'm fairly confident I'm using the library in the way it's intended...
The repeated behavior I'm seeing is the sender / initiator processes the tx succesfully and closes the stream - however the recipient never fully processes the stream (via `read_to_eof`) and hangs until it time outs.
It appears to me as though a `fin` is never sent from the sender -> receipient. This is because the sender never clears its `send_buf`. The evaluations [here](https://github.com/jacobkaufmann/utp/blob/master/src/conn.rs#L329) and [here](https://github.com/jacobkaufmann/utp/blob/master/src/conn.rs#L377) **always** fail since `send_buf` is never emptied. So the fin is never sent. Something appears to be happening [here](https://github.com/jacobkaufmann/utp/blob/master/src/conn.rs#L439-L467) where the `send_buf` is not properly cleared.
I still have some understanding to improve upon, so I'm not sure if these thoughts make any sense.
- i haven't grokked the supposed behavior b/w `send_buf` and `pending_writes`
- while the `pending_writes` queue seems to empty correctly, the `send_buf` never fully clears... porque?
- why is `send_buf` a `VecDeque>` and not just `VecDeque>`?
But from what I can tell from experimenting with this library, it's consistent behavior that's preventing the sending of the `fin` packet. Mostly just leaving this here so that I can try and organize my thoughts & i'll pick it back up after the weekend, but if anybody has any clues / ideas / pointers on what I'm misunderstanding - that's definitely appreciated.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.