Revision 98ba8deb

View differences:

ml.c
1037 1037
{
1038 1038
	if (NAT_traversal == false) {
1039 1039
		debug("ML: NAT traversal request re-send\n");
1040
		send_stun_request(socketfd, &stun_server);
1041

  
1042
		/*
1043
		* enter a NAT traversal timeout that takes care of retransmission
1044
		*/
1045
		struct event *ev1;
1046
		struct timeval timeout_value_NAT_traversal = { 1, 0 };
1047
		ev1 = evtimer_new(base, nat_traversal_timeout, NULL);
1048
		event_add(ev1, &timeout_value_NAT_traversal);
1049 1040
		if(receive_SocketID_cb)
1050 1041
			(receive_SocketID_cb) (&local_socketID, 2);
1042
		try_stun();
1051 1043
	}
1052 1044
}
1053 1045

  
......
1098 1090

  
1099 1091
	event_add(ev, NULL);
1100 1092

  
1093
	try_stun();
1094
}
1095

  
1096
void try_stun()
1097
{
1101 1098
	if (isStunDefined()) {
1102 1099
		/*
1103 1100
		* send the NAT traversal STUN request
......
1121 1118
		NAT_traversal = true; // @TODO: this is not really NAT traversal, but a flag that init is over
1122 1119
		// callback to the upper layer indicating that the socketID is now
1123 1120
		// ready to use
1124
		(receive_SocketID_cb) (&local_socketID, 0);
1121
		if(receive_SocketID_cb)
1122
			(receive_SocketID_cb) (&local_socketID, 0); //success
1125 1123
	}
1126 1124
}
1127 1125

  

Also available in: Unified diff