mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
unbound: warning in PHP 7.1, the code can't really work
This commit is contained in:
parent
c4628a0b7c
commit
32e545ef7a
@ -115,26 +115,12 @@ function unbound_optimization()
|
||||
$optimization['outgoing_range'] = "outgoing-range: {4096}";
|
||||
}
|
||||
|
||||
/*
|
||||
* Larger socket buffer for busy servers
|
||||
* Check that it is set to 4MB (by default the OS has it configured to 4MB)
|
||||
*/
|
||||
if (isset($config['sysctl']['item'])) {
|
||||
foreach ($config['sysctl']['item'] as $tunable) {
|
||||
if ($tunable['tunable'] == 'kern.ipc.maxsockbuf') {
|
||||
$so = floor(($tunable['value']/1024/1024)-1);
|
||||
// Check to ensure that the number is not a negative
|
||||
if ($so > 0) {
|
||||
$optimization['so_rcvbuf'] = "so-rcvbuf: {$so}m";
|
||||
} else {
|
||||
unset($optimization['so_rcvbuf']);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Safety check in case kern.ipc.maxsockbuf is not available.
|
||||
if (!isset($optimization['so_rcvbuf'])) {
|
||||
$optimization['so_rcvbuf'] = "#so-rcvbuf: 4m";
|
||||
}
|
||||
/* Larger socket buffer for busy servers */
|
||||
$so = floor((get_default_sysctl_value('kern.ipc.maxsockbuf')/1024/1024)-1);
|
||||
if ($so > 0) {
|
||||
$optimization['so_rcvbuf'] = "so-rcvbuf: {$so}m";
|
||||
} else {
|
||||
unset($optimization['so_rcvbuf']);
|
||||
}
|
||||
|
||||
return $optimization;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user