From 6eda1c0f04301ce382543fb2f85f5a3c30ba7ff3 Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 23 Jul 2014 15:39:33 -0500 Subject: [PATCH] tweak timeout a little as it was changing to 1000000 on the 5th try on return from switch_interval_time_from_timeval on OpenBSD --- src/switch_nat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/switch_nat.c b/src/switch_nat.c index 51f0c3d1d2..d1ab09eba1 100644 --- a/src/switch_nat.c +++ b/src/switch_nat.c @@ -165,15 +165,15 @@ static int get_pmp_pubaddr(char *pub_addr) do { struct timeval timeout = { 1, 0 }; + i++; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Checking for PMP %d/%d\n", i, max); - if ((r = getnatpmprequesttimeout(&natpmp, &timeout)) < 0) { err = "get timeout failed"; goto end; } - pflags = switch_wait_sock(natpmp.s, switch_interval_time_from_timeval(&timeout), SWITCH_POLL_READ | SWITCH_POLL_ERROR | SWITCH_POLL_HUP); + pflags = switch_wait_sock(natpmp.s, 1000, SWITCH_POLL_READ | SWITCH_POLL_ERROR | SWITCH_POLL_HUP); if ((pflags & SWITCH_POLL_ERROR) || (pflags & SWITCH_POLL_HUP)) { err = "wait sock failed";