mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-05 12:57:36 +03:00
WTF is this
This commit is contained in:
parent
bda93d516b
commit
923d3222b0
41 changed files with 421 additions and 507 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue