mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2025-02-13 01:11:20 +01:00
fix #176 exceptions on tail of pipeline
This commit is contained in:
parent
24fb56d0dc
commit
9a3ea9d690
@ -255,4 +255,8 @@ fun reverseLookup(address: InetAddress): String {
|
||||
.asReversed()
|
||||
.joinToString(".") + ".ip6.arpa"
|
||||
}
|
||||
}
|
||||
|
||||
fun Channel.fireExceptionCaughtIfOpen(e: Exception) {
|
||||
if (isOpen()) pipeline().fireExceptionCaught(e)
|
||||
}
|
@ -7,6 +7,7 @@ import com.google.common.util.concurrent.RateLimiter
|
||||
import com.viaversion.aas.codec.packet.Packet
|
||||
import com.viaversion.aas.codec.packet.handshake.Handshake
|
||||
import com.viaversion.aas.config.VIAaaSConfig
|
||||
import com.viaversion.aas.fireExceptionCaughtIfOpen
|
||||
import com.viaversion.aas.handler.MinecraftHandler
|
||||
import com.viaversion.aas.mcLogger
|
||||
import com.viaversion.aas.setAutoRead
|
||||
@ -113,7 +114,7 @@ class HandshakeState : ConnectionState {
|
||||
try {
|
||||
connectBack(handler, packet.address, packet.port, packet.nextState)
|
||||
} catch (e: Exception) {
|
||||
ctx.fireExceptionCaught(e)
|
||||
ctx.channel().fireExceptionCaughtIfOpen(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ class LoginState : ConnectionState {
|
||||
forward(frontHandler, cryptoResponse, true)
|
||||
backChan.pipeline().addBefore("frame", "crypto", CryptoCodec(aesKey(backKey), aesKey(backKey)))
|
||||
} catch (e: Exception) {
|
||||
frontHandler.data.frontChannel.pipeline().fireExceptionCaught(e)
|
||||
frontHandler.data.frontChannel.fireExceptionCaughtIfOpen(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -224,7 +224,7 @@ class LoginState : ConnectionState {
|
||||
loginStart.username = backName!!
|
||||
send(handler.data.backChannel!!, loginStart, true)
|
||||
} catch (e: Exception) {
|
||||
handler.data.frontChannel.pipeline().fireExceptionCaught(e)
|
||||
handler.data.frontChannel.fireExceptionCaughtIfOpen(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user