From 87e6eee436dc9a15b0fc7565a10a4a73548590b0 Mon Sep 17 00:00:00 2001 From: Michael Herger Date: Sun, 24 Nov 2024 20:31:11 +0100 Subject: [PATCH] Fix #1228 Allow users to define how many HTTP requests to follow. --- Changelog9.html | 1 + HTML/EN/settings/server/networking.html | 4 ++++ Slim/Networking/Async/HTTP.pm | 3 +-- Slim/Utils/Prefs.pm | 1 + Slim/Web/Settings/Server/Network.pm | 2 +- strings.txt | 16 +++++++++++++++- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Changelog9.html b/Changelog9.html index 7d16a1b65ac..7fa5bf80dc4 100644 --- a/Changelog9.html +++ b/Changelog9.html @@ -14,6 +14,7 @@

Introducing... Lyrion Music Server Version
  • #1095 - Link from online tracks and albums to local library (if possible).
  • #1115 - Add option to show tracks from a given year, even if their album would be listed in a different year.
  • #1132 - Allow user defined contributor roles (thanks @darrel-k!).
  • +
  • #1228 - Allow user to define how many HTTP requests to follow.

  • diff --git a/HTML/EN/settings/server/networking.html b/HTML/EN/settings/server/networking.html index 725cd13263c..3c99dd9db81 100644 --- a/HTML/EN/settings/server/networking.html +++ b/HTML/EN/settings/server/networking.html @@ -7,6 +7,10 @@ [% END %] + [% WRAPPER setting title="SETUP_MAX_REDIRECTS" desc="SETUP_MAX_REDIRECTS_DESC" %] + + [% END %] + [% WRAPPER settingSection %] [% WRAPPER settingGroup title="SETUP_BUFFERSECS" desc="SETUP_BUFFERSECS_DESC" %] diff --git a/Slim/Networking/Async/HTTP.pm b/Slim/Networking/Async/HTTP.pm index 5512af523ba..fbc91f72639 100644 --- a/Slim/Networking/Async/HTTP.pm +++ b/Slim/Networking/Async/HTTP.pm @@ -63,7 +63,6 @@ use Slim::Utils::Timers; use Slim::Utils::Versions; use constant BUFSIZE => 16 * 1024; -use constant MAX_REDIR => 7; my $prefs = preferences('server'); @@ -186,7 +185,7 @@ sub use_proxy { sub send_request { my ( $self, $args, $redirect ) = @_; - $self->maxRedirect( $args->{maxRedirect} // MAX_REDIR ); + $self->maxRedirect( $args->{maxRedirect} // $prefs->get('maxRedirects') ); $self->response( undef ) unless $redirect; if ( $args->{Timeout} ) { diff --git a/Slim/Utils/Prefs.pm b/Slim/Utils/Prefs.pm index 25fb6f2dbb3..0bd022599df 100644 --- a/Slim/Utils/Prefs.pm +++ b/Slim/Utils/Prefs.pm @@ -210,6 +210,7 @@ sub init { 'maxWMArate' => 9999, 'tcpConnectMaximum' => 30, # not on web page 'udpChunkSize' => 1400, # only used for Slimp3 + 'maxRedirects' => 7, # Server Settings - Performance 'disableStatistics' => 0, 'serverPriority' => '', diff --git a/Slim/Web/Settings/Server/Network.pm b/Slim/Web/Settings/Server/Network.pm index 58f5fd9911b..9b29d32801a 100644 --- a/Slim/Web/Settings/Server/Network.pm +++ b/Slim/Web/Settings/Server/Network.pm @@ -25,7 +25,7 @@ sub page { } sub prefs { - my @prefs = qw(webproxy httpport bufferSecs remotestreamtimeout maxWMArate useEnhancedHTTP); + my @prefs = qw(webproxy httpport bufferSecs remotestreamtimeout maxRedirects maxWMArate useEnhancedHTTP); # only show following for SLIMP3 if ($Slim::Player::SLIMP3::SLIMP3Connected) { diff --git a/strings.txt b/strings.txt index fa6543651bc..f15c7d2d585 100644 --- a/strings.txt +++ b/strings.txt @@ -4346,7 +4346,7 @@ SETUP_GROUP_FORMATS_CONVERSION_DESC SETUP_FORMATS_PREFER_NATIVE CS Preferovat nativní formát (dekódování v přehrávači), kdykoli je to možné - DA Benyt indbygget format til afkodning (undgå transkodning) når muligt + DA Benyt indbygget format til afkodning (undgå transkodning) når muligt DE Native Wiedergabe auf dem Player wenn immer möglich bevorzugen EN Prefer native format (decoding on the player) whenever possible FR Utiliser le format natif si possible (éviter le transcodage) @@ -9795,6 +9795,20 @@ SETUP_UDPCHUNKSIZE SV Maximal UDP-datastorlek ZH_CN 最大UDP数据大小 +SETUP_MAX_REDIRECTS + DE Maximale Anzahl Weiterleitungen + DA Maksimalt antal omdirigeringer + EN Maximum number of redirects + FR Nombre maximal de redirections + NL Maximum aantal omleidingen + +SETUP_MAX_REDIRECTS_DESC + DE Die maximale Anzahl von HTTP Weiterleitungen, die gefolgt werden soll. Werden weitere Weiterleitungen angefordert, so gilt die Anfrage als fehlgeschlagen. + DA Det maksimale antal HTTP-omdirigeringer, der skal følges. Hvis der kræves flere omdirigeringer, betragtes anmodningen som mislykket. + EN The maximum number of HTTP redirects to follow. Should more redirects be required, then the request is considered failure. + FR Nombre maximal de redirections HTTP à suivre. Si plus de redirections sont nécessaires, la demande est considérée comme un échec. + NL Het maximale aantal HTTP-omleidingen dat moet worden gevolgd. Als er meer omleidingen nodig zijn, wordt het verzoek als mislukt beschouwd. + SETUP_WEBPROXY CS Webový proxy server DA Webproxy