mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
CS fixes
This commit is contained in:
+5
-2
@@ -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);
|
||||
|
||||
@@ -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),
|
||||
];
|
||||
|
||||
@@ -52,4 +52,3 @@ try {
|
||||
} catch (ErrorException $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user