From 307d9238f5fccc6bd5502e447d5657b0fbafd1e5 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 27 Apr 2016 12:04:31 +0200 Subject: [PATCH] (configd, mvc) add connect timeout, closes https://github.com/opnsense/core/issues/913 --- src/opnsense/mvc/app/library/OPNsense/Core/Backend.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/opnsense/mvc/app/library/OPNsense/Core/Backend.php b/src/opnsense/mvc/app/library/OPNsense/Core/Backend.php index a942a1413..b3c3bb4b5 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Core/Backend.php +++ b/src/opnsense/mvc/app/library/OPNsense/Core/Backend.php @@ -70,16 +70,17 @@ class Backend * @param string $event event string * @param bool $detach detach process * @param int $timeout timeout in seconds + * @param int $connect_timeout connect timeout in seconds * @return string * @throws \Exception */ - public function configdRun($event, $detach = false, $timeout = 120) + public function configdRun($event, $detach = false, $timeout = 120, $connect_timeout = 10) { $endOfStream = chr(0).chr(0).chr(0); $poll_timeout = 2 ; // poll timeout interval - // wait until socket exist for a maximum of $timeout - $timeout_wait = $timeout; + // wait until socket exist for a maximum of $connect_timeout + $timeout_wait = $connect_timeout; while (!file_exists($this->configdSocket)) { sleep(1); $timeout_wait -= 1;