actually allocate memory for the agent private address

This commit is contained in:
Stephen Birarda 2013-02-18 09:36:47 -08:00
parent 0cea1e80ff
commit 612662c475
2 changed files with 7 additions and 2 deletions

View file

@ -70,7 +70,12 @@ int addAgent(uint32_t ip, in_port_t port, char *private_ip, unsigned short priva
while ((ip != agents[i].ip || port != agents[i].public_port) && (i < num_agents)) {
i++;
}
if ((i == num_agents) || (agents[i].active == false)) is_new = 1;
if ((i == num_agents) || (agents[i].active == false)) {
is_new = 1;
agents[i].private_addr = new char[255];
}
agents[i].ip = ip;
agents[i].x = x;
agents[i].y = y;

View file

@ -60,7 +60,7 @@ int simulate_on = 1;
const int MAX_PACKET_SIZE = 1500;
char DOMAIN_HOSTNAME[] = "highfidelity.below92.com";
char DOMAIN_IP[100] = ""; // IP Address will be used first if not empty string
char DOMAIN_IP[100] = "192.168.1.47"; // IP Address will be used first if not empty string
const int DOMAINSERVER_PORT = 40102;
UDPSocket agentSocket(AGENT_UDP_PORT);