device: accept any io.Reader in device.IpcSetOperation
Any io.Reader will do, and there are no performance concerns here. This is technically backwards incompatible, but it is very unlikely to break any existing code. It is compatible with the existing uses in wireguard-{windows,android,apple} and also will allow us to slightly simplify it if desired. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
parent
db1edc7e91
commit
93a4313c3a
@ -107,8 +107,8 @@ func (device *Device) IpcGetOperation(socket *bufio.Writer) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (device *Device) IpcSetOperation(socket *bufio.Reader) error {
|
||||
scanner := bufio.NewScanner(socket)
|
||||
func (device *Device) IpcSetOperation(r io.Reader) error {
|
||||
scanner := bufio.NewScanner(r)
|
||||
logError := device.log.Error
|
||||
logDebug := device.log.Debug
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user