From 4a5e36d63e11c6e7a7fb0cf2e874cdd4479ece55 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Tue, 7 Oct 2014 09:33:19 -0400 Subject: [PATCH] switch_pgsql.c switch_pgsql_next_result_timed() was using switch_time_now() for start time and switch_micro_time_now() for current time. These are different time sources that may not be in sync and could cause the query to timeout prematurely. --- src/switch_pgsql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_pgsql.c b/src/switch_pgsql.c index ccf64d1503..74eea5cb8e 100644 --- a/src/switch_pgsql.c +++ b/src/switch_pgsql.c @@ -305,7 +305,7 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_next_result_timed(switch_pgsq if (PQisBusy(handle->con)) { /* Wait for a result to become available, up to msec milliseconds */ - start = switch_time_now(); + start = switch_micro_time_now(); while((ctime = switch_micro_time_now()) - start <= usec) { int wait_time = (usec - (ctime - start)) / 1000; fds[0].fd = handle->sock;