This commit is contained in:
DariusIII
2022-02-06 20:41:42 +01:00
parent 51adc094a8
commit e312a9c2e6
3 changed files with 6 additions and 4 deletions
+5 -2
View File
@@ -188,16 +188,17 @@ class NNTP extends \Net_NNTP_Client
{
$primaryUSP = [
'ip' => gethostbyname(config('nntmux_nntp.server')),
'port' => config('nntmux_nntp.port')
'port' => config('nntmux_nntp.port'),
];
$alternateUSP = [
'ip_a' => gethostbyname(config('nntmux_nntp.alternate_server')),
'port_a' => config('nntmux_nntp.alternate_server_port')
'port_a' => config('nntmux_nntp.alternate_server_port'),
];
$primaryConnections = $this->_tmux->getUSPConnections('primary', $primaryUSP);
$alternateConnections = $this->_tmux->getUSPConnections('alternate', $alternateUSP);
if ($this->_isConnected() && (($alternate && $this->_currentServer === config('nntmux_nntp.alternate_server') && ($this->_primaryNntpConnections < $alternateConnections['alternate']['active'])) || (! $alternate && $this->_currentServer === config('nntmux_nntp.server') && ($this->_primaryNntpConnections < $primaryConnections['primary']['active'])))) {
dump('true');
return true;
}
@@ -311,6 +312,7 @@ class NNTP extends \Net_NNTP_Client
if (! $compression || (int) Settings::settingValue('..compressedheaders') === 0) {
$this->_compressionSupported = false;
}
return true;
}
// If we reached this point and have not connected after all retries, break out of the loop.
@@ -1409,6 +1411,7 @@ class NNTP extends \Net_NNTP_Client
// 201, Posting NOT allowed
case NET_NNTP_PROTOCOL_RESPONSECODE_READY_POSTING_PROHIBITED:
$this->_logger?->info('Posting not allowed!');
return false;
default:
return $this->_handleErrorResponse($response);
+1 -1
View File
@@ -14,5 +14,5 @@ return [
'socket_timeout' => env('NNTP_SOCKET_TIMEOUT', 120),
'alternate_server_socket_timeout' => env('NNTP_SOCKET_TIMEOUT_A', 120),
'main_nntp_connections' => env('NNTP_CONNECTIONS', 1),
'alternate_nntp_connections' => env('NNTP_CONNECTIONS_A', 1)
'alternate_nntp_connections' => env('NNTP_CONNECTIONS_A', 1),
];
-1
View File
@@ -52,4 +52,3 @@ try {
} catch (ErrorException $e) {
echo $e->getMessage();
}