update to 4.1.49, remove all epoll for Linux build

This commit is contained in:
Jörg Prante 2020-04-29 19:18:58 +02:00
parent ced37bd8d1
commit e7d7f68554
6 changed files with 27 additions and 19 deletions

View file

@ -1,9 +1,9 @@
group = org.xbib
name = netty-http
version = 4.1.48.0
version = 4.1.49.0
# netty
netty.version = 4.1.48.Final
netty.version = 4.1.49.Final
tcnative.version = 2.0.29.Final
tcnative-legacy-macosx.version = 2.0.26.Final

View file

@ -9,7 +9,7 @@ dependencies {
//runtime project(':netty-http-kqueue')
} else if (Os.isFamily(Os.FAMILY_UNIX)) {
runtime "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative.version')}"
runtime project(':netty-http-epoll')
//runtime project(':netty-http-epoll')
}
testCompile "org.conscrypt:conscrypt-openjdk-uber:${project.property('conscrypt.version')}"
testCompile "com.fasterxml.jackson.core:jackson-databind:${project.property('jackson.version')}"

View file

@ -8,8 +8,8 @@ dependencies {
//runtime project(':netty-http-kqueue')
} else if (Os.isFamily(Os.FAMILY_UNIX)) {
testRuntime "io.netty:netty-tcnative-boringssl-static:${project.property('tcnative.version')}"
testRuntime project(':netty-http-epoll')
//testRuntime project(':netty-http-epoll')
}
testCompile project(":netty-http-client")
testRuntime project(":netty-http-bouncycastle")
testCompile project(":netty-http-bouncycastle")
}

View file

@ -23,6 +23,7 @@ class BindExceptionTest {
Server server1 = Server.builder(domain).build();
Server server2 = Server.builder(domain).build();
try {
// ATTN: when using native libraries (epoll), the bind exception will be an internal error
Assertions.assertThrows(BindException.class, () ->{
ChannelFuture channelFuture1 = server1.accept();
assertNotNull(channelFuture1);

View file

@ -75,7 +75,7 @@ class CleartextTest {
@Test
void testPooledClearTextHttp2() throws Exception {
int loop = 1000;
int loop = 1024;
HttpAddress httpAddress = HttpAddress.http2("localhost", 8008);
Domain domain = Domain.builder(httpAddress)
.singleEndpoint("/", (request, response) ->
@ -90,8 +90,7 @@ class CleartextTest {
.addPoolNode(httpAddress)
.setPoolNodeConnectionLimit(2)
.build();
AtomicInteger counter = new AtomicInteger();
// a single instance of HTTP/2 response listener, always receives responses out-of-order
final AtomicInteger counter = new AtomicInteger();
final ResponseListener<HttpResponse> responseListener = resp -> {
if (resp.getStatus().getCode() == HttpResponseStatus.OK.code()) {
counter.incrementAndGet();
@ -116,7 +115,7 @@ class CleartextTest {
break;
}
}
transport.get();
transport.get(60L, TimeUnit.SECONDS);
} finally {
server.shutdownGracefully();
client.shutdownGracefully();

View file

@ -73,13 +73,14 @@ class EncryptedTest {
void testPooledSecureHttp2() throws Exception {
int loop = 1024;
HttpAddress httpAddress = HttpAddress.secureHttp2("localhost", 8143);
Server server = Server.builder(Domain.builder(httpAddress)
Domain domain = Domain.builder(httpAddress)
.setSelfCert()
.singleEndpoint("/", (request, response) ->
response.withStatus(HttpResponseStatus.OK)
.withContentType("text/plain")
.write(request.getContent().retain()))
.build())
response.withStatus(HttpResponseStatus.OK)
.withContentType("text/plain")
.write(request.getContent().retain()))
.build();
Server server = Server.builder(domain)
.build();
server.accept();
Client client = Client.builder()
@ -87,9 +88,15 @@ class EncryptedTest {
.addPoolNode(httpAddress)
.setPoolNodeConnectionLimit(2)
.build();
AtomicInteger counter = new AtomicInteger();
// a single instance of HTTP/2 response listener, always receives responses out-of-order
final ResponseListener<HttpResponse> responseListener = resp -> counter.incrementAndGet();
final AtomicInteger counter = new AtomicInteger();
final ResponseListener<HttpResponse> responseListener = resp -> {
if (resp.getStatus().getCode() == HttpResponseStatus.OK.code()) {
counter.incrementAndGet();
} else {
logger.log(Level.INFO, "response listener: headers = " + resp.getHeaders() +
" response body = " + resp.getBodyAsString(StandardCharsets.UTF_8));
}
};
try {
// single transport, single thread
Transport transport = client.newTransport();
@ -106,11 +113,12 @@ class EncryptedTest {
break;
}
}
transport.get(60, TimeUnit.SECONDS);
transport.get(60L, TimeUnit.SECONDS);
} finally {
client.shutdownGracefully();
server.shutdownGracefully();
client.shutdownGracefully();
}
logger.log(Level.INFO, "expecting=" + loop + " counter=" + counter.get());
assertEquals(loop, counter.get());
}