Skip to content
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

Specify behavior on incomplete requests #1643

Merged
merged 6 commits into from Aug 14, 2018
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 23 additions & 7 deletions draft-ietf-quic-http.md
Expand Up @@ -306,9 +306,10 @@ Trailing header fields are carried in an additional header block following the
body. Senders MUST send only one header block in the trailers section;
receivers MUST discard any subsequent header blocks.

An HTTP request/response exchange fully consumes a QUIC stream. After sending a
request, a client closes the stream for sending; after sending a response, the
server closes the stream for sending and the QUIC stream is fully closed.
An HTTP request/response exchange fully consumes a bidirectional QUIC stream.
After sending a request, a client closes the stream for sending; after sending a
response, the server closes the stream for sending and the QUIC stream is fully
closed.

A server can send a complete response prior to the client sending an entire
request if the response does not depend on any portion of the request that has
Expand All @@ -317,8 +318,13 @@ client abort transmission of a request without error by triggering a QUIC
STOP_SENDING with error code HTTP_EARLY_RESPONSE, sending a complete response,
and cleanly closing its streams. Clients MUST NOT discard complete responses as
a result of having their request terminated abruptly, though clients can always
discard responses at their discretion for other reasons. Servers MUST NOT
abort a response in progress as a result of receiving a solicited RST_STREAM.
discard responses at their discretion for other reasons.

Servers MUST NOT abort a response in progress as a result of receiving a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the way to do this is to say:

Cancellation of a request stream does not prevent a server from sending a response. A client that does not want a response SHOULD send a STOP_SENDING frame. A server does not need to take receipt of a RST_STREAM as a signal that it cannot provide a response, though it might be unable to do so. If a stream is reset by the client and the server is unable to respond as a result, it can treat that as a stream error of type HTTP_INCOMPLETE_REQUEST.

This is a different structure - it says that any STOP_SENDING and RST_STREAM on the request side of a stream only cancel the request and not the response. But I think that this is neater - it avoids all of the coupling you have going on here.

Copy link
Contributor Author

@MikeBishop MikeBishop Aug 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's basically what I was going for (the error at the server is that it doesn't have a complete request, not that the RST occurred), but that's a clearer way to state it.

solicited RST_STREAM (i.e. with error code STOPPING). If the request stream
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing comma after "i.e."

terminates for any other reason without containing a fully-formed HTTP request,
the server SHOULD abort its response with the error code
HTTP_INCOMPLETE_REQUEST.

### Header Formatting and Compression

Expand Down Expand Up @@ -388,10 +394,11 @@ detects an error with the stream or the QUIC connection.

### Request Cancellation

Either client or server can cancel requests by closing the stream (QUIC
RST_STREAM or STOP_SENDING frames, as appropriate) with an error type of
Either client or server can cancel requests by aborting the stream (QUIC
RST_STREAM or STOP_SENDING frames, as appropriate) with an error code of
HTTP_REQUEST_CANCELLED ({{http-error-codes}}). When the client cancels a
request or response, it indicates that the response is no longer of interest.
Clients SHOULD cancel requests by aborting both directions of a stream.

When the server cancels either direction of the request stream using
HTTP_REQUEST_CANCELLED, it indicates that no application processing was
Expand Down Expand Up @@ -1185,6 +1192,9 @@ HTTP_PUSH_ALREADY_IN_CACHE (0x04):
HTTP_REQUEST_CANCELLED (0x05):
: The client no longer needs the requested data.

HTTP_INCOMPLETE_REQUEST (0x06):
: The client's stream terminated without containing a fully-formed request.

HTTP_CONNECT_ERROR (0x07):
: The connection established in response to a CONNECT request was reset or
abnormally closed.
Expand Down Expand Up @@ -1220,6 +1230,10 @@ HTTP_WRONG_STREAM_DIRECTION (0x0010):
: A unidirectional stream type was used by a peer which is not permitted to do
so.

HTTP_EARLY_RESPONSE (0x0011):
: The remainder of the client's request is not needed to produce a response.
For use in STOP_SENDING only.

HTTP_GENERAL_PROTOCOL_ERROR (0x00FF):
: Peer violated protocol requirements in a way which doesn't match a more
specific error code, or endpoint declines to use the more specific error code.
Expand Down Expand Up @@ -1677,6 +1691,7 @@ The entries in the following table are registered by this document.
| HTTP_INTERNAL_ERROR | 0x0003 | Internal error | {{http-error-codes}} |
| HTTP_PUSH_ALREADY_IN_CACHE | 0x0004 | Pushed content already cached | {{http-error-codes}} |
| HTTP_REQUEST_CANCELLED | 0x0005 | Data no longer needed | {{http-error-codes}} |
| HTTP_INCOMPLETE_REQUEST | 0x0006 | Stream terminated early | {{http-error-codes}} |
| HTTP_CONNECT_ERROR | 0x0007 | TCP reset or error on CONNECT request | {{http-error-codes}} |
| HTTP_EXCESSIVE_LOAD | 0x0008 | Peer generating excessive load | {{http-error-codes}} |
| HTTP_VERSION_FALLBACK | 0x0009 | Retry over HTTP/2 | {{http-error-codes}} |
Expand All @@ -1687,6 +1702,7 @@ The entries in the following table are registered by this document.
| HTTP_WRONG_STREAM_COUNT | 0x000E | Too many unidirectional streams | {{http-error-codes}} |
| HTTP_CLOSED_CRITICAL_STREAM | 0x000F | Critical stream was closed | {{http-error-codes}} |
| HTTP_WRONG_STREAM_DIRECTION | 0x0010 | Unidirectional stream in wrong direction | {{http-error-codes}} |
| HTTP_EARLY_RESPONSE | 0x0011 | Remainder of request not needed | {{http-error-codes}} |
| HTTP_MALFORMED_FRAME | 0x01XX | Error in frame formatting or use | {{http-error-codes}} |
| ----------------------------------- | ---------- | ---------------------------------------- | ---------------------- |

Expand Down