Right now, HttpClient and Kestrel share some HTTP/2 parsing code (including HPACK codec) via a set of copied code that had drifted a bit. In the 5.0 timeline, we should work on sharing this code in a way that ensures we have only one authoritative code-base.
Given the complexity and performance-sensitive nature of this code, a public API is not likely to be feasible (at least not in the near-term). Probably the easiest way to do this moving forward would be to build a "shared-source" NuGet package (this is something System.Text.Json did for a while) which would allow the code to flow from corefx in to ASP.NET Core without requiring a public API or publishing packages to NuGet.
cc @Tratcher @karelz
Besides HPACK (which we planned to share better in 5.0) what else could we share?
Probably just HPACK. @Tratcher mentioned he thought there was some frame parsing code that was copy-pasted.
which we planned to share better in 5.0
Is there an issue tracking that already? I didn't see one it a brief search.
HPACK is the easiest and highest-value code to share. We had agreed to try to do this a long time ago, but we never really got off the ground with it. If we want to get serious about this (and I do think would be good), then we need to actually put together a plan here and work toward it.
As far as other code we could share:
(1) There's a small amount of frame parsing code that could in theory be shared, but it's such a minimal amount of code that it's probably more trouble than it's worth.
(2) There's a lot of frame processing and connection/stream management code, but I think this is pretty hard to share for a variety of reasons.
There's no downside to investigating either of this further, but it seems like we should actually get the HPACK code to a point where it's shared first and then we can discuss whether there is anything else that makes sense to share.
For the future, i.e. HTTP3 and QUIC, we should look at how to share other code as well, particularly QPACK, which is the HTTP3 version of HPACK.
Triage: We need some plan - none of the options is clearly best.
Note (personal): CoreFX should not depend on code higher up in ASP.NET --> the flow should IMO go from bottom to up.
@scalablecory please kick off email discussion about how to make it happen. We may need a meeting later on.
@karelz we've had several email threads without any conclusions, it's time to meet and hash this out.
Yep, that's why we need list of options clarified and then a meeting :).
Will compile a list of options and results of discussions, and send new email to prep for meeting.
Triage: We believe that majority of the sharing was done.
If there are ideas to share specific code more, please file new specific issues, otherwise we will sit on this one indefinitely.
Most helpful comment
Will compile a list of options and results of discussions, and send new email to prep for meeting.