WTF is this

This commit is contained in:
世界 2024-06-24 09:49:15 +08:00
parent bda93d516b
commit 923d3222b0
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
41 changed files with 421 additions and 507 deletions

View file

@ -5,7 +5,7 @@ import (
"io"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/rw"
"github.com/sagernet/sing/common/varbin"
)
func readError(reader io.Reader) error {
@ -15,7 +15,7 @@ func readError(reader io.Reader) error {
return err
}
if hasError {
errorMessage, err := rw.ReadVString(reader)
errorMessage, err := varbin.ReadValue[string](reader, binary.BigEndian)
if err != nil {
return err
}
@ -30,7 +30,7 @@ func writeError(writer io.Writer, wErr error) error {
return err
}
if wErr != nil {
err = rw.WriteVString(writer, wErr.Error())
err = varbin.Write(writer, binary.BigEndian, wErr.Error())
if err != nil {
return err
}