udp: Use net.IP inputs for connection ID generation

Add enum for action IDs

Remove unnecessary length check
This commit is contained in:
Justin Li
2015-02-23 21:30:45 -05:00
parent 3d28f281fb
commit 14a6278de0
5 changed files with 23 additions and 23 deletions

View File

@@ -20,10 +20,10 @@ import (
)
var testPort = "34137"
var connectAction = []byte{0, 0, 0, 0}
var announceAction = []byte{0, 0, 0, 1}
var scrapeAction = []byte{0, 0, 0, 2}
var errorAction = []byte{0, 0, 0, 3}
var connectAction = []byte{0, 0, 0, byte(connectActionID)}
var announceAction = []byte{0, 0, 0, byte(announceActionID)}
var scrapeAction = []byte{0, 0, 0, byte(scrapeActionID)}
var errorAction = []byte{0, 0, 0, byte(errorActionID)}
func init() {
stats.DefaultStats = stats.New(config.StatsConfig{})