1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00
This commit is contained in:
Darien Raymond 2017-05-03 11:33:42 +02:00
parent 5b15d9aa92
commit 976395b4d6
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 5 additions and 3 deletions

View File

@ -1209,7 +1209,7 @@ func TestVMessGCMMuxUDP(t *testing.T) {
xorpayload := xor(payload)
for j := 0; j < 5; j++ {
for j := 0; j < 2; j++ {
nBytes, _, err := conn.WriteMsgUDP(payload, nil, nil)
assert.Error(err).IsNil()
assert.Int(nBytes).Equals(len(payload))
@ -1217,7 +1217,7 @@ func TestVMessGCMMuxUDP(t *testing.T) {
response := make([]byte, 1024)
oob := make([]byte, 16)
for j := 0; j < 5; j++ {
for j := 0; j < 2; j++ {
nBytes, _, _, _, err := conn.ReadMsgUDP(response, oob)
assert.Error(err).IsNil()
assert.Int(nBytes).Equals(1024)

View File

@ -41,7 +41,9 @@ func (server *Server) handleConnection(conn *net.UDPConn) {
}
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())
}
}
}