From 3a2ebdbafaea177cd2f29ba035d646c5d0b3cb44 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Wed, 7 Feb 2018 15:19:02 -0800 Subject: [PATCH] Update to Netty 4.1.21 and test read-only memory mapped file (#370) --- .../java/com/microsoft/rest/v2/http/SharedChannelPool.java | 4 +--- .../java/com/microsoft/rest/v2/RestProxyStressTests.java | 5 ++--- pom.xml | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/client-runtime/src/main/java/com/microsoft/rest/v2/http/SharedChannelPool.java b/client-runtime/src/main/java/com/microsoft/rest/v2/http/SharedChannelPool.java index 7e063db73bcf..73c8f8376330 100644 --- a/client-runtime/src/main/java/com/microsoft/rest/v2/http/SharedChannelPool.java +++ b/client-runtime/src/main/java/com/microsoft/rest/v2/http/SharedChannelPool.java @@ -15,7 +15,6 @@ import io.netty.channel.pool.ChannelPoolHandler; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; -import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import io.netty.util.AttributeKey; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GenericFutureListener; @@ -80,8 +79,7 @@ protected void initChannel(Channel ch) throws Exception { this.available = new ConcurrentMultiHashMap<>(); this.leased = new ConcurrentMultiHashMap<>(); try { - sslContext = SslContextBuilder.forClient() - .trustManager(InsecureTrustManagerFactory.INSTANCE).build(); + sslContext = SslContextBuilder.forClient().build(); } catch (SSLException e) { throw new RuntimeException(e); } diff --git a/client-runtime/src/test/java/com/microsoft/rest/v2/RestProxyStressTests.java b/client-runtime/src/test/java/com/microsoft/rest/v2/RestProxyStressTests.java index f0346ed76bab..eeaffc798f96 100644 --- a/client-runtime/src/test/java/com/microsoft/rest/v2/RestProxyStressTests.java +++ b/client-runtime/src/test/java/com/microsoft/rest/v2/RestProxyStressTests.java @@ -311,9 +311,8 @@ public byte[] apply(Integer integer) throws Exception { .zipWith(md5s, new BiFunction() { @Override public Completable apply(Integer id, final byte[] md5) throws Exception { - // Must memory map in read/write mode for native transports until Netty 4.1.21.Final release. - final FileChannel fileStream = FileChannel.open(TEMP_FOLDER_PATH.resolve("100m-" + id + ".dat"), StandardOpenOption.READ, StandardOpenOption.WRITE); - Flowable stream = FlowableUtil.split(fileStream.map(FileChannel.MapMode.READ_WRITE, 0, fileStream.size()), CHUNK_SIZE); + final FileChannel fileStream = FileChannel.open(TEMP_FOLDER_PATH.resolve("100m-" + id + ".dat"), StandardOpenOption.READ); + Flowable stream = FlowableUtil.split(fileStream.map(FileChannel.MapMode.READ_ONLY, 0, fileStream.size()), CHUNK_SIZE); return service.upload100MB(String.valueOf(id), sas, "BlockBlob", stream, FILE_SIZE).flatMapCompletable(new Function, CompletableSource>() { @Override public CompletableSource apply(RestResponse response) throws Exception { diff --git a/pom.xml b/pom.xml index 7abde77f91b7..4b2a262b8827 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ - 4.1.20.Final + 4.1.21.Final UTF-8