chg: [curl client] added option for timeout

pull/9660/head
iglocska 2024-04-03 09:50:57 +02:00
parent 09eaacaf38
commit 51782c1d03
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
3 changed files with 14 additions and 2 deletions

View File

@ -7,7 +7,7 @@ class CurlClient extends HttpSocketExtended
private $ch;
/** @var int */
private $timeout = 30;
private $timeout = 10800;
/** @var string|null */
private $caFile;
@ -38,6 +38,8 @@ class CurlClient extends HttpSocketExtended
{
if (isset($params['timeout'])) {
$this->timeout = $params['timeout'];
} else {
$this->timeout = Configure::check('MISP.curl_request_timeout') ? Configure::read('MISP.curl_request_timeout') : 10800;
}
if (isset($params['ssl_cafile'])) {
$this->caFile = $params['ssl_cafile'];

View File

@ -82,7 +82,9 @@ class SyncTool
}
$params['ssl_crypto_method'] = $version;
}
if (!isset($params['timeout'])) {
$params['timeout'] = Configure::check('MISP.curl_request_timeout') ? Configure::read('MISP.curl_request_timeout') : 10800;
}
if (function_exists('curl_init')) {
App::uses('CurlClient', 'Tools');
$HttpSocket = new CurlClient($params);

View File

@ -5123,6 +5123,14 @@ class Server extends AppModel
'type' => 'numeric',
'null' => true
),
'curl_request_timeout' => [
'level' => 1,
'description' => __('Control the timeout of curl requests issued by MISP (during synchronisation, feed fetching, etc.'),
'value' => 10800,
'test' => 'testForNumeric',
'type' => 'numeric',
'null' => true
],
'disable_sighting_loading' => [
'level' => 1,
'description' => __('If an instance has an extremely high number of sightings, including the sightings in the search algorithms can bring an instance to a grinding halt. Enable this setting to temporarily disable the search until the issue is remedied. This setting will also disable sightings from being attached via /events/view API calls.'),