这是indexloc提供的服务,不要输入任何密码
Skip to content

Support for ring buffers or buffer-spanning messages #32

@dcsommer

Description

@dcsommer

I've been reading through the API of untrusted and it seems great for parsing network messages in general, but there are a few edge cases I'm wondering how to handle and it seems there may be a slight gap in the API. Sometimes a logical message (e.g. a TCP frame) can be split across multiple packets and end up in different buffers. These buffers are typically chained together in some kind of ring buffer structure. I don't see a way to nicely splice together multiple slices and handle them as a contiguous Input.

Also, in network applications, handling partially received data is the norm. For instance, a single packet may include 1 complete message and half of the next. Using Input::read_all() would return incomplete_read if a packet doesn't contain exactly whole messages. So, it seems using Reader::new() directly would be the way to go, but the documentation of that function discourages its direct use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions