Skip to content

Support attaching application-layer stream protocols to existing flows - #61

Merged
mishtak00 merged 1 commit into
mainfrom
apple/gm/app-layer-proto-stream
Jul 30, 2026
Merged

Support attaching application-layer stream protocols to existing flows#61
mishtak00 merged 1 commit into
mainfrom
apple/gm/app-layer-proto-stream

Conversation

@mishtak00

Copy link
Copy Markdown
Contributor

Added a general primitive for attaching an upper stream protocol onto an already-existing flow, for cases where a listener's stack has as application-layer protocol that must be added on top of inbound streams.

All changes:

  • attachLowerStreamProtocolToExistingFlow(listener:flowReference:) as an InboundStreamHandler requirement, with witnesses on the OneToOne and Top stream extensions, EINVAL on StreamEndpointFlowProtocol (its lower is wired at construction), and ENOTSUP on StreamPerfTestHandler. Reference dispatch covers .tls, .streamEndpointFlow, .custom
  • deliverEnqueuedInboundStreamData(flowReference:) to replay data buffered before the upper protocol attached
  • newProtocolInstance(context:) on protocol options (nil on AbstractProtocolOptions, overridden in ProtocolOptions<P>) so a custom application protocol can be materialized per flow without naming a concrete type

@mishtak00
mishtak00 merged commit a8a85a9 into main Jul 30, 2026
23 checks passed
@glbrntt
glbrntt deleted the apple/gm/app-layer-proto-stream branch August 7, 2026 14:00
@rnro rnro added the ⚠️ semver/major Breaks existing public API. label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ semver/major Breaks existing public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants