Skip to content

Commit 0c0ce37

Browse files
all: upgrade to netty 4.1.8 and tcnative Fork26
1 parent cbe0ecd commit 0c0ce37

3 files changed

Lines changed: 31 additions & 38 deletions

File tree

‎SECURITY.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ In Maven, you can use the [os-maven-plugin](https://github.com/trustin/os-maven-
6262
<dependency>
6363
<groupId>io.netty</groupId>
6464
<artifactId>netty-tcnative-boringssl-static</artifactId>
65-
<version>1.1.33.Fork25</version>
65+
<version>1.1.33.Fork26</version>
6666
</dependency>
6767
</dependencies>
6868
</project>
@@ -80,7 +80,7 @@ buildscript {
8080
}
8181
8282
dependencies {
83-
compile 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork25'
83+
compile 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork26'
8484
}
8585
```
8686

@@ -115,7 +115,7 @@ In Maven, you can use the [os-maven-plugin](https://github.com/trustin/os-maven-
115115
<dependency>
116116
<groupId>io.netty</groupId>
117117
<artifactId>netty-tcnative</artifactId>
118-
<version>1.1.33.Fork25</version>
118+
<version>1.1.33.Fork26</version>
119119
<classifier>${tcnative.classifier}</classifier>
120120
</dependency>
121121
</dependencies>
@@ -183,7 +183,7 @@ if (osdetector.os == "linux" && osdetector.release.isLike("fedora")) {
183183
}
184184
185185
dependencies {
186-
compile 'io.netty:netty-tcnative:1.1.33.Fork25:' + tcnative_classifier
186+
compile 'io.netty:netty-tcnative:1.1.33.Fork26:' + tcnative_classifier
187187
}
188188
```
189189

‎build.gradle‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ subprojects {
161161
protobuf_plugin: 'com.google.protobuf:protobuf-gradle-plugin:0.8.0',
162162
protobuf_util: "com.google.protobuf:protobuf-java-util:${protobufVersion}",
163163

164-
netty: 'io.netty:netty-codec-http2:[4.1.7.Final]',
165-
netty_epoll: 'io.netty:netty-transport-native-epoll:4.1.7.Final' + epoll_suffix,
166-
netty_proxy_handler: 'io.netty:netty-handler-proxy:4.1.7.Final',
167-
netty_tcnative: 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork25',
164+
netty: 'io.netty:netty-codec-http2:[4.1.8.Final]',
165+
netty_epoll: 'io.netty:netty-transport-native-epoll:4.1.8.Final' + epoll_suffix,
166+
netty_proxy_handler: 'io.netty:netty-handler-proxy:4.1.8.Final',
167+
netty_tcnative: 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork26',
168168

169169
// Test dependencies.
170170
junit: 'junit:junit:4.11',

‎netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersDecoder.java‎

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
import io.netty.buffer.ByteBuf;
5959
import io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder;
6060
import io.netty.handler.codec.http2.Http2Exception;
61-
import io.netty.handler.codec.http2.Http2HeaderTable;
6261
import io.netty.handler.codec.http2.Http2Headers;
6362
import io.netty.handler.codec.http2.Http2HeadersDecoder;
6463
import io.netty.handler.codec.http2.internal.hpack.Decoder;
@@ -79,21 +78,11 @@ abstract class GrpcHttp2HeadersDecoder implements Http2HeadersDecoder,
7978
private static final float HEADERS_COUNT_WEIGHT_NEW = 1 / 5f;
8079
private static final float HEADERS_COUNT_WEIGHT_HISTORICAL = 1 - HEADERS_COUNT_WEIGHT_NEW;
8180

82-
private final Decoder decoder = new Decoder();
83-
private final Http2HeaderTable headerTable = new GrpcHttp2HeaderTable();
81+
private final Decoder decoder;
8482
private float numHeadersGuess = 8;
8583

8684
GrpcHttp2HeadersDecoder(long maxHeaderListSize) {
87-
try {
88-
decoder.setMaxHeaderListSize(maxHeaderListSize);
89-
} catch (Http2Exception e) {
90-
PlatformDependent.throwException(e);
91-
}
92-
}
93-
94-
@Override
95-
public Http2HeaderTable headerTable() {
96-
return headerTable;
85+
decoder = new Decoder(maxHeaderListSize, 32 /* same as default */);
9786
}
9887

9988
@Override
@@ -114,26 +103,30 @@ public Configuration configuration() {
114103
return this;
115104
}
116105

117-
private final class GrpcHttp2HeaderTable implements Http2HeaderTable {
118-
@Override
119-
public void maxHeaderTableSize(long max) throws Http2Exception {
120-
decoder.setMaxHeaderTableSize(max);
121-
}
106+
@Override
107+
public long maxHeaderListSize() {
108+
return decoder.getMaxHeaderListSize();
109+
}
122110

123-
@Override
124-
public long maxHeaderTableSize() {
125-
return decoder.getMaxHeaderTableSize();
126-
}
111+
@Override
112+
public void maxHeaderListSize(long maxHeaderListSize, long maxHeaderListSizeGoAway)
113+
throws Http2Exception {
114+
decoder.setMaxHeaderListSize(maxHeaderListSize, maxHeaderListSizeGoAway);
115+
}
127116

128-
@Override
129-
public void maxHeaderListSize(long max) throws Http2Exception {
130-
decoder.setMaxHeaderListSize(max);
131-
}
117+
@Override
118+
public long maxHeaderListSizeGoAway() {
119+
return decoder.getMaxHeaderListSizeGoAway();
120+
}
132121

133-
@Override
134-
public long maxHeaderListSize() {
135-
return decoder.getMaxHeaderListSize();
136-
}
122+
@Override
123+
public long maxHeaderTableSize() {
124+
return decoder.getMaxHeaderTableSize();
125+
}
126+
127+
@Override
128+
public void maxHeaderTableSize(long max) throws Http2Exception {
129+
decoder.setMaxHeaderTableSize(max);
137130
}
138131

139132
static final class GrpcHttp2ServerHeadersDecoder extends GrpcHttp2HeadersDecoder {

0 commit comments

Comments
 (0)