1
0
mirror of https://git.zx2c4.com/wireguard-go synced 2025-09-18 20:57:50 +02:00

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:
Josh Bleecher Snyder 2020-12-14 13:30:38 -08:00 committed by Jason A. Donenfeld
parent 77f5545896
commit e950ce7bd2

View File

@ -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