Skip to content

Commit 1f82e24

Browse files
committed
Add FINAL_DATA
1 parent 57e8093 commit 1f82e24

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

draft-ietf-httpbis-connect-tcp.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,17 @@ This specification describes an alternative mechanism for proxying TCP in HTTP.
6464

6565
# Specification
6666

67-
A template-driven TCP transport proxy for HTTP is identified by a URI Template {{!RFC6570}} containing variables named "target_host" and "target_port". This URI Template and its variable values MUST meet all the same requirements as for UDP proxying ({{!RFC9298, Section 2}}), and are subject to the same validation rules. The client MUST substitute the destination host and port number into this template to produce the request URI. The derived URI serves as the destination of a Capsule Protocol connection using the Upgrade Token "connect-tcp" (see registration in {#new-upgrade-token}).
67+
A template-driven TCP transport proxy for HTTP is identified by a URI Template {{!RFC6570}} containing variables named "target_host" and "target_port". This URI Template and its variable values MUST meet all the same requirements as for UDP proxying ({{!RFC9298, Section 2}}), and are subject to the same validation rules. The client MUST substitute the destination host and port number into this template to produce the request URI. The derived URI serves as the destination of a Capsule Protocol connection using the Upgrade Token "connect-tcp" (see registration in {{new-upgrade-token}}).
6868

69-
When using "connect-tcp", TCP payload data is sent in the payload of a new Capsule Type named DATA (see registration in {{data-capsule}}). The ordered concatenation of DATA capsule payloads represents the TCP payload data.
69+
When using "connect-tcp", TCP payload data is sent in the payload of new Capsule Types named DATA and FINAL_DATA (see registrations in {{data-capsule}}). The ordered concatenation of these capsule payloads represents the TCP payload data. A FINAL_DATA capsule indicates that sender has closed this stream, semantically equivalent to TCP FIN. After sending a FINAL_DATA capsule, an endpoint MUST NOT send any more DATA or FINAL_DATA capsules on this data stream. (See {{closing-connections}} for related requirements.)
7070

71-
An intermediary MAY split a DATA capsule into two consecutive capsules or merge two consecutive DATA capsules into one. Future CPUTs may use DATA capsules to represent their main data stream, if applicable.
71+
An intermediary MAY merge and split successive DATA and FINAL_DATA capsules, subject to the following requirements:
72+
73+
* There are no intervening capsules of other types.
74+
* The order of payload content is preserved.
75+
* The final emitted capsule uses the same capsule type (DATA or FINAL_DATA) as the final input capsule, and all others use the DATA capsule type.
76+
77+
In "connect-tcp", Context ID 0 is reserved for DATA, and Context ID 1 is reserved for FINAL_DATA. Future CPUTs may also use DATA and FINAL_DATA capsules to represent their main data stream, if applicable.
7278

7379
## In HTTP/1.1
7480

@@ -156,8 +162,9 @@ Clients SHOULD assume that all proxy resources generated by a single template sh
156162

157163
In each HTTP version, any requirements related to closing connections in Classic HTTP CONNECT also apply to "connect-tcp", with the following modifications:
158164

159-
* In HTTP/1.1, endpoints SHOULD terminate the connection with an incomplete DATA capsule (as defined in {{Section 3.3 of !RFC9297}}) to indicate receipt of a TCP connection error (e.g., a TCP RST or timeout). When a connection is terminated with any incomplete capsule, or with an error in the underlying connection (e.g. a TLS "internal_error" alert or TCP RST), the endpoint SHOULD send a TCP RST if the underlying TCP implementation permits it.
160-
* In HTTP/2 and HTTP/3, senders MAY use an incomplete DATA capsule to indicate a TCP connection error, instead of (or in addition to) the signals defined for TCP connection errors in Classic HTTP CONNECT. Recipients MUST recognize an incomplete DATA capsule as a TCP connection error.
165+
* If the TCP sender send a TCP FIN indicating clean shutdown, the endpoint in this specification MUST send a FINAL_DATA capsule.
166+
* When a connection is terminated without a FINAL_DATA capsule, the endpoint SHOULD send a TCP RST if the underlying TCP implementation permits it.
167+
* In HTTP/2 and HTTP/3, senders MAY additionally set stream-level error flags as in Classic HTTP CONNECT.
161168

162169
# Additional Connection Setup Behaviors
163170

@@ -244,11 +251,10 @@ IF APPROVED, IANA is requested to add the following entry to the "MASQUE URI Suf
244251

245252
IF APPROVED, IANA is requested to add the following entry to the "HTTP Capsule Types" registry:
246253

247-
| ----- | ------------ | --------- | ------------------------------------- | ----------------- | ------- |
248-
| Value | Capsule Type | Status | Reference | Change Controller | Contact |
254+
| ----- | ------------ | --------- | ---------------------------------- | ----------------- | ------- |
255+
| Value | Capsule Type | Status | Reference | Change Controller | Contact |
249256
| (TBD) | DATA | permanent | (This document), {{specification}} | IETF | HTTPBIS |
250-
251-
For this draft version of the protocol, the Capsule Type value `0xb739a6d0` shall be used provisionally for testing, under the name "DATA-05".
257+
| (TBD) | FINAL_DATA | permanent | (This document), {{specification}} | IETF | HTTPBIS |
252258

253259
--- back
254260

0 commit comments

Comments
 (0)