mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-04 09:17:32 -05:00
cleanup
This commit is contained in:
parent
5b15d9aa92
commit
976395b4d6
@ -1209,7 +1209,7 @@ func TestVMessGCMMuxUDP(t *testing.T) {
|
|||||||
|
|
||||||
xorpayload := xor(payload)
|
xorpayload := xor(payload)
|
||||||
|
|
||||||
for j := 0; j < 5; j++ {
|
for j := 0; j < 2; j++ {
|
||||||
nBytes, _, err := conn.WriteMsgUDP(payload, nil, nil)
|
nBytes, _, err := conn.WriteMsgUDP(payload, nil, nil)
|
||||||
assert.Error(err).IsNil()
|
assert.Error(err).IsNil()
|
||||||
assert.Int(nBytes).Equals(len(payload))
|
assert.Int(nBytes).Equals(len(payload))
|
||||||
@ -1217,7 +1217,7 @@ func TestVMessGCMMuxUDP(t *testing.T) {
|
|||||||
|
|
||||||
response := make([]byte, 1024)
|
response := make([]byte, 1024)
|
||||||
oob := make([]byte, 16)
|
oob := make([]byte, 16)
|
||||||
for j := 0; j < 5; j++ {
|
for j := 0; j < 2; j++ {
|
||||||
nBytes, _, _, _, err := conn.ReadMsgUDP(response, oob)
|
nBytes, _, _, _, err := conn.ReadMsgUDP(response, oob)
|
||||||
assert.Error(err).IsNil()
|
assert.Error(err).IsNil()
|
||||||
assert.Int(nBytes).Equals(1024)
|
assert.Int(nBytes).Equals(1024)
|
||||||
|
@ -41,7 +41,9 @@ func (server *Server) handleConnection(conn *net.UDPConn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
response := server.MsgProcessor(buffer[:nBytes])
|
response := server.MsgProcessor(buffer[:nBytes])
|
||||||
conn.WriteToUDP(response, addr)
|
if _, err := conn.WriteToUDP(response, addr); err != nil {
|
||||||
|
fmt.Println("Failed to write to UDP: ", err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user