diff --git a/transport/internet/kcp/receiving.go b/transport/internet/kcp/receiving.go index 3bf5ee75..5482d45a 100644 --- a/transport/internet/kcp/receiving.go +++ b/transport/internet/kcp/receiving.go @@ -205,6 +205,9 @@ func (w *ReceivingWorker) ReadMultiBuffer() buf.MultiBuffer { func (w *ReceivingWorker) Read(b []byte) int { mb := w.ReadMultiBuffer() + if mb.IsEmpty() { + return 0 + } nBytes, err := mb.Read(b) common.Must(err) if !mb.IsEmpty() {