-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spansy: support Transfer-Encoding #34
Comments
I'm working on this right now, and after a bit of work on it, I think I have a sane approach (which I'm still implementing). When parsing the body source, build a RangeSet which encapsulates the chunk boundaries, such that the inversion of that rangeset is the body content. Collapse the body content down to remove the chunk boundaries, and then parse it as usual. Once you have the body parsed, and its spans constructed, take the chunk boundary rangeset, and then iteratively offset each body content span's rangeset indices based on the data's original relative position within the source. This is likely much simpler than trying to integrate the split ranges into the body content parsing logic. Thoughts? |
Sounds directionally correct. The complexity will lie in handling when fields are split across the chunk boundaries (potentially >1 splits), which is more involved than simply offsetting them. We will need to add The simplest place to start is to modify the |
Giving this another thought cycle, it would probably make more sense for the parsed types to hold multiple |
Does Span not already support splits by virtue of using a RangeSet? Is there a known circumstance where a Span has multiple discontiguous ranges for its data, and that has a negative effect? When does a Span have a RangeSet with more than one element? In keeping with the "Span" terminology, I think that the type we're looking for is Vector (Scatter/Gather) addressing (essentially the same as the Vec type in Rust). Sort of obvious to say, but the parsed types should probably just hold Or, essentially change the semantic of Span to Vector, if the RangeSet works the way I'm thinking? |
Our spansy crate currently does not support HTTP transfer encoding, which is very common. We should support it.
tlsn-utils/spansy/src/http/span.rs
Lines 264 to 266 in 45370cc
One challenge is that it can cause an HTTP response payload to be chunked. This will cause the spans of the payload to be non-contiguous.
The text was updated successfully, but these errors were encountered: