Parse partial message
Hello @chifflier, Thanks for your great job. I have a scenario where I need to parse partial messages. For example, a Client Hello message might be split into two packets due to TCP fragmentation, but even if I can only receive the first one, I still want to parse as much content from it as possible. I wonder if you would consider supporting such a case.
Hi, Indeed, the record parser does not support partial messages, and at the moment the caller is expected to handle defragmentation of records (which includes messages)
In the git repository, a TlsRecordParser helper struct has been added to make this easier (see examples at end of this file). Feel free to test it, feedback (especially for the API) will be appreciated.
This will be part of the next release, which is a bit overdue, and will be done as soon as I find some time to work on this crate again.
Note that this will handle defragmentation at the record level, so if a record contains multiple messages it will currently wait for the entire record before returning the list of messages. Being more granular will require more work, but I'm open to suggestions.
Hi @chifflier,
I'm willing to take a shot at modifying the parser functions to support partial message parsing. I know this will involve quite a bit of modification and adding new appropriate parsing interfaces. But I think it can address real-world scenario issues, so I want to give it a try. What do you think? Looking forward to your suggestions.