From b12b7435d3e792582bb0acb5fe47105191e7df1e Mon Sep 17 00:00:00 2001 From: Brian Moon Date: Fri, 24 Feb 2023 14:27:52 -0600 Subject: [PATCH] Fix timeout before adding it to the payload --- Net/Gearman/Connection.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Net/Gearman/Connection.php b/Net/Gearman/Connection.php index 824486c3..fd1a1c5c 100644 --- a/Net/Gearman/Connection.php +++ b/Net/Gearman/Connection.php @@ -261,6 +261,10 @@ public function send($command, array $params = array()) throw new Net_Gearman_Exception('Invalid command: ' . $command); } + if ($command === 'can_do_timeout') { + $params = $this->fixTimeout($params); + } + $data = array(); foreach ($this->commands[$command][1] as $field) { if (isset($params[$field])) { @@ -268,10 +272,6 @@ public function send($command, array $params = array()) } } - if ($command === 'can_do_timeout') { - $params = $this->fixTimeout($params); - } - $d = implode("\x00", $data); $cmd = "\0REQ" . pack("NN",