all: upgrade to netty 4.1.8 and tcnative Fork26

This commit is contained in:
Carl Mastrangelo 2017-01-30 12:40:46 -08:00 committed by GitHub
parent cbe0ecd5e2
commit 0c0ce37bbd
3 changed files with 31 additions and 38 deletions

View File

@ -62,7 +62,7 @@ In Maven, you can use the [os-maven-plugin](https://github.com/trustin/os-maven-
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>1.1.33.Fork25</version>
<version>1.1.33.Fork26</version>
</dependency>
</dependencies>
</project>
@ -80,7 +80,7 @@ buildscript {
}
dependencies {
compile 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork25'
compile 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork26'
}
```
@ -115,7 +115,7 @@ In Maven, you can use the [os-maven-plugin](https://github.com/trustin/os-maven-
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative</artifactId>
<version>1.1.33.Fork25</version>
<version>1.1.33.Fork26</version>
<classifier>${tcnative.classifier}</classifier>
</dependency>
</dependencies>
@ -183,7 +183,7 @@ if (osdetector.os == "linux" && osdetector.release.isLike("fedora")) {
}
dependencies {
compile 'io.netty:netty-tcnative:1.1.33.Fork25:' + tcnative_classifier
compile 'io.netty:netty-tcnative:1.1.33.Fork26:' + tcnative_classifier
}
```

View File

@ -161,10 +161,10 @@ subprojects {
protobuf_plugin: 'com.google.protobuf:protobuf-gradle-plugin:0.8.0',
protobuf_util: "com.google.protobuf:protobuf-java-util:${protobufVersion}",
netty: 'io.netty:netty-codec-http2:[4.1.7.Final]',
netty_epoll: 'io.netty:netty-transport-native-epoll:4.1.7.Final' + epoll_suffix,
netty_proxy_handler: 'io.netty:netty-handler-proxy:4.1.7.Final',
netty_tcnative: 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork25',
netty: 'io.netty:netty-codec-http2:[4.1.8.Final]',
netty_epoll: 'io.netty:netty-transport-native-epoll:4.1.8.Final' + epoll_suffix,
netty_proxy_handler: 'io.netty:netty-handler-proxy:4.1.8.Final',
netty_tcnative: 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork26',
// Test dependencies.
junit: 'junit:junit:4.11',

View File

@ -58,7 +58,6 @@ import io.grpc.Metadata;
import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder;
import io.netty.handler.codec.http2.Http2Exception;
import io.netty.handler.codec.http2.Http2HeaderTable;
import io.netty.handler.codec.http2.Http2Headers;
import io.netty.handler.codec.http2.Http2HeadersDecoder;
import io.netty.handler.codec.http2.internal.hpack.Decoder;
@ -79,21 +78,11 @@ abstract class GrpcHttp2HeadersDecoder implements Http2HeadersDecoder,
private static final float HEADERS_COUNT_WEIGHT_NEW = 1 / 5f;
private static final float HEADERS_COUNT_WEIGHT_HISTORICAL = 1 - HEADERS_COUNT_WEIGHT_NEW;
private final Decoder decoder = new Decoder();
private final Http2HeaderTable headerTable = new GrpcHttp2HeaderTable();
private final Decoder decoder;
private float numHeadersGuess = 8;
GrpcHttp2HeadersDecoder(long maxHeaderListSize) {
try {
decoder.setMaxHeaderListSize(maxHeaderListSize);
} catch (Http2Exception e) {
PlatformDependent.throwException(e);
}
}
@Override
public Http2HeaderTable headerTable() {
return headerTable;
decoder = new Decoder(maxHeaderListSize, 32 /* same as default */);
}
@Override
@ -114,26 +103,30 @@ abstract class GrpcHttp2HeadersDecoder implements Http2HeadersDecoder,
return this;
}
private final class GrpcHttp2HeaderTable implements Http2HeaderTable {
@Override
public void maxHeaderTableSize(long max) throws Http2Exception {
decoder.setMaxHeaderTableSize(max);
}
@Override
public long maxHeaderListSize() {
return decoder.getMaxHeaderListSize();
}
@Override
public long maxHeaderTableSize() {
return decoder.getMaxHeaderTableSize();
}
@Override
public void maxHeaderListSize(long maxHeaderListSize, long maxHeaderListSizeGoAway)
throws Http2Exception {
decoder.setMaxHeaderListSize(maxHeaderListSize, maxHeaderListSizeGoAway);
}
@Override
public void maxHeaderListSize(long max) throws Http2Exception {
decoder.setMaxHeaderListSize(max);
}
@Override
public long maxHeaderListSizeGoAway() {
return decoder.getMaxHeaderListSizeGoAway();
}
@Override
public long maxHeaderListSize() {
return decoder.getMaxHeaderListSize();
}
@Override
public long maxHeaderTableSize() {
return decoder.getMaxHeaderTableSize();
}
@Override
public void maxHeaderTableSize(long max) throws Http2Exception {
decoder.setMaxHeaderTableSize(max);
}
static final class GrpcHttp2ServerHeadersDecoder extends GrpcHttp2HeadersDecoder {