Small comment layout tweak.

This commit is contained in:
Jeroen Leenarts 2018-09-16 22:43:40 +02:00
parent 4d7c20e146
commit ffd392a526
1 changed files with 2 additions and 2 deletions

View File

@ -136,8 +136,8 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
return withStringsAsGoStrings(interfaceName, settings) { (nameGoStr, settingsGoStr) -> Int32 in return withStringsAsGoStrings(interfaceName, settings) { (nameGoStr, settingsGoStr) -> Int32 in
return withUnsafeMutablePointer(to: &wgContext) { (wgCtxPtr) -> Int32 in return withUnsafeMutablePointer(to: &wgContext) { (wgCtxPtr) -> Int32 in
return wgTurnOn(nameGoStr, settingsGoStr, return wgTurnOn(nameGoStr, settingsGoStr,
// read_fn: Read from the TUN interface and pass it on to WireGuard
{ (wgCtxPtr, buf, len) -> Int in { (wgCtxPtr, buf, len) -> Int in
// read_fn: Read from the TUN interface and pass it on to WireGuard
guard let wgCtxPtr = wgCtxPtr else { return 0 } guard let wgCtxPtr = wgCtxPtr else { return 0 }
guard let buf = buf else { return 0 } guard let buf = buf else { return 0 }
let wgContext = wgCtxPtr.bindMemory(to: WireGuardContext.self, capacity: 1).pointee let wgContext = wgCtxPtr.bindMemory(to: WireGuardContext.self, capacity: 1).pointee
@ -151,8 +151,8 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
} }
return 0 return 0
}, },
// write_fn: Receive packets from WireGuard and write to the TUN interface
{ (wgCtxPtr, buf, len) -> Int in { (wgCtxPtr, buf, len) -> Int in
// write_fn: Receive packets from WireGuard and write to the TUN interface
guard let wgCtxPtr = wgCtxPtr else { return 0 } guard let wgCtxPtr = wgCtxPtr else { return 0 }
guard let buf = buf else { return 0 } guard let buf = buf else { return 0 }
guard len > 0 else { return 0 } guard len > 0 else { return 0 }