netty/netty — pull request #2555 by trustin (2014-06-09 16:47:23+00:00)
Title: AsciiString and TextHeaders to reduce code duplication

Motivation:

We have various HTTP header-ish data structure in our codecs - HTTP, HTTP/2, SPDY, and STOMP, and we have quite a bit of duplication.

Modifications:

Add TextHeaders, which provides a generic string multimap
Add DefaultTextHeaders, the default TextHeaders implementation with some extensibility
Replace HttpHeaderEntity with AsciiString so that it can be used for other protocols
Remove StompHeaders and use TextHeaders instead.
Rewrite DefaultHttpHeaders and DefaultSpdyHeaders using DefaultTextHeaders
SpdyHeaders is an interface now. No more static methods. They were merged into SpdyHeaders's member methods.

Result:

Same or slight better performance
Much less code duplication

This change will not go into 4.0 unless there's really a good reason to do so. I'll issue another pull request for changing HTTP/2's header which will be part of master.