mirror of
https://github.com/SagerNet/sing-mux.git
synced 2025-04-04 12:27:40 +03:00
Fix WriteAddrPort usage
This commit is contained in:
parent
2a10ebd53b
commit
7befbadbf3
3 changed files with 28 additions and 14 deletions
|
@ -143,7 +143,7 @@ func streamRequestLen(request StreamRequest) int {
|
|||
return rLen
|
||||
}
|
||||
|
||||
func EncodeStreamRequest(request StreamRequest, buffer *buf.Buffer) {
|
||||
func EncodeStreamRequest(request StreamRequest, buffer *buf.Buffer) error {
|
||||
destination := request.Destination
|
||||
var flags uint16
|
||||
if request.Network == N.NetworkUDP {
|
||||
|
@ -155,10 +155,8 @@ func EncodeStreamRequest(request StreamRequest, buffer *buf.Buffer) {
|
|||
destination = Destination
|
||||
}
|
||||
}
|
||||
common.Must(
|
||||
binary.Write(buffer, binary.BigEndian, flags),
|
||||
M.SocksaddrSerializer.WriteAddrPort(buffer, destination),
|
||||
)
|
||||
common.Must(binary.Write(buffer, binary.BigEndian, flags))
|
||||
return M.SocksaddrSerializer.WriteAddrPort(buffer, destination)
|
||||
}
|
||||
|
||||
type StreamResponse struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue