Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed May 3, 2017
1 parent 5b15d9a commit 976395b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions testing/scenarios/vmess_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1209,15 +1209,15 @@ 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))
}

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)
Expand Down
4 changes: 3 additions & 1 deletion testing/servers/udp/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
}

Expand Down

0 comments on commit 976395b

Please sign in to comment.