diff --git a/app/build.gradle b/app/build.gradle index 3f02eb06..183c0172 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId = "info.dvkr.screenstream" minSdkVersion(21) targetSdkVersion(30) - versionCode = 30601 - versionName = "3.6.1" + versionCode = 30602 + versionName = "3.6.2" resConfigs("en", "ru", "pt-rBR", "zh-rTW", "fr-rFR", "fa", "it", "pl", "hi", "de", "sk", "es", "ar", "ja", "gl", "ca") vectorDrawables.useSupportLibrary = true diff --git a/data/build.gradle b/data/build.gradle index fdbe2bfc..83f2bad8 100644 --- a/data/build.gradle +++ b/data/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion(21) targetSdkVersion(30) - versionCode = 30601 - versionName = "3.6.1" + versionCode = 30602 + versionName = "3.6.2" } compileOptions { 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 1a7501d8..26dbe710 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 @@ -66,7 +67,8 @@ internal class HttpServer( XLog.d(getLog("startServer")) val coroutineExceptionHandler = CoroutineExceptionHandler { _, throwable -> - XLog.e(getLog("onCoroutineException")) + if (throwable is IOException) return@CoroutineExceptionHandler + XLog.e(getLog("onCoroutineException >>>")) XLog.e(getLog("onCoroutineException"), throwable) sendEvent(Event.Error(FatalError.HttpServerException)) ktorServer?.stop(250, 250) @@ -126,7 +128,7 @@ internal class HttpServer( XLog.w(getLog("startServer", ex.toString())) exception = FixableError.AddressInUseException } catch (throwable: Throwable) { - XLog.e(getLog("startServer")) + XLog.e(getLog("startServer >>>")) XLog.e(getLog("startServer"), throwable) exception = FatalError.HttpServerException } finally { diff --git a/data/src/main/kotlin/info/dvkr/screenstream/data/httpserver/KtorApplicationModule.kt b/data/src/main/kotlin/info/dvkr/screenstream/data/httpserver/KtorApplicationModule.kt index 0ef1a210..dc10869c 100644 --- a/data/src/main/kotlin/info/dvkr/screenstream/data/httpserver/KtorApplicationModule.kt +++ b/data/src/main/kotlin/info/dvkr/screenstream/data/httpserver/KtorApplicationModule.kt @@ -154,7 +154,7 @@ internal fun Application.appModule( val clientId = ClientData.getId(ipAddress, fallbackHost) if (clientData.isClientAllowed(clientId, ipAddress, fallbackHost).not()) { - call.respond(HttpStatusCode.Forbidden) + call.respond(HttpStatusCode.NotFound) return@get }