diff --git a/app/build.gradle b/app/build.gradle index 1aa7f8f2..d036ba6e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId = "info.dvkr.screenstream" minSdkVersion(21) targetSdkVersion(31) - versionCode = 30807 - versionName = "3.8.7" + versionCode = 30808 + versionName = "3.8.8" resConfigs 'en', 'ru', 'pt-rBR', 'zh-rTW', 'fr-rFR', 'fa', 'it', 'pl', 'hi', 'de', 'sk', 'es', 'ar', 'ja', 'gl', 'ca', 'uk', 'nl' vectorDrawables.useSupportLibrary = true @@ -128,9 +128,9 @@ dependencies { exclude group: "androidx.fragment" exclude group: "androidx.core" } - firebaseImplementation("com.google.firebase:firebase-analytics:20.1.0") - firebaseImplementation("com.google.firebase:firebase-crashlytics:18.2.8") - firebaseImplementation("com.google.android.gms:play-services-ads:20.5.0") + firebaseImplementation("com.google.firebase:firebase-analytics:20.1.2") + firebaseImplementation("com.google.firebase:firebase-crashlytics:18.2.9") + firebaseImplementation("com.google.android.gms:play-services-ads:20.6.0") debugImplementation("com.squareup.leakcanary:leakcanary-android:2.8.1") } diff --git a/data/build.gradle b/data/build.gradle index 1b00d45a..91733f9a 100644 --- a/data/build.gradle +++ b/data/build.gradle @@ -32,7 +32,7 @@ dependencies { implementation("androidx.core:core:1.7.0") implementation("androidx.window:window:1.0.0") - implementation("io.ktor:ktor-server-cio:1.6.7") + implementation("io.ktor:ktor-server-cio:1.6.8") implementation("com.github.iamironz:binaryprefs:1.0.1") implementation('com.elvishew:xlog:1.11.0') diff --git a/data/src/main/kotlin/info/dvkr/screenstream/data/httpserver/HttpServer.kt b/data/src/main/kotlin/info/dvkr/screenstream/data/httpserver/HttpServer.kt index 8d9ea304..978c9f87 100644 --- a/data/src/main/kotlin/info/dvkr/screenstream/data/httpserver/HttpServer.kt +++ b/data/src/main/kotlin/info/dvkr/screenstream/data/httpserver/HttpServer.kt @@ -18,6 +18,7 @@ import io.ktor.utils.io.* import kotlinx.coroutines.* import kotlinx.coroutines.flow.* import java.io.ByteArrayOutputStream +import java.io.IOException import java.net.BindException import java.util.* import java.util.concurrent.atomic.AtomicReference @@ -72,8 +73,11 @@ internal class HttpServer( XLog.d(getLog("onCoroutineException", "ktorServer: ${ktorServer?.hashCode()}")) ktorServer?.stop(0, 250) ktorServer = null - if (throwable is BindException) sendEvent(Event.Error(FixableError.AddressInUseException)) - else sendEvent(Event.Error(FatalError.HttpServerException)) + when (throwable) { + is BindException -> sendEvent(Event.Error(FixableError.AddressInUseException)) + is IOException -> Unit // Ignore + else -> sendEvent(Event.Error(FatalError.HttpServerException)) + } } val coroutineScope = CoroutineScope(Job() + Dispatchers.Default + coroutineExceptionHandler)