diff --git a/gbcs-client/src/main/kotlin/net/woggioni/gbcs/client/Client.kt b/gbcs-client/src/main/kotlin/net/woggioni/gbcs/client/Client.kt
index 864d434..8dfe523 100644
--- a/gbcs-client/src/main/kotlin/net/woggioni/gbcs/client/Client.kt
+++ b/gbcs-client/src/main/kotlin/net/woggioni/gbcs/client/Client.kt
@@ -154,7 +154,7 @@ class GradleBuildCacheClient(private val profile: Configuration.Profile) : AutoC
// HTTP handlers
pipeline.addLast("codec", HttpClientCodec())
pipeline.addLast("decompressor", HttpContentDecompressor())
- pipeline.addLast("aggregator", HttpObjectAggregator(1048576))
+ pipeline.addLast("aggregator", HttpObjectAggregator(134217728))
pipeline.addLast("chunked", ChunkedWriteHandler())
}
}
@@ -203,9 +203,9 @@ class GradleBuildCacheClient(private val profile: Configuration.Profile) : AutoC
ctx: ChannelHandlerContext,
response: FullHttpResponse
) {
- responseFuture.complete(response)
pipeline.removeLast()
pool.release(channel)
+ responseFuture.complete(response)
}
override fun exceptionCaught(ctx: ChannelHandlerContext, cause: Throwable) {
@@ -217,7 +217,6 @@ class GradleBuildCacheClient(private val profile: Configuration.Profile) : AutoC
ctx.close()
pipeline.removeLast()
pool.release(channel)
- super.exceptionCaught(ctx, cause)
}
})
// Prepare the HTTP request
diff --git a/gbcs-server/src/main/kotlin/net/woggioni/gbcs/server/GradleBuildCacheServer.kt b/gbcs-server/src/main/kotlin/net/woggioni/gbcs/server/GradleBuildCacheServer.kt
index 247e9de..c69b82e 100644
--- a/gbcs-server/src/main/kotlin/net/woggioni/gbcs/server/GradleBuildCacheServer.kt
+++ b/gbcs-server/src/main/kotlin/net/woggioni/gbcs/server/GradleBuildCacheServer.kt
@@ -24,6 +24,7 @@ import io.netty.handler.ssl.SslContext
import io.netty.handler.ssl.SslContextBuilder
import io.netty.handler.ssl.SslHandler
import io.netty.handler.stream.ChunkedWriteHandler
+import io.netty.handler.timeout.IdleState
import io.netty.handler.timeout.IdleStateEvent
import io.netty.handler.timeout.IdleStateHandler
import io.netty.util.AttributeKey
@@ -314,8 +315,17 @@ class GradleBuildCacheServer(private val cfg: Configuration) {
pipeline.addLast(object : ChannelInboundHandlerAdapter() {
override fun userEventTriggered(ctx: ChannelHandlerContext, evt: Any) {
if (evt is IdleStateEvent) {
- log.debug {
- "Idle timeout reached on channel ${ch.id().asShortText()}, closing the connection"
+ when(evt.state()) {
+ IdleState.READER_IDLE -> log.debug {
+ "Read timeout reached on channel ${ch.id().asShortText()}, closing the connection"
+ }
+ IdleState.WRITER_IDLE -> log.debug {
+ "Write timeout reached on channel ${ch.id().asShortText()}, closing the connection"
+ }
+ IdleState.ALL_IDLE -> log.debug {
+ "Idle timeout reached on channel ${ch.id().asShortText()}, closing the connection"
+ }
+ null -> throw IllegalStateException("This should never happen")
}
ctx.close()
}
diff --git a/gbcs-server/src/main/kotlin/net/woggioni/gbcs/server/configuration/Serializer.kt b/gbcs-server/src/main/kotlin/net/woggioni/gbcs/server/configuration/Serializer.kt
index de4a9c6..bde42d9 100644
--- a/gbcs-server/src/main/kotlin/net/woggioni/gbcs/server/configuration/Serializer.kt
+++ b/gbcs-server/src/main/kotlin/net/woggioni/gbcs/server/configuration/Serializer.kt
@@ -154,6 +154,9 @@ object Serializer {
conf.tls?.let { tlsConfiguration ->
node("tls") {
+ if(tlsConfiguration.isVerifyClients) {
+ attr("verify-clients", "true")
+ }
tlsConfiguration.keyStore?.let { keyStore ->
node("keystore") {
attr("file", keyStore.file.toString())
diff --git a/gbcs-server/src/main/resources/net/woggioni/gbcs/server/schema/gbcs.xsd b/gbcs-server/src/main/resources/net/woggioni/gbcs/server/schema/gbcs.xsd
index 835147d..24445b2 100644
--- a/gbcs-server/src/main/resources/net/woggioni/gbcs/server/schema/gbcs.xsd
+++ b/gbcs-server/src/main/resources/net/woggioni/gbcs/server/schema/gbcs.xsd
@@ -183,7 +183,7 @@
-
+
diff --git a/gbcs-server/src/test/resources/net/woggioni/gbcs/server/test/valid/gbcs-tls.xml b/gbcs-server/src/test/resources/net/woggioni/gbcs/server/test/valid/gbcs-tls.xml
index 6f52c1c..cda0103 100644
--- a/gbcs-server/src/test/resources/net/woggioni/gbcs/server/test/valid/gbcs-tls.xml
+++ b/gbcs-server/src/test/resources/net/woggioni/gbcs/server/test/valid/gbcs-tls.xml
@@ -60,7 +60,7 @@
-
+