mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-10 09:45:08 +00:00
derp, wgengine/magicsock: support more than just packets from Client.Recv
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
88f1cc0c98
commit
379a3125fd
@@ -76,13 +76,18 @@ func TestSendRecv(t *testing.T) {
|
||||
go func(i int) {
|
||||
for {
|
||||
b := make([]byte, 1<<16)
|
||||
n, err := clients[i].Recv(b)
|
||||
m, err := clients[i].Recv(b)
|
||||
if err != nil {
|
||||
errCh <- err
|
||||
return
|
||||
}
|
||||
b = b[:n]
|
||||
recvChs[i] <- b
|
||||
switch m := m.(type) {
|
||||
default:
|
||||
t.Errorf("unexpected message type %T", m)
|
||||
continue
|
||||
case ReceivedPacket:
|
||||
recvChs[i] <- []byte(m)
|
||||
}
|
||||
}
|
||||
}(i)
|
||||
}
|
||||
|
Reference in New Issue
Block a user