chore: remove redundant writeFull in snell v4

This commit is contained in:
wwqgtxx committed 2026-07-14 09:16:19 +08:00
1 parent f23e43e68a
commit 1d1b370e4c
1 file changed
+2 -15
+2 -15
View File
@@ -361,7 +361,8 @@ func (w *v4Writer) writeFrame(payload []byte, paddingLength int) error {
}
frame = append(frame, payloadCipher...)
return writeFull(w.Writer, frame)
_, err := w.Writer.Write(frame)
return err
}
func swapPadding(padding, payloadCipher []byte) {
@@ -466,20 +467,6 @@ func randomUnitFloat64() (float64, error) {
return float64(n.Int64()) / math.Exp2(53), nil
}
func writeFull(w io.Writer, p []byte) error {
for len(p) > 0 {
n, err := w.Write(p)
if err != nil {
return err
}
if n == 0 {
return io.ErrShortWrite
}
p = p[n:]
}
return nil
}
func incrementV4Nonce(nonce []byte) {
for i := range nonce {
nonce[i]++