From 096117dda1c41b4aab9fc7c06a2a5176096dfb87 Mon Sep 17 00:00:00 2001 From: xjasonlyu Date: Thu, 31 Mar 2022 23:12:11 +0800 Subject: [PATCH] Chore: minor declaration --- core/device/iobased/endpoint.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/device/iobased/endpoint.go b/core/device/iobased/endpoint.go index bce099d..70a85b8 100644 --- a/core/device/iobased/endpoint.go +++ b/core/device/iobased/endpoint.go @@ -91,8 +91,9 @@ func (e *Endpoint) dispatchLoop(cancel context.CancelFunc) { // gracefully after (*Endpoint).dispatchLoop(context.CancelFunc) returns. defer cancel() + offset, mtu := e.offset, int(e.mtu) + for { - offset, mtu := e.offset, int(e.mtu) data := make([]byte, offset+mtu) n, err := e.rw.Read(data)