mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
try to use clock_gettime to make sure we don't care if the system time changes
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7165 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -314,7 +314,7 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup(char **ip,
|
||||
switch_stun_packet_attribute_add_username(packet, username, 32);
|
||||
bytes = switch_stun_packet_length(packet);
|
||||
switch_socket_sendto(sock, remote_addr, 0, (void *) packet, &bytes);
|
||||
started = switch_time_now();
|
||||
started = switch_timestamp_now();
|
||||
|
||||
*ip = NULL;
|
||||
*port = 0;
|
||||
@@ -326,7 +326,7 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup(char **ip,
|
||||
break;
|
||||
}
|
||||
|
||||
if ((elapsed = (unsigned int) ((switch_time_now() - started) / 1000)) > 5000) {
|
||||
if ((elapsed = (unsigned int) ((switch_timestamp_now() - started) / 1000)) > 5000) {
|
||||
*err = "Timeout";
|
||||
switch_socket_shutdown(sock, SWITCH_SHUTDOWN_READWRITE);
|
||||
switch_socket_close(sock);
|
||||
|
Reference in New Issue
Block a user