The JDK reads its HTTP server limits (connection cap, request and response deadlines, not draining unread bodies) once, when the first server in the JVM starts. They were set inside createServer, so any earlier server silently disabled them; in the test suite that made the oversized-body and host checks hang depending on test order. The limits now live in http-limits.properties, the relay applies them first thing in main, and the test task passes them to the test JVM.
31 lines
1.5 KiB
Kotlin
31 lines
1.5 KiB
Kotlin
import java.util.Properties
|
|
|
|
plugins { kotlin("jvm"); kotlin("plugin.serialization"); application }
|
|
kotlin { jvmToolchain(17) }
|
|
dependencies {
|
|
implementation(project(":shared"))
|
|
testImplementation(kotlin("test-junit"))
|
|
}
|
|
application { mainClass.set("monster.autisme.deadchannel.server.MainKt") }
|
|
tasks.processResources { from(rootProject.file("docs/campaign-format.md")) { into("campaigns"); rename { "authoring-guide.md" } } }
|
|
distributions {
|
|
main {
|
|
contents {
|
|
from(rootProject.file("deploy")) { into("deploy") }
|
|
from(rootProject.file("docs/internet-hosting.md")) { into("docs") }
|
|
from(rootProject.file("scripts/security_smoke.py")) { into("scripts") }
|
|
from(rootProject.file("scripts/smoke.py")) { into("scripts") }
|
|
// Campaign authors get the schema, the reference campaign and the format guide next to the server.
|
|
from("src/main/resources/campaigns") { into("campaigns") }
|
|
from(rootProject.file("docs/campaign-format.md")) { into("docs") }
|
|
from(rootProject.file("docs/mcp.md")) { into("docs") }
|
|
}
|
|
}
|
|
}
|
|
tasks.test {
|
|
testLogging { events("passed", "failed", "skipped") }
|
|
// The JDK reads its HTTP server limits once per JVM; set them before any test can start a server.
|
|
val limits = Properties().apply { file("src/main/resources/http-limits.properties").inputStream().use { load(it) } }
|
|
for (name in limits.stringPropertyNames()) systemProperty(name, limits.getProperty(name))
|
|
}
|