jbuchbinder/go-gmetric — pull request #2 by athomason (2014-01-06 23:13:21+00:00)
Title: Fix sending to uninitialized servers

Previously, OpenConnections created a UDPConn for each entry in g.Servers, but
g.Servers is preallocated to contain MAX_GMETRIC_SERVERS (zeroed) entries. This
winds up sending packets to :0 for any entry not overwritten by AddServer,
leading to a bunch of ICMP reject traffic.

This fix makes the initial allocation to be a capacity of MAX_GMETRIC_SERVERS
instead of len and uses append to add new entries. This obviates the need for
tracking NumServers as well.