From ea70734a9dcfb67c0be6347745e67e6046dc7245 Mon Sep 17 00:00:00 2001 From: Constantine Kovalensky <45331093+kovalensky@users.noreply.github.com> Date: Mon, 2 Oct 2023 20:56:11 +0400 Subject: [PATCH] Respond with loopback if peer list is empty (#933) Respond with loopback if peers list is empty --- bt/announce.php | 4 ++++ library/config.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bt/announce.php b/bt/announce.php index b872ff2dd..99b6af644 100644 --- a/bt/announce.php +++ b/bt/announce.php @@ -369,6 +369,10 @@ if (!$output) { LIMIT $numwant "); + if (empty($rowset)) { + $rowset[] = ['ip' => $ip, 'port' => $port]; + } + if ($compact_mode) { $peers = ''; diff --git a/library/config.php b/library/config.php index 0a2dcbd46..22f0fa97d 100644 --- a/library/config.php +++ b/library/config.php @@ -66,7 +66,7 @@ $bb_cfg['cache'] = [ 'redis' => [ 'host' => '127.0.0.1', 'port' => 6379, - 'pconnect' => PHP_ZTS ? false : true, + 'pconnect' => !PHP_ZTS, 'con_required' => true, ], // Available cache types: filecache, memcache, sqlite, redis, apcu (filecache by default)