Skip to content

Commit

Permalink
Fix #1228 Allow users to define how many HTTP requests to follow.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelherger committed Nov 24, 2024
1 parent 75edf40 commit 87e6eee
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changelog9.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ <h2><a name="v9.0.0" id="v9.0.0"></a>Introducing... Lyrion Music Server Version
<li><a href="https://github.com/LMS-Community/slimserver/issues/1095">#1095</a> - Link from online tracks and albums to local library (if possible).</li>
<li><a href="https://github.com/LMS-Community/slimserver/pull/1115">#1115</a> - Add option to show tracks from a given year, even if their album would be listed in a different year.</li>
<li><a href="https://github.com/LMS-Community/slimserver/pull/1132">#1132</a> - Allow user defined contributor roles (thanks @darrel-k!).</li>
<li><a href="https://github.com/LMS-Community/slimserver/issues/1228">#1228</a> - Allow user to define how many HTTP requests to follow.</li>
</ul>
<br />

Expand Down
4 changes: 4 additions & 0 deletions HTML/EN/settings/server/networking.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<input type="text"class="stdedit" name="pref_httpport" id="httpport" value="[% prefs.pref_httpport | html %]" size="15">
[% END %]

[% WRAPPER setting title="SETUP_MAX_REDIRECTS" desc="SETUP_MAX_REDIRECTS_DESC" %]
<input type="text"class="stdedit sliderInput_0_20_1" name="pref_maxRedirects" id="maxRedirects" value="[% prefs.pref_maxRedirects | html %]" size="15">
[% END %]

[% WRAPPER settingSection %]
[% WRAPPER settingGroup title="SETUP_BUFFERSECS" desc="SETUP_BUFFERSECS_DESC" %]
<input type="text"class="stdedit sliderInput_3_30_1" name="pref_bufferSecs" id="bufferSecs" value="[% prefs.pref_bufferSecs | html %]" size="15">
Expand Down
3 changes: 1 addition & 2 deletions Slim/Networking/Async/HTTP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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} ) {
Expand Down
1 change: 1 addition & 0 deletions Slim/Utils/Prefs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '',
Expand Down
2 changes: 1 addition & 1 deletion Slim/Web/Settings/Server/Network.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
16 changes: 15 additions & 1 deletion strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 87e6eee

Please sign in to comment.