Skip to content

Commit

Permalink
CodeQL: rename HydraLabVpnLogger file (#669)
Browse files Browse the repository at this point in the history
<!-- Please provide brief information about the PR, what it contains &
its purpose, new behaviors after the change. And let us know here if you
need any help: https://github.com/microsoft/HydraLab/issues/new -->

## Description

<!-- A few words to explain your changes -->

### Linked GitHub issue ID: #  

## Pull Request Checklist
<!-- Put an x in the boxes that apply. This is simply a reminder of what
we are going to look for before merging your code. -->

- [ ] Tests for the changes have been added (for bug fixes / features)
- [x] Code compiles correctly with all tests are passed.
- [ ] I've read the [contributing
guide](https://github.com/microsoft/HydraLab/blob/main/CONTRIBUTING.md#making-changes-to-the-code)
and followed the recommended practices.
- [ ] [Wikis](https://github.com/microsoft/HydraLab/wiki) or
[README](https://github.com/microsoft/HydraLab/blob/main/README.md) have
been reviewed and added / updated if needed (for bug fixes / features)

### Does this introduce a breaking change?
*If this introduces a breaking change for Hydra Lab users, please
describe the impact and migration path.*

- [ ] Yes
- [ ] No

## How you tested it
*Please make sure the change is tested, you can test it by adding UTs,
do local test and share the screenshots, etc.*


Please check the type of change your PR introduces:
- [x] Bugfix
- [ ] Feature
- [ ] Technical design
- [ ] Build related changes
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Code style update (formatting, renaming) or Documentation content
changes
- [ ] Other (please describe): 

### Feature UI screenshots or Technical design diagrams
*If this is a relatively large or complex change, kick it off by drawing
the tech design with PlantUML and explaining why you chose the solution
you did and what alternatives you considered, etc...*
  • Loading branch information
zhou9584 authored Jan 2, 2025
1 parent e950a25 commit 2043c5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import java.io.FileWriter
import java.io.IOException
import kotlin.io.path.Path

class HydraLabVpnLogger(private var filePath: String?) {
class HydraLabVpnLoggerTemp(private var filePath: String?) {
private var lines = mutableListOf<String>()
private var linesStaging = listOf<String>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ object ToNetworkQueueWorker : Runnable {

private lateinit var vpnInput: FileChannel

private lateinit var vpnLogger: HydraLabVpnLogger
private lateinit var vpnLogger: HydraLabVpnLoggerTemp

var totalInputCount = 0L

fun start(vpnFileDescriptor: FileDescriptor, logger: HydraLabVpnLogger) {
fun start(vpnFileDescriptor: FileDescriptor, logger: HydraLabVpnLoggerTemp) {
if (this::thread.isInitialized && thread.isAlive) throw IllegalStateException("Running already")
vpnInput = FileInputStream(vpnFileDescriptor).channel
vpnLogger = logger
Expand Down Expand Up @@ -107,9 +107,9 @@ object ToDeviceQueueWorker : Runnable {

private lateinit var vpnOutput: FileChannel

private lateinit var vpnLogger: HydraLabVpnLogger
private lateinit var vpnLogger: HydraLabVpnLoggerTemp

fun start(vpnFileDescriptor: FileDescriptor, logger: HydraLabVpnLogger) {
fun start(vpnFileDescriptor: FileDescriptor, logger: HydraLabVpnLoggerTemp) {
if (this::thread.isInitialized && thread.isAlive) throw IllegalStateException("Is already running")
vpnOutput = FileOutputStream(vpnFileDescriptor).channel
vpnLogger = logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class HydraLabVpnService : VpnService() {

private lateinit var vpnInterface: ParcelFileDescriptor

private lateinit var vpnLogger: HydraLabVpnLogger
private lateinit var vpnLogger: HydraLabVpnLoggerTemp

override fun onCreate() {
UdpSendWorker.start(this)
Expand Down Expand Up @@ -62,7 +62,7 @@ class HydraLabVpnService : VpnService() {

private fun connect(config: VpnUserConfig) {
vpnInterface = createVpnInterface(config)
vpnLogger = HydraLabVpnLogger(config.dumpPath)
vpnLogger = HydraLabVpnLoggerTemp(config.dumpPath)
val fileDescriptor = vpnInterface.fileDescriptor
ToNetworkQueueWorker.start(fileDescriptor, vpnLogger)
ToDeviceQueueWorker.start(fileDescriptor, vpnLogger)
Expand Down

0 comments on commit 2043c5a

Please sign in to comment.