Commit 4478fbaf authored by Daniel Wolf's avatar Daniel Wolf
Browse files

inline

parent 9d964d51
...@@ -218,10 +218,9 @@ open class VPNTunnelProxy(val packetProxy: PacketProxy, ...@@ -218,10 +218,9 @@ open class VPNTunnelProxy(val packetProxy: PacketProxy,
val readSize = deviceInput.read(packetFromDevice) val readSize = deviceInput.read(packetFromDevice)
if (readSize != -1) { if (readSize != -1) {
val writeToken = tunnelHandle?.issueDeviceWriteToken() ?: return val writeToken = tunnelHandle?.issueDeviceWriteToken() ?: return
val actualPacketFromDevice = packetFromDevice.copyOfRange(0, readSize)
trafficStats.packetsReceivedFromDevice++ trafficStats.packetsReceivedFromDevice++
trafficStats.bytesFromDevice += actualPacketFromDevice.size trafficStats.bytesFromDevice += readSize
packetProxy.processDevicePacket(writeToken, actualPacketFromDevice) packetProxy.processDevicePacket(writeToken, packetFromDevice.copyOfRange(0, readSize))
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment