Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor fixes #67

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jnr_enxio = "0.32.18"
jupiter = "5.11.3"
kotlin = "2.0.21"
kotlinter = "4.5.0"
knet = "0.1.7"
knet = "0.1.8"
logback-android = "3.0.0"
logback-classic = "1.5.12"
material = "1.12.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import com.jasonernst.knet.Packet
import com.jasonernst.packetdumper.AbstractPacketDumper
import com.jasonernst.packetdumper.DummyPacketDumper
import com.jasonernst.packetdumper.ethernet.EtherType
import com.jasonernst.packetdumper.filedumper.AbstractFilePacketDumper
import com.jasonernst.packetdumper.serverdumper.AbstractServerPacketDumper
import com.jasonernst.packetdumper.serverdumper.PcapNgTcpServerPacketDumper
import kotlinx.coroutines.CompletableJob
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -77,7 +79,6 @@ class ProxyServer(
server.start()

Signal.handle(Signal("INT")) {
packetDumper.stop()
server.stop()
}

Expand Down Expand Up @@ -211,6 +212,11 @@ class ProxyServer(
datagramChannel.close()
kAnonProxy.stop()
selector.close()
if (packetDumper is AbstractServerPacketDumper) {
packetDumper.stop()
} else if (packetDumper is AbstractFilePacketDumper) {
packetDumper.close()
}
logger.debug("Stopping outstanding sessions")
sessions.values.forEach { it.stop() }
logger.debug("All sessions stopped, stopping selector job")
Expand Down
Loading