Lukasa/hyper — pull request #47 by alekstorm (2014-04-20 04:20:43+00:00)
Title: Update to h2-11, refactor Frame and subclasses to remove duplicated code

Calling the branch `h2-10` once this is merged doesn't really make sense, so I was thinking we could rename it to `next` or `h2-next` instead.

Highlights:

- Flags got renumbered, yada yada.
- New ALTSVC frame.
- Priority is now more complicated and attached to more frames.
- Padding and priority parsing/serialization logic got split out into mixins, which worked quite well for code reusability.
- Rather than having each `Frame` subclass handle parsing and serializing the frame header, that's now handled by `Frame` itself; subclasses override only `parse_body()` and `serialize_body()`.
- `Frame` subclasses now set a `has_stream` field to `True`, `False`, or `None`, depending on whether the stream ID must be non-zero, must be zero, or can be either; this is now checked in the `Frame` constructor, rather than each subclass'.
- Code that branches on frame type now checks `Frame.type`, rather than the class identity of the frame object.