Skip to content

Commit 421a736

Browse files
changes
1 parent a3b6185 commit 421a736

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

libp2p/src/main/kotlin/io/libp2p/transport/quic/QuicTransport.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import io.libp2p.security.tls.Libp2pTrustManager
2323
import io.libp2p.security.tls.buildCert
2424
import io.libp2p.security.tls.getJavaKey
2525
import io.libp2p.security.tls.getPublicKeyFromCert
26+
import io.libp2p.security.tls.verifyAndExtractPeerId
2627
import io.libp2p.transport.implementation.ConnectionOverNetty
2728
import io.libp2p.transport.implementation.NettyTransport
2829
import io.libp2p.transport.implementation.StreamOverNetty
@@ -173,7 +174,7 @@ class QuicTransport(
173174
listeners -= addr
174175
}
175176
}
176-
logger.info("Quic server listening on $addr")
177+
logger.info("Quic server listening on {}", addr)
177178
res.complete(null)
178179
}
179180
}
@@ -293,7 +294,7 @@ class QuicTransport(
293294
val javaPrivateKey = getJavaKey(connectionKeys.first)
294295
val isClient = expectedRemotePeerId != null
295296
val cert = buildCert(localKey, connectionKeys.first)
296-
log.info("Building {} keys and cert for peerid {}", certAlgorithm, PeerId.fromPubKey(localKey.publicKey()))
297+
logger.info("Building {} keys and cert for peer {}", certAlgorithm, PeerId.fromPubKey(localKey.publicKey()))
297298
return (
298299
if (isClient) {
299300
QuicSslContextBuilder.forClient().keyManager(javaPrivateKey, null, cert)
@@ -334,7 +335,7 @@ class QuicTransport(
334335
val remotePeerId = verifyAndExtractPeerId(arrayOf(remoteCert))
335336
val remotePublicKey = getPublicKeyFromCert(arrayOf(remoteCert))
336337

337-
log.info("Handshake completed with remote peer id: {}", remotePeerId)
338+
logger.info("Handshake completed with remote peer id: {}", remotePeerId)
338339

339340
connection.setSecureSession(
340341
SecureChannel.Session(
@@ -362,7 +363,7 @@ class QuicTransport(
362363

363364
@Deprecated("Deprecated in Java")
364365
override fun exceptionCaught(ctx: ChannelHandlerContext, cause: Throwable) {
365-
log.error("An error during handshake", cause)
366+
logger.error("An error during handshake", cause)
366367
ctx.close()
367368
}
368369
}
@@ -382,8 +383,8 @@ class QuicTransport(
382383
val connection: ConnectionOverNetty
383384
) : StreamMuxer.Session {
384385
override fun <T> createStream(protocols: List<ProtocolBinding<T>>): StreamPromise<T> {
385-
var multistreamProtocol: MultistreamProtocol = MultistreamProtocolV1
386-
var streamMultistreamProtocol: MultistreamProtocol by lazyVar { multistreamProtocol }
386+
val multistreamProtocol: MultistreamProtocol = MultistreamProtocolV1
387+
val streamMultistreamProtocol: MultistreamProtocol by lazyVar { multistreamProtocol }
387388
val multi = streamMultistreamProtocol.createMultistream(protocols)
388389

389390
val controller = CompletableFuture<T>()

versions.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencyManagement {
3131
entry 'protobuf-java'
3232
entry 'protoc'
3333
}
34-
dependencySet(group: "io.netty", version: "4.2.2.Final") {
34+
dependencySet(group: "io.netty", version: "4.2.4.Final") {
3535
entry 'netty-common'
3636
entry 'netty-handler'
3737
entry 'netty-transport'

0 commit comments

Comments
 (0)