-
Notifications
You must be signed in to change notification settings - Fork 565
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
Indicating the end of a header block #22
Comments
Ordering is guaranteed, so I'm not sure what the race would be. We can guarantee that headers are sent before data. I originally thought that this issue was required simply because our maximum frame size is now too small for headers to fit into a single frame. @grmocg noted that his solution for #2 would require a continuation bit, which could fit the bill here. That doesn't account for the fact that multiple blocks of headers could be sent at any time. We probably need to agree on what the semantics of that would be and what constraints we want to apply. The draft says something about having multiple header blocks for push, which seems necessary. It doesn't say anything about what HEADERS frames mean during or after the data frames are sent. |
Yes, the race confused me too. @grmocg - any further thoughts? The most straightforward thing to say would be that all header blocks before the first data block on a stream have the same semantics as the HTTP/1 header block; anything afterwards is considered a trailer. |
There are some issues when deploying over SCTP, but we're not doing that, so I'd be confused about that. As an example, imagine that you're serving a javascript resource which varies depending on some of the parameters of the query, and you must do a lookup on some other server to determine what they mean, however you know that some of the data is always the same, and thus would like to emit it blindly, before computing content-length, etc. I think the usecase is probably weak. |
Sure, this is a problem in HTTP/1 too; right now, you have to buffer the body before you emit headers. I wouldn't characterise it as a weak use case, it's fairly common IME. I think we have two possible paths here -
An explicit indication will enable the use case you mention, as well as make it possible to late-bind the status (e.g., if an error is encountered while generating the body). However, it would require that 2->1 gateways buffer the entire response to make sure they see all of the headers; that's likely to be a showstopper. Anyway, we should take this discussion to the list. |
Perhaps the easiest thing to do is to make it very clear that headers finish before data starts. Then, we can debate the merits/problems of late headers. |
See also #98 |
I think the traditional solution (which Martin was advocating) as used in HTTP/1 is still reasonable. Send the headers first, then send the data. If that requires queuing, too bad. The best solution is then, probably: |
Discussed at SF Interim. Considering dropping Trailers as a features in HTTP/2.0; will ascertain support on mailing list. If we decide to keep them, a fin flag on a header block that isn't the first is the start of trailers; any interspersed header frames have no semantics in HTTP/1.1. |
Trailers are addressed in the layering branch rewrite of the http layer. |
Ordering requirements for headers and data are addressed in layering branch as well |
HTTP/2 currently allows for multiple sets of headers. However, it was asserted in Tokyo that data on the same stream could race the header blocks, so seeing a data frame on a stream is not necessarily an indication that the headers are complete.
The text was updated successfully, but these errors were encountered: