1
0
mirror of https://git.zx2c4.com/wireguard-go synced 2024-11-15 01:05:15 +01:00

uapi: Simpler function signature

This commit is contained in:
Jason A. Donenfeld 2019-01-23 22:05:07 +01:00
parent 89d2c5ed7a
commit 2b7562abbb

View File

@ -28,7 +28,7 @@ func (s *IPCError) ErrorCode() int64 {
return s.int64 return s.int64
} }
func ipcGetOperation(device *Device, socket *bufio.ReadWriter) *IPCError { func ipcGetOperation(device *Device, socket *bufio.Writer) *IPCError {
device.log.Debug.Println("UAPI: Processing get operation") device.log.Debug.Println("UAPI: Processing get operation")
@ -108,7 +108,7 @@ func ipcGetOperation(device *Device, socket *bufio.ReadWriter) *IPCError {
return nil return nil
} }
func ipcSetOperation(device *Device, socket *bufio.ReadWriter) *IPCError { func ipcSetOperation(device *Device, socket *bufio.Reader) *IPCError {
scanner := bufio.NewScanner(socket) scanner := bufio.NewScanner(socket)
logError := device.log.Error logError := device.log.Error
logDebug := device.log.Debug logDebug := device.log.Debug
@ -403,11 +403,11 @@ func ipcHandle(device *Device, socket net.Conn) {
switch op { switch op {
case "set=1\n": case "set=1\n":
device.log.Debug.Println("UAPI: Set operation") device.log.Debug.Println("UAPI: Set operation")
status = ipcSetOperation(device, buffered) status = ipcSetOperation(device, buffered.Reader)
case "get=1\n": case "get=1\n":
device.log.Debug.Println("UAPI: Get operation") device.log.Debug.Println("UAPI: Get operation")
status = ipcGetOperation(device, buffered) status = ipcGetOperation(device, buffered.Writer)
default: default:
device.log.Error.Println("Invalid UAPI operation:", op) device.log.Error.Println("Invalid UAPI operation:", op)