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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants