Skip to content

Commit

Permalink
🚑
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaubee committed Jan 10, 2025
1 parent c39b29e commit f7d2147
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions next/kmp/app/androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ android {
// signingConfig = signingConfigs.getByName("debug") // 如果是测试benchmark需要使用debug
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = true // 开启代码混淆
// setProguardFiles(listOf("proguard-rules.pro"))
setProguardFiles(emptyList<String>())
setProguardFiles(listOf("proguard-rules.pro"))
// setProguardFiles(emptyList<String>())
isShrinkResources = true // 移除无用的resource
configChannel(buildChannel, this)
manifestPlaceholders["isTestOnly"] = "false"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.dweb_browser.browser.scan

import io.ktor.http.HttpStatusCode
import io.ktor.utils.io.CancellationException
import kotlinx.coroutines.CancellationException
import org.dweb_browser.browser.BrowserI18nResource
import org.dweb_browser.core.help.types.DwebPermission
import org.dweb_browser.core.help.types.MICRO_MODULE_CATEGORY
Expand Down
2 changes: 1 addition & 1 deletion next/kmp/buildSrc/src/main/kotlin/Multiplatform.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fun KotlinCompilation<*>.configureCompilation() {
freeCompilerArgs.addAll(
"-Xexpect-actual-classes",
"-Xcontext-receivers",
"-XXLanguage:+ExplicitBackingFields",
// "-XXLanguage:+ExplicitBackingFields",
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import io.ktor.http.Url
import io.ktor.http.hostWithPort
import io.ktor.http.protocolWithAuthority
import io.ktor.util.decodeBase64String
import io.ktor.utils.io.CancellationException
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.launch
import kotlinx.serialization.json.Json
import org.dweb_browser.core.help.types.MICRO_MODULE_CATEGORY
Expand Down Expand Up @@ -638,9 +638,9 @@ class HttpNMM : NativeMicroModule("http.std.dweb", "HTTP Server Provider") {
val x_dweb_host = query_x_dweb_host ?: header_auth_host ?: header_x_dweb_host ?: header_host
return x_dweb_host?.let { host ->
val isWs = request.isWebSocket
val protocol = when (is_https) {
true -> if (isWs) URLProtocol.WSS else URLProtocol.HTTPS
false -> if (isWs) URLProtocol.WS else URLProtocol.HTTP
val protocol = when {
is_https -> if (isWs) URLProtocol.WSS else URLProtocol.HTTPS
else -> if (isWs) URLProtocol.WS else URLProtocol.HTTP
}
DwebGatewayInfo(host, protocol)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import io.ktor.server.response.respond
import io.ktor.server.websocket.WebSocketUpgrade
import io.ktor.server.websocket.WebSockets
import io.ktor.util.logging.KtorSimpleLogger
import io.ktor.utils.io.CancellationException
import io.ktor.websocket.Frame
import io.ktor.websocket.close
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.channels.Channel
Expand Down Expand Up @@ -133,8 +133,7 @@ open class KtorPureServer<out TEngine : ApplicationEngine, TConfiguration : Appl

protected open fun getCoroutineExceptionHandler(): CoroutineContext = commonAsyncExceptionHandler

protected suspend inline fun startServer(createServer: () -> ApplicationEngine) =
serverLock.withLock {
protected suspend inline fun startServer(createServer: () -> ApplicationEngine) = serverLock.withLock {
val engine = when (val engine = serverEngine) {
null -> {
createServer().also { newEngine ->
Expand Down

0 comments on commit f7d2147

Please sign in to comment.