Repository: netty/netty
Issue: HTTP/2 Draft 16
Labels: feature

The new draft is out https://tools.ietf.org/html/draft-ietf-httpbis-http2-16.


Issue comments:
I have looked at the diffs....here are some notes from my first pass.

We need some changes to be able to send/receive priority frames in any state.  I have a question on the spec to clarify the state a bit https://github.com/http2/http2-spec/issues/667.  I am looking into  adding another `EndPoint.createStream(...)` method with an additional `boolean` argument to create a stream in the idle state (as opposed to always in the OPEN state).  This will have fallout in other areas that needs investigation.

[section 5.3.4](https://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-5.3.4):

> Similarly, streams that are in the "idle" state can be assigned
>    priority or become a parent of other streams.  This allows for the
>    creation of a grouping node in the dependency tree, which enables
>    more flexible expressions of priority.  Idle streams that are made a
>    parent of another stream are assigned a default priority
>    (<a href="https://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-5.3.5">Section 5.3.5</a>).

I have to review this a bit more (just a reminder to myself mostly).

[section 5.5](https://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-5.5)

> Note that treating any frame other
>    than DATA frames as flow controlled is such a change in semantics,
>    and can only be done through negotiation.

I know we discussed having the flow controller a bit more flexible in some cases (lastFrameSent).  I'm not sure if we want to make this change and investigate others to be more suitable for extension frames?  If so we can open up a follow up issue to address this.

[section 8.1.1.2](https://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-8.1.2.2)

> The only exception to this is the TE header field, which MAY be
>    present in an HTTP/2 request; when it is, it MUST NOT contain any
>    value other than "trailers".

I have to review this a bit more (just a reminder to myself mostly).  This is not a change, but was moved in the spec so it showed up in my diff.

[appendix a](https://tools.ietf.org/html/draft-ietf-httpbis-http2-16#appendix-A)
I have removed the prohibited ciphers but I think it is worth another pass through [oracle's cipher suite list](http://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html) to see if we can pull in more ciphers.

I opened another issue https://github.com/http2/http2-spec/issues/668 asking for clarification on some terminology in the spec.

I need to investigate if priority frames are allowed to be sent/received after go_away or RST frames have been sent/received.

Discussion moved to PR https://github.com/netty/netty/pull/3217.

resolved with #3217 


Pull request review comments:

Patch that resolved the issue:
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java
index 3b0be13d598..b38aee2d6dd 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java
@@ -34,8 +34,9 @@ public final class Http2CodecUtil {
     public static final int CONNECTION_STREAM_ID = 0;
     public static final int HTTP_UPGRADE_STREAM_ID = 1;
     public static final String HTTP_UPGRADE_SETTINGS_HEADER = "HTTP2-Settings";
-    public static final String HTTP_UPGRADE_PROTOCOL_NAME = "h2c-16";
-    public static final String TLS_UPGRADE_PROTOCOL_NAME = "h2-16";
+    // Draft 14 is the latest "implementation draft" as defined by https://http2.github.io/
+    public static final String HTTP_UPGRADE_PROTOCOL_NAME = "h2c-14";
+    public static final String TLS_UPGRADE_PROTOCOL_NAME = "h2-14";
 
     public static final int PING_FRAME_PAYLOAD_LENGTH = 8;
     public static final short MAX_UNSIGNED_BYTE = 0xFF;


Test patch: