Commit 681d460
committed
Introduce TextHeaders and AsciiString
Motivation:
We have quite a bit of code duplication between HTTP/1, HTTP/2, SPDY,
and STOMP codec, because they all have a notion of 'headers', which is a
multimap of string names and values.
Modifications:
- Add TextHeaders and its default implementation
- Add AsciiString to replace HttpHeaderEntity
- Borrowed some portion from Apache Harmony's java.lang.String.
- Reimplement HttpHeaders, SpdyHeaders, and StompHeaders using
TextHeaders
- Add AsciiHeadersEncoder to reuse the encoding a TextHeaders
- Used a dedicated encoder for HTTP headers for better performance
though
- Remove shortcut methods in SpdyHeaders
- Replace SpdyHeaders.getStatus() with HttpResponseStatus.parseLine()
Result:
- Removed quite a bit of code duplication in the header implementations.
- Slightly better performance thanks to improved header validation and
hash code calculation1 parent 2a2a21e commit 681d460
29 files changed
Lines changed: 3621 additions & 1356 deletions
File tree
- codec-http/src
- main/java/io/netty/handler/codec
- http
- spdy
- test/java/io/netty/handler/codec/http
- codec-stomp/src
- main/java/io/netty/handler/codec/stomp
- test/java/io/netty/handler/codec/stomp
- codec/src/main/java/io/netty/handler/codec
- common/src/main/java/io/netty/util/internal
- example/src/main/java/io/netty/example/http/helloworld
- license
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
| |||
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
| 148 | + | |
0 commit comments