[core/common] Process packet body in launched coroutines, instead of suspending the processing queue. part of #2160.

This commit is contained in:
Him188 2022-08-15 16:41:17 +08:00
parent 9dd57de844
commit e6bef9ce1e
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375

View File

@ -121,7 +121,7 @@ internal abstract class CommonNetworkHandler<Conn>(
result.getOrNull()?.let { packet ->
try {
val decoded = decodePacket(packet)
processBody(decoded)
launch(start = CoroutineStart.UNDISPATCHED) { processBody(decoded) }
} catch (e: Throwable) {
if (e is CancellationException) return@launch
handleExceptionInDecoding(e)