mirror of https://github.com/MISP/MISP
chg: [curl client] added option for timeout
parent
09eaacaf38
commit
51782c1d03
|
@ -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'];
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.'),
|
||||
|
|
Loading…
Reference in New Issue